diff --git a/.github/workflows/submodules.yml b/.github/workflows/submodules.yml new file mode 100644 index 0000000..463aa5e --- /dev/null +++ b/.github/workflows/submodules.yml @@ -0,0 +1,20 @@ +name: 'update submodules' + +on: + workflow_dispatch: + +jobs: + sync: + name: 'update submodules' + runs-on: ubuntu-latest + steps: + - name: checkout repo + uses: actions/checkout@v2 + with: + submodules: true + - name: pull updates + run: | + git pull --recurse-submodules + git submodule update --remote --recursive + - name: commit changes + uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.gitmodules b/.gitmodules index 65dd035..5786be6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,16 @@ [submodule "api"] path = api url = git@github.com:notion-enhancer/api.git + branch = dev +[submodule "repo"] + path = repo + url = git@github.com:notion-enhancer/repo.git + branch = dev +[submodule "media"] + path = media + url = git@github.com:notion-enhancer/media.git + branch = main +[submodule "dep"] + path = dep + url = git@github.com:notion-enhancer/dep.git + branch = main diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 14fb0c9..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,361 +0,0 @@ -# changelog - -### v0.11.0 (dev) - -a complete rework of the enhancer including a port to the browser as a chrome extension. - -- new: cross-environment and properly documented api to replace helpers. -- new: cross-environment mod loader structure. -- new: notifications sourced from an online endpoint for sending global user alerts. -- new: simplify user installs by depending on the chrome web store and [notion-repackaged](https://github.com/notion-enhancer/notion-repackaged). -- new: separate menu profiles for mod configurations. -- new: a hotkey option type that allows typing in/pressing a hotkey to enter it, instead of typing. -- improved: split the core mod into separate mods for specific features. -- improved: theming variables that are more specific, less laggy, and less complicated. -- improved: merged bracketed-links into tweaks. -- improved: a redesigned menu with nicer ui, separate categories for mods and a sidebar for configuration. -- removed: integrated scrollbar tweak (notion now includes by default). -- removed: js insert. css insert moved to tweaks mod. -- removed: majority of layout and font size variables - better to leave former to notion and use `ctrl +` for latter. -- bugfix: bypass csp restrictions. - -**below this point the enhancer was desktop-only. in v0.11.0 it was been ported to also** -**run as a chrome extension. changes made to both are indicated above.** - -### v0.10.2 (2020-12-05) - -again, an emergency release for bugfixes. -not properly documented and new features have not yet been fully reviewed/edited. - -- new: side panel - adds an extra sidebar on the right for use by other mods, - toggleable with `ctrl+shift+backslash`. -- improved: notion icons uses spritesheets for faster loading of icons. -- improved: icon sets can be hidden/toggled. -- improved: toggles in the enhancer menu follow the same style as notion's toggles. -- improved: separate quote font variable & option in the font chooser mod (`--theme_[dark|light]--font_quote`). -- improved: option to hide the "page details" text for the word counter extension. -- bugfix: notion icons tab is now visible in fullpage databases. -- bugfix: code line numbers handles wrapped code blocks. -- bugfix: file explorer no longer opens when enhancer menu is opened. -- bugfix: enable the remote module in webviews (windows/tabs) for compatibility with the - updated version of electron used by new notion builds (>= 2.0.10). -- bugfix: add support for enhancing an `app` folder if there is no `app.asar` file present. -- extension: "outliner" = table of contents in right sidebar. -- extension: "panel sites" = embed sites on the site panel. -- extension: "indentation lines" = adds vertical relationship lines to make list trees easier to follow. -- extension: "truncated table titles" = see the full text of the truncated table titles on hover over. - -> 📥 `npm i -g notion-enhancer@0.10.2` - -### v0.10.1 (2020-11-18) - -essentially a prerelease for v0.11.0: pushed out for urgent bugfixes during -exam/study weeks when there's no time to code a full release. - -note that this means new features have not yet been fully documented and -may not be fully ready for ideal use yet. however, things overall will -work more reliably than v0.10.0. - -- new: different css entrypoints for different components (tabs, menu, app). -- improved: use an svg for the scroll-to-top button. -- improved: use a better-matching icon and add transitions to the property layout toggle. -- improved: themes are directly applied to tabs and menu rather than sync-ed between (infinite loading). -- improved: error message "is notion running?" --> clearer "make sure notion isn't running!" -- improved: auto-shrink system for tabs (max of 15 open in a window). -- bugfix: disable fadein of selected block halo with snappy transitions. -- bugfix: increase contrast of `--theme_dark--interactive_hover` in dark+ and dracula. -- bugfix: tabs are focused properly for input. -- bugfix: keyboard shortcut listeners are stricter so they don't conflict. -- bugfix: dots indicating draggability are no longer next to the tabs mod in the menu. -- bugfix: prevent empty hotkeys from triggering every keypress. -- bugfix: don't try loading an empty default page url (infinite loading). -- bugfix: remove `* { z-index: 1}` rule so format dropdowns in table view can be opened. -- extension: "topbar icons" = replaces the topbar buttons with icons. -- extension: "code line numbers" = adds line numbers to code blocks. -- extension: "notion icons" = use custom icon sets directly in notion. -- tweak: vertical indentation/relationship lines for lists. -- tweak: scroll database toolbars horizontally if partially hidden. -- tweak: condense bullet points (decrease line spacing). - -> 📥 `npm i -g notion-enhancer@0.10.1` - -### v0.10.0 (2020-11-02) - -a flexibility update. - -- new: mods can be reordered in the menu to control what order styling/scripts are added/executed in. - higher up on the list = higher priority of application = loaded last in order to override others. - (excluding the core, which though pinned to the top of the list is always loaded first so theming - variables can be modified.) -- new: relaunch button in tray menu. -- new: a core mod option for a default page id/url (all new windows will load it instead of the - normal "most recent" page). -- new: css variables for increasing line spacing/paragraph margins. -- new: patch the notion:// url scheme/protocol to work on linux. -- new: menu shows theme conflicts + a core mod option to auto-resolve theme conflicts. -- new: a `-n` cli option. -- improved: menu will now respect integrated titlebar setting. -- improved: use keyup listeners instead of a globalShortcut for the enhancements menu toggle. -- improved: overwrite `app.asar.bak` if already exists (e.g. for app updates). -- improved: additional menu option descriptions on hover. -- improved: listen to prefers-color-scheme to better change theme in night shift. -- improved: platform-specific option overrides for features not required on macOS. -- improved: made extra padding at the bottom with the "focus mode" extension toggleable. -- bugfix: removed messenger emoji set as the provider no longer supports it. -- bugfix: remove shadow around light mode board headers. -- bugfix: properly detect/respond to `EACCES`/`EBUSY` errors. -- bugfix: night shift checks every interaction, - will respond to system changes without any manual changes. -- bugfix: toc blocks can have text colours. -- bugfix: bypass preview extension works with the back/forward keyboard shortcuts. -- bugfix: (maybe) fix csp issues under proxy. -- bugfix: remove focus mode footer from neutral theme + better contrast in calendar views. -- bugfix: improvements to the colour theming, particularly to make real- and fake-light/dark - modes (as applied by the night shift extension) look consistent. - relevant variables (assuming all are prefixed by `--theme_[dark|light]--`): - `box-shadow`, `box-shadow_strong`, `select_input`, and `ui-border` -- bugfix: font sizing applied to overlays/previews. -- bugfix: removed typo in variable name for brown text. -- bugfix: primary-colour text (mainly in "add a \_" popups) is now properly themed. -- bugfix: right-to-left extension applies to text in columns. -- bugfix: block text colour applies to text with backgrounds. -- bugfix: font applied to wrong mode with littlepig dark. -- bugfix: keep "empty" top bar visible in the menu. -- bugfix: set NSRequiresAquaSystemAppearance to false in /Applications/Notion.app/Contents/Info.plist - so system dark/light mode can be properly detected. -- bugfix: make ctrl+f popover shadow less extreme. -- bugfix: "weekly" calendar view name made case insensitive. -- bugfix: re-show hidden windows when clicking on the dock. -- tweak: sticky table/list rows. -- theme: "material ocean" = an oceanic colour palette. -- theme: "cherry cola" = a delightfully plummy, cherry cola flavored theme. -- theme: "dracula" = a theme based on the popular dracula color palette - originally by zeno rocha and friends. -- extension: "tabs" = have multiple notion pages open in a single window. tabs can be controlled - with keyboard shortcuts and dragged/reordered within/between windows. -- extension: "scroll to top" = add an arrow above the help button to scroll back to the top of a page. -- extension: "tweaks" = common style/layout changes. includes: - - new: make transitions snappy/0s. - - new: in-page columns are disabled/wrapped and pages are wider when - the window is narrower than 600px for improved responsiveness. - - new: thicker bold text for better visibility. - - new: more readable line spacing. - - moved: smooth scrollbars. - - moved: change dragarea height. - - moved: hide help. - -a fork of notion-deb-builder that does generate an app.asar has been created and is once again supported. - -> 📥 `npm i -g notion-enhancer@0.10.0` - -### v0.9.1 (2020-09-26) - -- bugfix: font chooser will continue iterating through fonts after encountering a blank option. -- bugfix: block indents are no longer overriden. -- bugfix: neutral does not force full width pages. -- bugfix: bypass preview extension works with the back/forward arrows. -- bugfix: check all views on a page for a weekly calendar. -- bugfix: emoji sets no longer modifies the user agent = doesn't break hotkeys. - -> 📥 `npm i -g notion-enhancer@0.9.1` - -### v0.9.0 (2020-09-20) - -a feature and cleanup update. - -- improved: halved the number of css rules used -> much better performance. -- improved: font imports must be define in the `mod.js` so that they can also be used in - the enhancements menu. -- improved: tiling window-manager support (can hide titlebars entirely without dragarea/buttons). -- improved: extensions menu search is now case insensitive and includes options, inputs and versions. - the search box can also for focused with `CMD/CTRL+F`. -- improved: extensions menu filters shown either a ✓ or × to help understand the current state. -- improved: added individual text-colour rules for different background colours. -- improved: added variables for callout colouring. -- improved: replaced with `helpers.getNotion()` with the constant `helpers.__notion` to reduce - repeated function calls. -- improved: added variables for page width. -- improved/bugfix: emoji sets extension should now work on macOS and will change user agent to use - real emojis instead of downloading images when system default is selected. -- bugfix: enhancer settings should no longer reset on update (though this will not have - effect until the release after this one). -- bugfix: blue select tags are no longer purple. -- bugfix: page titles now respond to small-text mode. -- bugfix: weekly calendar view height is now sized correctly according to its contents. -- bugfix: made the open enhancements menu hotkey configurable and changed the default to `ALT+E`. - to remove conflict with the inline code highlight shortcut. -- bugfix: update property-layout to match notion changes again. -- bugfix: updated some of the tweak styling to match notion changes. -- bugfix: block-level text colours are now changed properly. -- bugfix: do not require data folder during installation, to prevent `sudo` attempting to - create it in `/var/root/`. -- bugfix: bullet points/checkboxes will now align properly in the right-to-left extension. -- themes: "littlepig" (light + dark) = monospaced themes using emojis and colourful text. -- extension: "font chooser" = customize fonts. for each option, type in the name of the font you would like to use, - or leave it blank to not change anything. -- extension: "always on top" = add an arrow/button to show the notion window on top of other windows - even if it's not focused. -- extension: "calendar scroll" = add a button to scroll down to the current week in fullpage/infinite-scroll calendars. -- extension: "hide help button" = hide the help button if you don't need it. -- extension: "bypass preview" = go straight to the normal full view when opening a page. -- extension: "word counter" = add page details: word/character/sentence/block count & speaking/reading times. - -notion-deb-builder has been discovered to not generate an app.asar and so is no longer supported. - -> 📥 `npm i -g notion-enhancer@0.9.0` - -### v0.8.5 (2020-08-29) - -- bugfix: separate text highlight and select tag variables. -- bugfix: bypass CSP for the `enhancement://` protocol - was failing on some platforms? - -> 📥 `npm i -g notion-enhancer@0.8.5` - -### v0.8.4 (2020-08-29) - -- bugfix: property-layout now works consistently with or without a banner. - -> 📥 `npm i -g notion-enhancer@0.8.4` - -### v0.8.3 (2020-08-29) - -previous release was a mistake: it did as intended on linux, but broke windows. -this should achieve the same thing in a more compatible way. - -> 📥 `npm i -g notion-enhancer@0.8.3` - -### v0.8.2 (2020-08-28) - -some things you just can't test until production... fixed the auto-installer -to use `./bin.js` instead of `notion-enhancer` - -> 📥 `npm i -g notion-enhancer@0.8.2` - -### v0.8.1 (2020-08-28) - -a clarity and stability update. - -- improved: more informative cli error messages (original ones can be accessed with the `-d/--dev` flag). -- bugfix: gallery variable didn't apply on fullpage. -- bugfix: date picker hid current date number. -- bugfix: small-text pages should now work as expected. -- bugfix: padding issues in page previews. -- bugfix: property-layout extension had been broken by internal notion changes. -- bugfix: linux installer path typo. -- bugfix: caret-color was being mistaken for color and block-level text colouring was broken. -- improved: auto-application on install. - -> 📥 `npm i -g notion-enhancer@0.8.1` - -### v0.8.0 (2020-08-27) - -complete rewrite with node.js. - -- new: simpler cli installation system (inc. commands: `apply`, `remove`, and `check`). -- new: mod loading system (easier to create new mods, adds to notion rather than overwriting). -- new: mod configuration menu. -- improved: more theming variable coverage - inc. light theme and sizing/spacing. -- bugfix: non-reproducable errors with python. -- bugfix: better launcher patching on linux. -- bugfix: fix frameless window issue introduced by notion desktop 2.0.9. -- extension: "custom inserts" = link files for small client-side tweaks. -- extension: "bracketed links" = render links surrounded with \[\[brackets]] instead of underlined. -- extension: "focus mode" = hide the titlebar/menubar if the sidebar is closed (will be shown on hover). -- theme: "dark+" = a vivid-colour near-black theme. -- theme: "neutral" = smoother colours and fonts, designed to be more pleasing to the eye. -- theme: "gameish" = a purple, "gamer-styled" theme with a blocky-font. -- theme: "pastel dark" = a smooth-transition true dark theme with a hint of pastel. -- extension: "emoji sets" = pick from a variety of emoji styles to use. -- extension: "night shift" = sync dark/light theme with the system (overrides normal theme setting). -- extension: "right-to-left" = enables auto rtl/ltr text direction detection. (ported from [github.com/obahareth/notion-rtl](https://github.com/obahareth/notion-rtl).) -- extension: "weekly view" = calendar views named "weekly" will show only the 7 days of this week. (ported from [github.com/adihd/notionweeklyview](https://github.com/adihd/notionweeklyview).)] -- extension: "property layout" = auto-collapse page properties that usually push down page content. (ported from [github.com/alexander-kazakov/notion-layout-extension](https://github.com/alexander-kazakov/notion-layout-extension).) - -> 📥 `npm i -g notion-enhancer@0.8.0` - -### v0.7.0 (2020-07-09) - -- new: tray option to use system default emojis (instead of twitter's emojiset). -- new: mac support (identical functionality to other platforms with the - exception of the native minimise/maximise/close buttons being kept, as they integrate - better with the OS while not being out-of-place in notion). -- new: notion-deb-builder support for linux. -- new: an alert will be shown if there is an update available for the enhancer. -- improved: replaced button symbols with svgs for multi-platform support. -- improved: window close button is now red on hover (thanks to [@torchatlas](https://github.com/torchatlas)). -- bugfix: `cleaner.py` patched for linux. -- bugfix: tray now operates as expected on linux. -- bugfix: odd mix of `\\` and `/` being used for windows filepaths. -- bugfix: app no longer crashes when sidebar is toggled. - -> 📥 [notion-enhancer.v0.7.0.zip](https://github.com/notion-enhancer/notion-enhancer/archive/v0.7.0.zip) - -### v0.6.0 (2020-06-30) - -- style: custom fonts. -- style: font resizing. -- style: hide discussions (thanks to [u/Roosmaryn](https://www.reddit.com/user/Roosmaryn/)). -- new: custom colour theming, demonstrated via the dark+ theme. -- new: linux support (thanks to [@Blacksuan19](https://github.com/Blacksuan19)). -- improved: if hotkey is pressed while notion is unfocused, it will bring it to the front rather than hiding it. -- improved: stop window buttons breaking at smaller widths. -- improved: more obviously visible drag area. -- bugfix: specify UTF-8 encoding to prevent multibyte/gbk codec errors (thanks to [@etnperlong](https://github.com/etnperlong)). - -> 📥 [notion-enhancer.v0.6.0.zip](https://github.com/notion-enhancer/notion-enhancer/archive/v0.6.0.zip) - -### v0.5.0 (2020-05-23) - -- new: running from the wsl. -- new: reload window with f5. -- improved: code has been refactored and cleaned up, - inc. file renaming and a `customiser.py` that doesn't require - a run of `cleaner.py` to build modifications. - improved: scrollbar colours that fit better with notion's theming. -- bugfix: un-break having multiple notion windows open. - -> 📥 [notion-enhancer.v0.5.0.zip](https://github.com/notion-enhancer/notion-enhancer/archive/v0.5.0.zip) - -**development here taken over by [@dragonwocky](https://github.com/dragonwocky).** - -**the ~~crossed out~~ features below are no longer features included by default,** -**but can still easily be added as [custom tweaks](https://github.com/notion-enhancer/tweaks).** - -### v0.4.1 (2020-02-13) - -- bugfix: wider table & the "+" button not working in database pages. - -> 📥 [notion-enhancer.v4.1.zip](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d239a3cf-d553-4ef3-ab04-8b47892d9f9a/Notion_Customization_v4.1.zip) - -### v0.4.0 - -- new: tray icon. -- new: app startup options (+ saving). -- new: `Reset.py` -- improved: better output from `Customization Patcher.py`. -- bugfix: wider tables in "short page" mode. -- bugfix: unclickable buttons/draggable area (of titlebar). - -### v0.3.0 - -- new: show/hide window hotkey. -- new: app startup options. -- ~~style: smaller table icons.~~ - -> 📥 [notion-enhancer.v3.zip](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b01aa446-5727-476a-a25e-395472bfb1be/NotionScriptsV3.zip) - -### v0.2.0 - -- new: light/dark theme support for window control buttons + scrollbars. -- new: custom styles directly linked to the enhancer resources + compatible with web version. -- ~~improved: making table column width go below 100px.~~ - -### v0.1.0 - -- new: custom window control buttons. -- removed: default titlebar/menubar. -- ~~removed: huge padding of board view.~~ -- ~~removed: huge padding of table view.~~ -- ~~optional: making table column width go below 100px.~~ -- ~~style: thinner cover image + higher content block.~~ -- style: scrollbars. diff --git a/README.md b/README.md index 2059e78..420700e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,5 @@ -# extension +# notion-enhancer/extension -bringing all your favourite notion-enhancer features to the browser (wip) +an enhancer/customiser for the all-in-one productivity workspace notion.so (browser) -> considering that using notion in the browser is more lightweight & probably preferred for some people since it means they have less apps open, i've always planned to eventually port the enhancer to be a chrome extension. -> -> since the enhancer focuses on being able to manipulate notion's app files, it's not going to be a very friendly transfer to web - a few features will have to be lost (e.g. frameless mode & tabs, of course) and the extensions system will need to be completely rebuilt. -> -> to make this work better, i'm splitting things up: an mod repository, a chrome extension, and an app loader. -> -> i'll be building the enhancer chrome-first from now on, since it'll be more limited there (and it's easier to add extra features when porting than to take features out), and then releasing the app loader a little afterwards. both the app loader and the chrome extension will source the same themes & extensions from the mod repository, and updates & releases of individual mods won't require waiting for the enhancer version anymore. - --- from the #announcements channel of the [notion-enhancer discord](https://discord.gg/sFWPXtA) +[read the docs online](https://notion-enhancer.github.io/) diff --git a/api b/api index 5030fe2..9815d73 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit 5030fe2b0fd71b397796b055934ec50f7e909a5c +Subproject commit 9815d73b9277e96864654a8d8dd48762039c9845 diff --git a/dep b/dep new file mode 160000 index 0000000..1a47625 --- /dev/null +++ b/dep @@ -0,0 +1 @@ +Subproject commit 1a4762550fe185706be26678f734b0475066c3e4 diff --git a/dep/feather-sprite.svg b/dep/feather-sprite.svg deleted file mode 100644 index 6e20a2c..0000000 --- a/dep/feather-sprite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/dep/jscolor.min.js b/dep/jscolor.min.js deleted file mode 100644 index 8bb82f9..0000000 --- a/dep/jscolor.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * JSColor v2.4.6 - * @licence GNU GLP v3 - * @source https://jscolor.com/ - */ -(function (global, factory) { "use strict"; if (typeof module === "object" && typeof module.exports === "object") { module.exports = global.document ? factory(global) : function (win) { if (!win.document) { throw new Error("jscolor needs a window with document") } return factory(win) }; return } factory(global) })(typeof window !== "undefined" ? window : this, function (window) { "use strict"; var jscolor = function () { var jsc = { initialized: false, instances: [], readyQueue: [], register: function () { if (typeof window !== "undefined" && window.document) { window.document.addEventListener("DOMContentLoaded", jsc.pub.init, false) } }, installBySelector: function (selector, rootNode) { rootNode = rootNode ? jsc.node(rootNode) : window.document; if (!rootNode) { throw new Error("Missing root node") } var elms = rootNode.querySelectorAll(selector); var matchClass = new RegExp("(^|\\s)(" + jsc.pub.lookupClass + ")(\\s*(\\{[^}]*\\})|\\s|$)", "i"); for (var i = 0; i < elms.length; i += 1){ if (elms[i].jscolor && elms[i].jscolor instanceof jsc.pub) { continue } if (elms[i].type !== undefined && elms[i].type.toLowerCase() == "color" && jsc.isColorAttrSupported) { continue } var dataOpts, m; if ((dataOpts = jsc.getDataAttr(elms[i], "jscolor")) !== null || elms[i].className && (m = elms[i].className.match(matchClass))) { var targetElm = elms[i]; var optsStr = ""; if (dataOpts !== null) { optsStr = dataOpts } else if (m) { console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.' + jsc.docsRef); if (m[4]) { optsStr = m[4] } } var opts = null; if (optsStr.trim()) { try { opts = jsc.parseOptionsStr(optsStr) } catch (e) { console.warn(e + "\n" + optsStr) } } try { new jsc.pub(targetElm, opts) } catch (e) { console.warn(e) } } } }, parseOptionsStr: function (str) { var opts = null; try { opts = JSON.parse(str) } catch (eParse) { if (!jsc.pub.looseJSON) { throw new Error("Could not parse jscolor options as JSON: " + eParse) } else { try { opts = new Function("var opts = (" + str + '); return typeof opts === "object" ? opts : {};')() } catch (eEval) { throw new Error("Could not evaluate jscolor options: " + eEval) } } } return opts }, getInstances: function () { var inst = []; for (var i = 0; i < jsc.instances.length; i += 1){ if (jsc.instances[i] && jsc.instances[i].targetElement) { inst.push(jsc.instances[i]) } } return inst }, createEl: function (tagName) { var el = window.document.createElement(tagName); jsc.setData(el, "gui", true); return el }, node: function (nodeOrSelector) { if (!nodeOrSelector) { return null } if (typeof nodeOrSelector === "string") { var sel = nodeOrSelector; var el = null; try { el = window.document.querySelector(sel) } catch (e) { console.warn(e); return null } if (!el) { console.warn("No element matches the selector: %s", sel) } return el } if (jsc.isNode(nodeOrSelector)) { return nodeOrSelector } console.warn("Invalid node of type %s: %s", typeof nodeOrSelector, nodeOrSelector); return null }, isNode: function (val) { if (typeof Node === "object") { return val instanceof Node } return val && typeof val === "object" && typeof val.nodeType === "number" && typeof val.nodeName === "string" }, nodeName: function (node) { if (node && node.nodeName) { return node.nodeName.toLowerCase() } return false }, removeChildren: function (node) { while (node.firstChild) { node.removeChild(node.firstChild) } }, isTextInput: function (el) { return el && jsc.nodeName(el) === "input" && el.type.toLowerCase() === "text" }, isButton: function (el) { if (!el) { return false } var n = jsc.nodeName(el); return n === "button" || n === "input" && ["button", "submit", "reset"].indexOf(el.type.toLowerCase()) > -1 }, isButtonEmpty: function (el) { switch (jsc.nodeName(el)) { case "input": return !el.value || el.value.trim() === ""; case "button": return el.textContent.trim() === "" }return null }, isPassiveEventSupported: function () { var supported = false; try { var opts = Object.defineProperty({}, "passive", { get: function () { supported = true } }); window.addEventListener("testPassive", null, opts); window.removeEventListener("testPassive", null, opts) } catch (e) { } return supported }(), isColorAttrSupported: function () { var elm = window.document.createElement("input"); if (elm.setAttribute) { elm.setAttribute("type", "color"); if (elm.type.toLowerCase() == "color") { return true } } return false }(), dataProp: "_data_jscolor", setData: function () { var obj = arguments[0]; if (arguments.length === 3) { var data = obj.hasOwnProperty(jsc.dataProp) ? obj[jsc.dataProp] : obj[jsc.dataProp] = {}; var prop = arguments[1]; var value = arguments[2]; data[prop] = value; return true } else if (arguments.length === 2 && typeof arguments[1] === "object") { var data = obj.hasOwnProperty(jsc.dataProp) ? obj[jsc.dataProp] : obj[jsc.dataProp] = {}; var map = arguments[1]; for (var prop in map) { if (map.hasOwnProperty(prop)) { data[prop] = map[prop] } } return true } throw new Error("Invalid arguments") }, removeData: function () { var obj = arguments[0]; if (!obj.hasOwnProperty(jsc.dataProp)) { return true } for (var i = 1; i < arguments.length; i += 1){ var prop = arguments[i]; delete obj[jsc.dataProp][prop] } return true }, getData: function (obj, prop, setDefault) { if (!obj.hasOwnProperty(jsc.dataProp)) { if (setDefault !== undefined) { obj[jsc.dataProp] = {} } else { return undefined } } var data = obj[jsc.dataProp]; if (!data.hasOwnProperty(prop) && setDefault !== undefined) { data[prop] = setDefault } return data[prop] }, getDataAttr: function (el, name) { var attrName = "data-" + name; var attrValue = el.getAttribute(attrName); return attrValue }, setDataAttr: function (el, name, value) { var attrName = "data-" + name; el.setAttribute(attrName, value) }, _attachedGroupEvents: {}, attachGroupEvent: function (groupName, el, evnt, func) { if (!jsc._attachedGroupEvents.hasOwnProperty(groupName)) { jsc._attachedGroupEvents[groupName] = [] } jsc._attachedGroupEvents[groupName].push([el, evnt, func]); el.addEventListener(evnt, func, false) }, detachGroupEvents: function (groupName) { if (jsc._attachedGroupEvents.hasOwnProperty(groupName)) { for (var i = 0; i < jsc._attachedGroupEvents[groupName].length; i += 1){ var evt = jsc._attachedGroupEvents[groupName][i]; evt[0].removeEventListener(evt[1], evt[2], false) } delete jsc._attachedGroupEvents[groupName] } }, preventDefault: function (e) { if (e.preventDefault) { e.preventDefault() } e.returnValue = false }, captureTarget: function (target) { if (target.setCapture) { jsc._capturedTarget = target; jsc._capturedTarget.setCapture() } }, releaseTarget: function () { if (jsc._capturedTarget) { jsc._capturedTarget.releaseCapture(); jsc._capturedTarget = null } }, triggerEvent: function (el, eventName, bubbles, cancelable) { if (!el) { return } var ev = null; if (typeof Event === "function") { ev = new Event(eventName, { bubbles: bubbles, cancelable: cancelable }) } else { ev = window.document.createEvent("Event"); ev.initEvent(eventName, bubbles, cancelable) } if (!ev) { return false } jsc.setData(ev, "internal", true); el.dispatchEvent(ev); return true }, triggerInputEvent: function (el, eventName, bubbles, cancelable) { if (!el) { return } if (jsc.isTextInput(el)) { jsc.triggerEvent(el, eventName, bubbles, cancelable) } }, eventKey: function (ev) { var keys = { 9: "Tab", 13: "Enter", 27: "Escape" }; if (typeof ev.code === "string") { return ev.code } else if (ev.keyCode !== undefined && keys.hasOwnProperty(ev.keyCode)) { return keys[ev.keyCode] } return null }, strList: function (str) { if (!str) { return [] } return str.replace(/^\s+|\s+$/g, "").split(/\s+/) }, hasClass: function (elm, className) { if (!className) { return false } if (elm.classList !== undefined) { return elm.classList.contains(className) } return -1 != (" " + elm.className.replace(/\s+/g, " ") + " ").indexOf(" " + className + " ") }, addClass: function (elm, className) { var classNames = jsc.strList(className); if (elm.classList !== undefined) { for (var i = 0; i < classNames.length; i += 1){ elm.classList.add(classNames[i]) } return } for (var i = 0; i < classNames.length; i += 1){ if (!jsc.hasClass(elm, classNames[i])) { elm.className += (elm.className ? " " : "") + classNames[i] } } }, removeClass: function (elm, className) { var classNames = jsc.strList(className); if (elm.classList !== undefined) { for (var i = 0; i < classNames.length; i += 1){ elm.classList.remove(classNames[i]) } return } for (var i = 0; i < classNames.length; i += 1){ var repl = new RegExp("^\\s*" + classNames[i] + "\\s*|" + "\\s*" + classNames[i] + "\\s*$|" + "\\s+" + classNames[i] + "(\\s+)", "g"); elm.className = elm.className.replace(repl, "$1") } }, getCompStyle: function (elm) { var compStyle = window.getComputedStyle ? window.getComputedStyle(elm) : elm.currentStyle; if (!compStyle) { return {} } return compStyle }, setStyle: function (elm, styles, important, reversible) { var priority = important ? "important" : ""; var origStyle = null; for (var prop in styles) { if (styles.hasOwnProperty(prop)) { var setVal = null; if (styles[prop] === null) { if (!origStyle) { origStyle = jsc.getData(elm, "origStyle") } if (origStyle && origStyle.hasOwnProperty(prop)) { setVal = origStyle[prop] } } else { if (reversible) { if (!origStyle) { origStyle = jsc.getData(elm, "origStyle", {}) } if (!origStyle.hasOwnProperty(prop)) { origStyle[prop] = elm.style[prop] } } setVal = styles[prop] } if (setVal !== null) { elm.style.setProperty(prop, setVal, priority) } } } }, hexColor: function (r, g, b) { return "#" + (("0" + Math.round(r).toString(16)).substr(-2) + ("0" + Math.round(g).toString(16)).substr(-2) + ("0" + Math.round(b).toString(16)).substr(-2)).toUpperCase() }, hexaColor: function (r, g, b, a) { return "#" + (("0" + Math.round(r).toString(16)).substr(-2) + ("0" + Math.round(g).toString(16)).substr(-2) + ("0" + Math.round(b).toString(16)).substr(-2) + ("0" + Math.round(a * 255).toString(16)).substr(-2)).toUpperCase() }, rgbColor: function (r, g, b) { return "rgb(" + Math.round(r) + "," + Math.round(g) + "," + Math.round(b) + ")" }, rgbaColor: function (r, g, b, a) { return "rgba(" + Math.round(r) + "," + Math.round(g) + "," + Math.round(b) + "," + Math.round((a === undefined || a === null ? 1 : a) * 100) / 100 + ")" }, linearGradient: function () { function getFuncName() { var stdName = "linear-gradient"; var prefixes = ["", "-webkit-", "-moz-", "-o-", "-ms-"]; var helper = window.document.createElement("div"); for (var i = 0; i < prefixes.length; i += 1){ var tryFunc = prefixes[i] + stdName; var tryVal = tryFunc + "(to right, rgba(0,0,0,0), rgba(0,0,0,0))"; helper.style.background = tryVal; if (helper.style.background) { return tryFunc } } return stdName } var funcName = getFuncName(); return function () { return funcName + "(" + Array.prototype.join.call(arguments, ", ") + ")" } }(), setBorderRadius: function (elm, value) { jsc.setStyle(elm, { "border-radius": value || "0" }) }, setBoxShadow: function (elm, value) { jsc.setStyle(elm, { "box-shadow": value || "none" }) }, getElementPos: function (e, relativeToViewport) { var x = 0, y = 0; var rect = e.getBoundingClientRect(); x = rect.left; y = rect.top; if (!relativeToViewport) { var viewPos = jsc.getViewPos(); x += viewPos[0]; y += viewPos[1] } return [x, y] }, getElementSize: function (e) { return [e.offsetWidth, e.offsetHeight] }, getAbsPointerPos: function (e) { var x = 0, y = 0; if (typeof e.changedTouches !== "undefined" && e.changedTouches.length) { x = e.changedTouches[0].clientX; y = e.changedTouches[0].clientY } else if (typeof e.clientX === "number") { x = e.clientX; y = e.clientY } return { x: x, y: y } }, getRelPointerPos: function (e) { var target = e.target || e.srcElement; var targetRect = target.getBoundingClientRect(); var x = 0, y = 0; var clientX = 0, clientY = 0; if (typeof e.changedTouches !== "undefined" && e.changedTouches.length) { clientX = e.changedTouches[0].clientX; clientY = e.changedTouches[0].clientY } else if (typeof e.clientX === "number") { clientX = e.clientX; clientY = e.clientY } x = clientX - targetRect.left; y = clientY - targetRect.top; return { x: x, y: y } }, getViewPos: function () { var doc = window.document.documentElement; return [(window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0), (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)] }, getViewSize: function () { var doc = window.document.documentElement; return [window.innerWidth || doc.clientWidth, window.innerHeight || doc.clientHeight] }, RGB_HSV: function (r, g, b) { r /= 255; g /= 255; b /= 255; var n = Math.min(Math.min(r, g), b); var v = Math.max(Math.max(r, g), b); var m = v - n; if (m === 0) { return [null, 0, 100 * v] } var h = r === n ? 3 + (b - g) / m : g === n ? 5 + (r - b) / m : 1 + (g - r) / m; return [60 * (h === 6 ? 0 : h), 100 * (m / v), 100 * v] }, HSV_RGB: function (h, s, v) { var u = 255 * (v / 100); if (h === null) { return [u, u, u] } h /= 60; s /= 100; var i = Math.floor(h); var f = i % 2 ? h - i : 1 - (h - i); var m = u * (1 - s); var n = u * (1 - s * f); switch (i) { case 6: case 0: return [u, n, m]; case 1: return [n, u, m]; case 2: return [m, u, n]; case 3: return [m, n, u]; case 4: return [n, m, u]; case 5: return [u, m, n] } }, parseColorString: function (str) { var ret = { rgba: null, format: null }; var m; if (m = str.match(/^\W*([0-9A-F]{3,8})\W*$/i)) { if (m[1].length === 8) { ret.format = "hexa"; ret.rgba = [parseInt(m[1].substr(0, 2), 16), parseInt(m[1].substr(2, 2), 16), parseInt(m[1].substr(4, 2), 16), parseInt(m[1].substr(6, 2), 16) / 255] } else if (m[1].length === 6) { ret.format = "hex"; ret.rgba = [parseInt(m[1].substr(0, 2), 16), parseInt(m[1].substr(2, 2), 16), parseInt(m[1].substr(4, 2), 16), null] } else if (m[1].length === 3) { ret.format = "hex"; ret.rgba = [parseInt(m[1].charAt(0) + m[1].charAt(0), 16), parseInt(m[1].charAt(1) + m[1].charAt(1), 16), parseInt(m[1].charAt(2) + m[1].charAt(2), 16), null] } else { return false } return ret } if (m = str.match(/^\W*rgba?\(([^)]*)\)\W*$/i)) { var par = m[1].split(","); var re = /^\s*(\d+|\d*\.\d+|\d+\.\d*)\s*$/; var mR, mG, mB, mA; if (par.length >= 3 && (mR = par[0].match(re)) && (mG = par[1].match(re)) && (mB = par[2].match(re))) { ret.format = "rgb"; ret.rgba = [parseFloat(mR[1]) || 0, parseFloat(mG[1]) || 0, parseFloat(mB[1]) || 0, null]; if (par.length >= 4 && (mA = par[3].match(re))) { ret.format = "rgba"; ret.rgba[3] = parseFloat(mA[1]) || 0 } return ret } } return false }, parsePaletteValue: function (mixed) { var vals = []; if (typeof mixed === "string") { mixed.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/gi, function (val) { vals.push(val) }) } else if (Array.isArray(mixed)) { vals = mixed } var colors = []; for (var i = 0; i < vals.length; i++){ var color = jsc.parseColorString(vals[i]); if (color) { colors.push(color) } } return colors }, containsTranparentColor: function (colors) { for (var i = 0; i < colors.length; i++){ var a = colors[i].rgba[3]; if (a !== null && a < 1) { return true } } return false }, isAlphaFormat: function (format) { switch (format.toLowerCase()) { case "hexa": case "rgba": return true }return false }, scaleCanvasForHighDPR: function (canvas) { var dpr = window.devicePixelRatio || 1; canvas.width *= dpr; canvas.height *= dpr; var ctx = canvas.getContext("2d"); ctx.scale(dpr, dpr) }, genColorPreviewCanvas: function (color, separatorPos, specWidth, scaleForHighDPR) { var sepW = Math.round(jsc.pub.previewSeparator.length); var sqSize = jsc.pub.chessboardSize; var sqColor1 = jsc.pub.chessboardColor1; var sqColor2 = jsc.pub.chessboardColor2; var cWidth = specWidth ? specWidth : sqSize * 2; var cHeight = sqSize * 2; var canvas = jsc.createEl("canvas"); var ctx = canvas.getContext("2d"); canvas.width = cWidth; canvas.height = cHeight; if (scaleForHighDPR) { jsc.scaleCanvasForHighDPR(canvas) } ctx.fillStyle = sqColor1; ctx.fillRect(0, 0, cWidth, cHeight); ctx.fillStyle = sqColor2; for (var x = 0; x < cWidth; x += sqSize * 2){ ctx.fillRect(x, 0, sqSize, sqSize); ctx.fillRect(x + sqSize, sqSize, sqSize, sqSize) } if (color) { ctx.fillStyle = color; ctx.fillRect(0, 0, cWidth, cHeight) } var start = null; switch (separatorPos) { case "left": start = 0; ctx.clearRect(0, 0, sepW / 2, cHeight); break; case "right": start = cWidth - sepW; ctx.clearRect(cWidth - sepW / 2, 0, sepW / 2, cHeight); break }if (start !== null) { ctx.lineWidth = 1; for (var i = 0; i < jsc.pub.previewSeparator.length; i += 1){ ctx.beginPath(); ctx.strokeStyle = jsc.pub.previewSeparator[i]; ctx.moveTo(.5 + start + i, 0); ctx.lineTo(.5 + start + i, cHeight); ctx.stroke() } } return { canvas: canvas, width: cWidth, height: cHeight } }, genColorPreviewGradient: function (color, position, width) { var params = []; if (position && width) { params = ["to " + { left: "right", right: "left" }[position], color + " 0%", color + " " + width + "px", "rgba(0,0,0,0) " + (width + 1) + "px", "rgba(0,0,0,0) 100%"] } else { params = ["to right", color + " 0%", color + " 100%"] } return jsc.linearGradient.apply(this, params) }, redrawPosition: function () { if (!jsc.picker || !jsc.picker.owner) { return } var thisObj = jsc.picker.owner; var tp, vp; if (thisObj.fixed) { tp = jsc.getElementPos(thisObj.targetElement, true); vp = [0, 0] } else { tp = jsc.getElementPos(thisObj.targetElement); vp = jsc.getViewPos() } var ts = jsc.getElementSize(thisObj.targetElement); var vs = jsc.getViewSize(); var pd = jsc.getPickerDims(thisObj); var ps = [pd.borderW, pd.borderH]; var a, b, c; switch (thisObj.position.toLowerCase()) { case "left": a = 1; b = 0; c = -1; break; case "right": a = 1; b = 0; c = 1; break; case "top": a = 0; b = 1; c = -1; break; default: a = 0; b = 1; c = 1; break }var l = (ts[b] + ps[b]) / 2; if (!thisObj.smartPosition) { var pp = [tp[a], tp[b] + ts[b] - l + l * c] } else { var pp = [-vp[a] + tp[a] + ps[a] > vs[a] ? -vp[a] + tp[a] + ts[a] / 2 > vs[a] / 2 && tp[a] + ts[a] - ps[a] >= 0 ? tp[a] + ts[a] - ps[a] : tp[a] : tp[a], -vp[b] + tp[b] + ts[b] + ps[b] - l + l * c > vs[b] ? -vp[b] + tp[b] + ts[b] / 2 > vs[b] / 2 && tp[b] + ts[b] - l - l * c >= 0 ? tp[b] + ts[b] - l - l * c : tp[b] + ts[b] - l + l * c : tp[b] + ts[b] - l + l * c >= 0 ? tp[b] + ts[b] - l + l * c : tp[b] + ts[b] - l - l * c] } var x = pp[a]; var y = pp[b]; var positionValue = thisObj.fixed ? "fixed" : "absolute"; var contractShadow = (pp[0] + ps[0] > tp[0] || pp[0] < tp[0] + ts[0]) && pp[1] + ps[1] < tp[1] + ts[1]; jsc._drawPosition(thisObj, x, y, positionValue, contractShadow) }, _drawPosition: function (thisObj, x, y, positionValue, contractShadow) { var vShadow = contractShadow ? 0 : thisObj.shadowBlur; jsc.picker.wrap.style.position = positionValue; jsc.picker.wrap.style.left = x + "px"; jsc.picker.wrap.style.top = y + "px"; jsc.setBoxShadow(jsc.picker.boxS, thisObj.shadow ? new jsc.BoxShadow(0, vShadow, thisObj.shadowBlur, 0, thisObj.shadowColor) : null) }, getPickerDims: function (thisObj) { var w = 2 * thisObj.controlBorderWidth + thisObj.width; var h = 2 * thisObj.controlBorderWidth + thisObj.height; var sliderSpace = 2 * thisObj.controlBorderWidth + 2 * jsc.getControlPadding(thisObj) + thisObj.sliderSize; if (jsc.getSliderChannel(thisObj)) { w += sliderSpace } if (thisObj.hasAlphaChannel()) { w += sliderSpace } var pal = jsc.getPaletteDims(thisObj, w); if (pal.height) { h += pal.height + thisObj.padding } if (thisObj.closeButton) { h += 2 * thisObj.controlBorderWidth + thisObj.padding + thisObj.buttonHeight } var pW = w + 2 * thisObj.padding; var pH = h + 2 * thisObj.padding; return { contentW: w, contentH: h, paddedW: pW, paddedH: pH, borderW: pW + 2 * thisObj.borderWidth, borderH: pH + 2 * thisObj.borderWidth, palette: pal } }, getPaletteDims: function (thisObj, width) { var cols = 0, rows = 0, cellW = 0, cellH = 0, height = 0; var sampleCount = thisObj._palette ? thisObj._palette.length : 0; if (sampleCount) { cols = thisObj.paletteCols; rows = cols > 0 ? Math.ceil(sampleCount / cols) : 0; cellW = Math.max(1, Math.floor((width - (cols - 1) * thisObj.paletteSpacing) / cols)); cellH = thisObj.paletteHeight ? Math.min(thisObj.paletteHeight, cellW) : cellW } if (rows) { height = rows * cellH + (rows - 1) * thisObj.paletteSpacing } return { cols: cols, rows: rows, cellW: cellW, cellH: cellH, width: width, height: height } }, getControlPadding: function (thisObj) { return Math.max(thisObj.padding / 2, 2 * thisObj.pointerBorderWidth + thisObj.pointerThickness - thisObj.controlBorderWidth) }, getPadYChannel: function (thisObj) { switch (thisObj.mode.charAt(1).toLowerCase()) { case "v": return "v"; break }return "s" }, getSliderChannel: function (thisObj) { if (thisObj.mode.length > 2) { switch (thisObj.mode.charAt(2).toLowerCase()) { case "s": return "s"; break; case "v": return "v"; break } } return null }, triggerCallback: function (thisObj, prop) { if (!thisObj[prop]) { return } var callback = null; if (typeof thisObj[prop] === "string") { try { callback = new Function(thisObj[prop]) } catch (e) { console.error(e) } } else { callback = thisObj[prop] } if (callback) { callback.call(thisObj) } }, triggerGlobal: function (eventNames) { var inst = jsc.getInstances(); for (var i = 0; i < inst.length; i += 1){ inst[i].trigger(eventNames) } }, _pointerMoveEvent: { mouse: "mousemove", touch: "touchmove" }, _pointerEndEvent: { mouse: "mouseup", touch: "touchend" }, _pointerOrigin: null, _capturedTarget: null, onDocumentKeyUp: function (e) { if (["Tab", "Escape"].indexOf(jsc.eventKey(e)) !== -1) { if (jsc.picker && jsc.picker.owner) { jsc.picker.owner.tryHide() } } }, onWindowResize: function (e) { jsc.redrawPosition() }, onWindowScroll: function (e) { jsc.redrawPosition() }, onParentScroll: function (e) { if (jsc.picker && jsc.picker.owner) { jsc.picker.owner.tryHide() } }, onDocumentMouseDown: function (e) { var target = e.target || e.srcElement; if (target.jscolor && target.jscolor instanceof jsc.pub) { if (target.jscolor.showOnClick && !target.disabled) { target.jscolor.show() } } else if (jsc.getData(target, "gui")) { var control = jsc.getData(target, "control"); if (control) { jsc.onControlPointerStart(e, target, jsc.getData(target, "control"), "mouse") } } else { if (jsc.picker && jsc.picker.owner) { jsc.picker.owner.tryHide() } } }, onPickerTouchStart: function (e) { var target = e.target || e.srcElement; if (jsc.getData(target, "control")) { jsc.onControlPointerStart(e, target, jsc.getData(target, "control"), "touch") } }, onControlPointerStart: function (e, target, controlName, pointerType) { var thisObj = jsc.getData(target, "instance"); jsc.preventDefault(e); jsc.captureTarget(target); var registerDragEvents = function (doc, offset) { jsc.attachGroupEvent("drag", doc, jsc._pointerMoveEvent[pointerType], jsc.onDocumentPointerMove(e, target, controlName, pointerType, offset)); jsc.attachGroupEvent("drag", doc, jsc._pointerEndEvent[pointerType], jsc.onDocumentPointerEnd(e, target, controlName, pointerType)) }; registerDragEvents(window.document, [0, 0]); if (window.parent && window.frameElement) { var rect = window.frameElement.getBoundingClientRect(); var ofs = [-rect.left, -rect.top]; registerDragEvents(window.parent.window.document, ofs) } var abs = jsc.getAbsPointerPos(e); var rel = jsc.getRelPointerPos(e); jsc._pointerOrigin = { x: abs.x - rel.x, y: abs.y - rel.y }; switch (controlName) { case "pad": if (jsc.getSliderChannel(thisObj) === "v" && thisObj.channels.v === 0) { thisObj.fromHSVA(null, null, 100, null) } jsc.setPad(thisObj, e, 0, 0); break; case "sld": jsc.setSld(thisObj, e, 0); break; case "asld": jsc.setASld(thisObj, e, 0); break }thisObj.trigger("input") }, onDocumentPointerMove: function (e, target, controlName, pointerType, offset) { return function (e) { var thisObj = jsc.getData(target, "instance"); switch (controlName) { case "pad": jsc.setPad(thisObj, e, offset[0], offset[1]); break; case "sld": jsc.setSld(thisObj, e, offset[1]); break; case "asld": jsc.setASld(thisObj, e, offset[1]); break }thisObj.trigger("input") } }, onDocumentPointerEnd: function (e, target, controlName, pointerType) { return function (e) { var thisObj = jsc.getData(target, "instance"); jsc.detachGroupEvents("drag"); jsc.releaseTarget(); thisObj.trigger("input"); thisObj.trigger("change") } }, onPaletteSampleClick: function (e) { var target = e.currentTarget; var thisObj = jsc.getData(target, "instance"); var color = jsc.getData(target, "color"); if (thisObj.format.toLowerCase() === "any") { thisObj._setFormat(color.format); if (!jsc.isAlphaFormat(thisObj.getFormat())) { color.rgba[3] = 1 } } if (color.rgba[3] === null) { if (thisObj.paletteSetsAlpha === true || thisObj.paletteSetsAlpha === "auto" && thisObj._paletteHasTransparency) { color.rgba[3] = 1 } } thisObj.fromRGBA.apply(thisObj, color.rgba); thisObj.trigger("input"); thisObj.trigger("change"); if (thisObj.hideOnPaletteClick) { thisObj.hide() } }, setPad: function (thisObj, e, ofsX, ofsY) { var pointerAbs = jsc.getAbsPointerPos(e); var x = ofsX + pointerAbs.x - jsc._pointerOrigin.x - thisObj.padding - thisObj.controlBorderWidth; var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth; var xVal = x * (360 / (thisObj.width - 1)); var yVal = 100 - y * (100 / (thisObj.height - 1)); switch (jsc.getPadYChannel(thisObj)) { case "s": thisObj.fromHSVA(xVal, yVal, null, null); break; case "v": thisObj.fromHSVA(xVal, null, yVal, null); break } }, setSld: function (thisObj, e, ofsY) { var pointerAbs = jsc.getAbsPointerPos(e); var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth; var yVal = 100 - y * (100 / (thisObj.height - 1)); switch (jsc.getSliderChannel(thisObj)) { case "s": thisObj.fromHSVA(null, yVal, null, null); break; case "v": thisObj.fromHSVA(null, null, yVal, null); break } }, setASld: function (thisObj, e, ofsY) { var pointerAbs = jsc.getAbsPointerPos(e); var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth; var yVal = 1 - y * (1 / (thisObj.height - 1)); if (yVal < 1) { var fmt = thisObj.getFormat(); if (thisObj.format.toLowerCase() === "any" && !jsc.isAlphaFormat(fmt)) { thisObj._setFormat(fmt === "hex" ? "hexa" : "rgba") } } thisObj.fromHSVA(null, null, null, yVal) }, createPadCanvas: function () { var ret = { elm: null, draw: null }; var canvas = jsc.createEl("canvas"); var ctx = canvas.getContext("2d"); var drawFunc = function (width, height, type) { canvas.width = width; canvas.height = height; ctx.clearRect(0, 0, canvas.width, canvas.height); var hGrad = ctx.createLinearGradient(0, 0, canvas.width, 0); hGrad.addColorStop(0 / 6, "#F00"); hGrad.addColorStop(1 / 6, "#FF0"); hGrad.addColorStop(2 / 6, "#0F0"); hGrad.addColorStop(3 / 6, "#0FF"); hGrad.addColorStop(4 / 6, "#00F"); hGrad.addColorStop(5 / 6, "#F0F"); hGrad.addColorStop(6 / 6, "#F00"); ctx.fillStyle = hGrad; ctx.fillRect(0, 0, canvas.width, canvas.height); var vGrad = ctx.createLinearGradient(0, 0, 0, canvas.height); switch (type.toLowerCase()) { case "s": vGrad.addColorStop(0, "rgba(255,255,255,0)"); vGrad.addColorStop(1, "rgba(255,255,255,1)"); break; case "v": vGrad.addColorStop(0, "rgba(0,0,0,0)"); vGrad.addColorStop(1, "rgba(0,0,0,1)"); break }ctx.fillStyle = vGrad; ctx.fillRect(0, 0, canvas.width, canvas.height) }; ret.elm = canvas; ret.draw = drawFunc; return ret }, createSliderGradient: function () { var ret = { elm: null, draw: null }; var canvas = jsc.createEl("canvas"); var ctx = canvas.getContext("2d"); var drawFunc = function (width, height, color1, color2) { canvas.width = width; canvas.height = height; ctx.clearRect(0, 0, canvas.width, canvas.height); var grad = ctx.createLinearGradient(0, 0, 0, canvas.height); grad.addColorStop(0, color1); grad.addColorStop(1, color2); ctx.fillStyle = grad; ctx.fillRect(0, 0, canvas.width, canvas.height) }; ret.elm = canvas; ret.draw = drawFunc; return ret }, createASliderGradient: function () { var ret = { elm: null, draw: null }; var canvas = jsc.createEl("canvas"); var ctx = canvas.getContext("2d"); var drawFunc = function (width, height, color) { canvas.width = width; canvas.height = height; ctx.clearRect(0, 0, canvas.width, canvas.height); var sqSize = canvas.width / 2; var sqColor1 = jsc.pub.chessboardColor1; var sqColor2 = jsc.pub.chessboardColor2; ctx.fillStyle = sqColor1; ctx.fillRect(0, 0, canvas.width, canvas.height); if (sqSize > 0) { for (var y = 0; y < canvas.height; y += sqSize * 2){ ctx.fillStyle = sqColor2; ctx.fillRect(0, y, sqSize, sqSize); ctx.fillRect(sqSize, y + sqSize, sqSize, sqSize) } } var grad = ctx.createLinearGradient(0, 0, 0, canvas.height); grad.addColorStop(0, color); grad.addColorStop(1, "rgba(0,0,0,0)"); ctx.fillStyle = grad; ctx.fillRect(0, 0, canvas.width, canvas.height) }; ret.elm = canvas; ret.draw = drawFunc; return ret }, BoxShadow: function () { var BoxShadow = function (hShadow, vShadow, blur, spread, color, inset) { this.hShadow = hShadow; this.vShadow = vShadow; this.blur = blur; this.spread = spread; this.color = color; this.inset = !!inset }; BoxShadow.prototype.toString = function () { var vals = [Math.round(this.hShadow) + "px", Math.round(this.vShadow) + "px", Math.round(this.blur) + "px", Math.round(this.spread) + "px", this.color]; if (this.inset) { vals.push("inset") } return vals.join(" ") }; return BoxShadow }(), flags: { leaveValue: 1 << 0, leaveAlpha: 1 << 1, leavePreview: 1 << 2 }, enumOpts: { format: ["auto", "any", "hex", "hexa", "rgb", "rgba"], previewPosition: ["left", "right"], mode: ["hsv", "hvs", "hs", "hv"], position: ["left", "right", "top", "bottom"], alphaChannel: ["auto", true, false], paletteSetsAlpha: ["auto", true, false] }, deprecatedOpts: { styleElement: "previewElement", onFineChange: "onInput", overwriteImportant: "forceStyle", closable: "closeButton", insetWidth: "controlBorderWidth", insetColor: "controlBorderColor", refine: null }, docsRef: " " + "See https://jscolor.com/docs/", pub: function (targetElement, opts) { var THIS = this; if (!opts) { opts = {} } this.channels = { r: 255, g: 255, b: 255, h: 0, s: 0, v: 100, a: 1 }; this.format = "auto"; this.value = undefined; this.alpha = undefined; this.random = false; this.onChange = undefined; this.onInput = undefined; this.valueElement = undefined; this.alphaElement = undefined; this.previewElement = undefined; this.previewPosition = "left"; this.previewSize = 32; this.previewPadding = 8; this.required = true; this.hash = true; this.uppercase = true; this.forceStyle = true; this.width = 181; this.height = 101; this.mode = "HSV"; this.alphaChannel = "auto"; this.position = "bottom"; this.smartPosition = true; this.showOnClick = true; this.hideOnLeave = true; this.palette = []; this.paletteCols = 10; this.paletteSetsAlpha = "auto"; this.paletteHeight = 16; this.paletteSpacing = 4; this.hideOnPaletteClick = false; this.sliderSize = 16; this.crossSize = 8; this.closeButton = false; this.closeText = "Close"; this.buttonColor = "rgba(0,0,0,1)"; this.buttonHeight = 18; this.padding = 12; this.backgroundColor = "rgba(255,255,255,1)"; this.borderWidth = 1; this.borderColor = "rgba(187,187,187,1)"; this.borderRadius = 8; this.controlBorderWidth = 1; this.controlBorderColor = "rgba(187,187,187,1)"; this.shadow = true; this.shadowBlur = 15; this.shadowColor = "rgba(0,0,0,0.2)"; this.pointerColor = "rgba(76,76,76,1)"; this.pointerBorderWidth = 1; this.pointerBorderColor = "rgba(255,255,255,1)"; this.pointerThickness = 2; this.zIndex = 5e3; this.container = undefined; this.minS = 0; this.maxS = 100; this.minV = 0; this.maxV = 100; this.minA = 0; this.maxA = 1; this.option = function () { if (!arguments.length) { throw new Error("No option specified") } if (arguments.length === 1 && typeof arguments[0] === "string") { try { return getOption(arguments[0]) } catch (e) { console.warn(e) } return false } else if (arguments.length >= 2 && typeof arguments[0] === "string") { try { if (!setOption(arguments[0], arguments[1])) { return false } } catch (e) { console.warn(e); return false } this.redraw(); this.exposeColor(); return true } else if (arguments.length === 1 && typeof arguments[0] === "object") { var opts = arguments[0]; var success = true; for (var opt in opts) { if (opts.hasOwnProperty(opt)) { try { if (!setOption(opt, opts[opt])) { success = false } } catch (e) { console.warn(e); success = false } } } this.redraw(); this.exposeColor(); return success } throw new Error("Invalid arguments") }; this.channel = function (name, value) { if (typeof name !== "string") { throw new Error("Invalid value for channel name: " + name) } if (value === undefined) { if (!this.channels.hasOwnProperty(name.toLowerCase())) { console.warn("Getting unknown channel: " + name); return false } return this.channels[name.toLowerCase()] } else { var res = false; switch (name.toLowerCase()) { case "r": res = this.fromRGBA(value, null, null, null); break; case "g": res = this.fromRGBA(null, value, null, null); break; case "b": res = this.fromRGBA(null, null, value, null); break; case "h": res = this.fromHSVA(value, null, null, null); break; case "s": res = this.fromHSVA(null, value, null, null); break; case "v": res = this.fromHSVA(null, null, value, null); break; case "a": res = this.fromHSVA(null, null, null, value); break; default: console.warn("Setting unknown channel: " + name); return false }if (res) { this.redraw(); return true } } return false }; this.trigger = function (eventNames) { var evs = jsc.strList(eventNames); for (var i = 0; i < evs.length; i += 1){ var ev = evs[i].toLowerCase(); var callbackProp = null; switch (ev) { case "input": callbackProp = "onInput"; break; case "change": callbackProp = "onChange"; break }if (callbackProp) { jsc.triggerCallback(this, callbackProp) } jsc.triggerInputEvent(this.valueElement, ev, true, true) } }; this.fromHSVA = function (h, s, v, a, flags) { if (h === undefined) { h = null } if (s === undefined) { s = null } if (v === undefined) { v = null } if (a === undefined) { a = null } if (h !== null) { if (isNaN(h)) { return false } this.channels.h = Math.max(0, Math.min(360, h)) } if (s !== null) { if (isNaN(s)) { return false } this.channels.s = Math.max(0, Math.min(100, this.maxS, s), this.minS) } if (v !== null) { if (isNaN(v)) { return false } this.channels.v = Math.max(0, Math.min(100, this.maxV, v), this.minV) } if (a !== null) { if (isNaN(a)) { return false } this.channels.a = this.hasAlphaChannel() ? Math.max(0, Math.min(1, this.maxA, a), this.minA) : 1 } var rgb = jsc.HSV_RGB(this.channels.h, this.channels.s, this.channels.v); this.channels.r = rgb[0]; this.channels.g = rgb[1]; this.channels.b = rgb[2]; this.exposeColor(flags); return true }; this.fromRGBA = function (r, g, b, a, flags) { if (r === undefined) { r = null } if (g === undefined) { g = null } if (b === undefined) { b = null } if (a === undefined) { a = null } if (r !== null) { if (isNaN(r)) { return false } r = Math.max(0, Math.min(255, r)) } if (g !== null) { if (isNaN(g)) { return false } g = Math.max(0, Math.min(255, g)) } if (b !== null) { if (isNaN(b)) { return false } b = Math.max(0, Math.min(255, b)) } if (a !== null) { if (isNaN(a)) { return false } this.channels.a = this.hasAlphaChannel() ? Math.max(0, Math.min(1, this.maxA, a), this.minA) : 1 } var hsv = jsc.RGB_HSV(r === null ? this.channels.r : r, g === null ? this.channels.g : g, b === null ? this.channels.b : b); if (hsv[0] !== null) { this.channels.h = Math.max(0, Math.min(360, hsv[0])) } if (hsv[2] !== 0) { this.channels.s = Math.max(0, this.minS, Math.min(100, this.maxS, hsv[1])) } this.channels.v = Math.max(0, this.minV, Math.min(100, this.maxV, hsv[2])); var rgb = jsc.HSV_RGB(this.channels.h, this.channels.s, this.channels.v); this.channels.r = rgb[0]; this.channels.g = rgb[1]; this.channels.b = rgb[2]; this.exposeColor(flags); return true }; this.fromHSV = function (h, s, v, flags) { console.warn("fromHSV() method is DEPRECATED. Using fromHSVA() instead." + jsc.docsRef); return this.fromHSVA(h, s, v, null, flags) }; this.fromRGB = function (r, g, b, flags) { console.warn("fromRGB() method is DEPRECATED. Using fromRGBA() instead." + jsc.docsRef); return this.fromRGBA(r, g, b, null, flags) }; this.fromString = function (str, flags) { if (!this.required && str.trim() === "") { this.setPreviewElementBg(null); this.setValueElementValue(""); return true } var color = jsc.parseColorString(str); if (!color) { return false } if (this.format.toLowerCase() === "any") { this._setFormat(color.format); if (!jsc.isAlphaFormat(this.getFormat())) { color.rgba[3] = 1 } } this.fromRGBA(color.rgba[0], color.rgba[1], color.rgba[2], color.rgba[3], flags); return true }; this.randomize = function (minV, maxV, minS, maxS, minH, maxH, minA, maxA) { if (minV === undefined) { minV = 0 } if (maxV === undefined) { maxV = 100 } if (minS === undefined) { minS = 0 } if (maxS === undefined) { maxS = 100 } if (minH === undefined) { minH = 0 } if (maxH === undefined) { maxH = 359 } if (minA === undefined) { minA = 1 } if (maxA === undefined) { maxA = 1 } this.fromHSVA(minH + Math.floor(Math.random() * (maxH - minH + 1)), minS + Math.floor(Math.random() * (maxS - minS + 1)), minV + Math.floor(Math.random() * (maxV - minV + 1)), (100 * minA + Math.floor(Math.random() * (100 * (maxA - minA) + 1))) / 100) }; this.toString = function (format) { if (format === undefined) { format = this.getFormat() } switch (format.toLowerCase()) { case "hex": return this.toHEXString(); break; case "hexa": return this.toHEXAString(); break; case "rgb": return this.toRGBString(); break; case "rgba": return this.toRGBAString(); break }return false }; this.toHEXString = function () { return jsc.hexColor(this.channels.r, this.channels.g, this.channels.b) }; this.toHEXAString = function () { return jsc.hexaColor(this.channels.r, this.channels.g, this.channels.b, this.channels.a) }; this.toRGBString = function () { return jsc.rgbColor(this.channels.r, this.channels.g, this.channels.b) }; this.toRGBAString = function () { return jsc.rgbaColor(this.channels.r, this.channels.g, this.channels.b, this.channels.a) }; this.toGrayscale = function () { return .213 * this.channels.r + .715 * this.channels.g + .072 * this.channels.b }; this.toCanvas = function () { return jsc.genColorPreviewCanvas(this.toRGBAString()).canvas }; this.toDataURL = function () { return this.toCanvas().toDataURL() }; this.toBackground = function () { return jsc.pub.background(this.toRGBAString()) }; this.isLight = function () { return this.toGrayscale() > 255 / 2 }; this.hide = function () { if (isPickerOwner()) { detachPicker() } }; this.show = function () { drawPicker() }; this.redraw = function () { if (isPickerOwner()) { drawPicker() } }; this.getFormat = function () { return this._currentFormat }; this._setFormat = function (format) { this._currentFormat = format.toLowerCase() }; this.hasAlphaChannel = function () { if (this.alphaChannel === "auto") { return this.format.toLowerCase() === "any" || jsc.isAlphaFormat(this.getFormat()) || this.alpha !== undefined || this.alphaElement !== undefined } return this.alphaChannel }; this.processValueInput = function (str) { if (!this.fromString(str)) { this.exposeColor() } }; this.processAlphaInput = function (str) { if (!this.fromHSVA(null, null, null, parseFloat(str))) { this.exposeColor() } }; this.exposeColor = function (flags) { var colorStr = this.toString(); var fmt = this.getFormat(); jsc.setDataAttr(this.targetElement, "current-color", colorStr); if (!(flags & jsc.flags.leaveValue) && this.valueElement) { if (fmt === "hex" || fmt === "hexa") { if (!this.uppercase) { colorStr = colorStr.toLowerCase() } if (!this.hash) { colorStr = colorStr.replace(/^#/, "") } } this.setValueElementValue(colorStr) } if (!(flags & jsc.flags.leaveAlpha) && this.alphaElement) { var alphaVal = Math.round(this.channels.a * 100) / 100; this.setAlphaElementValue(alphaVal) } if (!(flags & jsc.flags.leavePreview) && this.previewElement) { var previewPos = null; if (jsc.isTextInput(this.previewElement) || jsc.isButton(this.previewElement) && !jsc.isButtonEmpty(this.previewElement)) { previewPos = this.previewPosition } this.setPreviewElementBg(this.toRGBAString()) } if (isPickerOwner()) { redrawPad(); redrawSld(); redrawASld() } }; this.setPreviewElementBg = function (color) { if (!this.previewElement) { return } var position = null; var width = null; if (jsc.isTextInput(this.previewElement) || jsc.isButton(this.previewElement) && !jsc.isButtonEmpty(this.previewElement)) { position = this.previewPosition; width = this.previewSize } var backgrounds = []; if (!color) { backgrounds.push({ image: "none", position: "left top", size: "auto", repeat: "no-repeat", origin: "padding-box" }) } else { backgrounds.push({ image: jsc.genColorPreviewGradient(color, position, width ? width - jsc.pub.previewSeparator.length : null), position: "left top", size: "auto", repeat: position ? "repeat-y" : "repeat", origin: "padding-box" }); var preview = jsc.genColorPreviewCanvas("rgba(0,0,0,0)", position ? { left: "right", right: "left" }[position] : null, width, true); backgrounds.push({ image: "url('" + preview.canvas.toDataURL() + "')", position: (position || "left") + " top", size: preview.width + "px " + preview.height + "px", repeat: position ? "repeat-y" : "repeat", origin: "padding-box" }) } var bg = { image: [], position: [], size: [], repeat: [], origin: [] }; for (var i = 0; i < backgrounds.length; i += 1){ bg.image.push(backgrounds[i].image); bg.position.push(backgrounds[i].position); bg.size.push(backgrounds[i].size); bg.repeat.push(backgrounds[i].repeat); bg.origin.push(backgrounds[i].origin) } var sty = { "background-image": bg.image.join(", "), "background-position": bg.position.join(", "), "background-size": bg.size.join(", "), "background-repeat": bg.repeat.join(", "), "background-origin": bg.origin.join(", ") }; jsc.setStyle(this.previewElement, sty, this.forceStyle); var padding = { left: null, right: null }; if (position) { padding[position] = this.previewSize + this.previewPadding + "px" } var sty = { "padding-left": padding.left, "padding-right": padding.right }; jsc.setStyle(this.previewElement, sty, this.forceStyle, true) }; this.setValueElementValue = function (str) { if (this.valueElement) { if (jsc.nodeName(this.valueElement) === "input") { this.valueElement.value = str } else { this.valueElement.innerHTML = str } } }; this.setAlphaElementValue = function (str) { if (this.alphaElement) { if (jsc.nodeName(this.alphaElement) === "input") { this.alphaElement.value = str } else { this.alphaElement.innerHTML = str } } }; this._processParentElementsInDOM = function () { if (this._parentElementsProcessed) { return } this._parentElementsProcessed = true; var elm = this.targetElement; do { var compStyle = jsc.getCompStyle(elm); if (compStyle.position && compStyle.position.toLowerCase() === "fixed") { this.fixed = true } if (elm !== this.targetElement) { if (!jsc.getData(elm, "hasScrollListener")) { elm.addEventListener("scroll", jsc.onParentScroll, false); jsc.setData(elm, "hasScrollListener", true) } } } while ((elm = elm.parentNode) && jsc.nodeName(elm) !== "body") }; this.tryHide = function () { if (this.hideOnLeave) { this.hide() } }; this.set__palette = function (val) { this.palette = val; this._palette = jsc.parsePaletteValue(val); this._paletteHasTransparency = jsc.containsTranparentColor(this._palette) }; function setOption(option, value) { if (typeof option !== "string") { throw new Error("Invalid value for option name: " + option) } if (jsc.enumOpts.hasOwnProperty(option)) { if (typeof value === "string") { value = value.toLowerCase() } if (jsc.enumOpts[option].indexOf(value) === -1) { throw new Error("Option '" + option + "' has invalid value: " + value) } } if (jsc.deprecatedOpts.hasOwnProperty(option)) { var oldOpt = option; var newOpt = jsc.deprecatedOpts[option]; if (newOpt) { console.warn("Option '%s' is DEPRECATED, using '%s' instead." + jsc.docsRef, oldOpt, newOpt); option = newOpt } else { throw new Error("Option '" + option + "' is DEPRECATED") } } var setter = "set__" + option; if (typeof THIS[setter] === "function") { THIS[setter](value); return true } else if (option in THIS) { THIS[option] = value; return true } throw new Error("Unrecognized configuration option: " + option) } function getOption(option) { if (typeof option !== "string") { throw new Error("Invalid value for option name: " + option) } if (jsc.deprecatedOpts.hasOwnProperty(option)) { var oldOpt = option; var newOpt = jsc.deprecatedOpts[option]; if (newOpt) { console.warn("Option '%s' is DEPRECATED, using '%s' instead." + jsc.docsRef, oldOpt, newOpt); option = newOpt } else { throw new Error("Option '" + option + "' is DEPRECATED") } } var getter = "get__" + option; if (typeof THIS[getter] === "function") { return THIS[getter](value) } else if (option in THIS) { return THIS[option] } throw new Error("Unrecognized configuration option: " + option) } function detachPicker() { jsc.removeClass(THIS.targetElement, jsc.pub.activeClassName); jsc.picker.wrap.parentNode.removeChild(jsc.picker.wrap); delete jsc.picker.owner } function drawPicker() { THIS._processParentElementsInDOM(); if (!jsc.picker) { jsc.picker = { owner: null, wrap: jsc.createEl("div"), box: jsc.createEl("div"), boxS: jsc.createEl("div"), boxB: jsc.createEl("div"), pad: jsc.createEl("div"), padB: jsc.createEl("div"), padM: jsc.createEl("div"), padCanvas: jsc.createPadCanvas(), cross: jsc.createEl("div"), crossBY: jsc.createEl("div"), crossBX: jsc.createEl("div"), crossLY: jsc.createEl("div"), crossLX: jsc.createEl("div"), sld: jsc.createEl("div"), sldB: jsc.createEl("div"), sldM: jsc.createEl("div"), sldGrad: jsc.createSliderGradient(), sldPtrS: jsc.createEl("div"), sldPtrIB: jsc.createEl("div"), sldPtrMB: jsc.createEl("div"), sldPtrOB: jsc.createEl("div"), asld: jsc.createEl("div"), asldB: jsc.createEl("div"), asldM: jsc.createEl("div"), asldGrad: jsc.createASliderGradient(), asldPtrS: jsc.createEl("div"), asldPtrIB: jsc.createEl("div"), asldPtrMB: jsc.createEl("div"), asldPtrOB: jsc.createEl("div"), pal: jsc.createEl("div"), btn: jsc.createEl("div"), btnT: jsc.createEl("span") }; jsc.picker.pad.appendChild(jsc.picker.padCanvas.elm); jsc.picker.padB.appendChild(jsc.picker.pad); jsc.picker.cross.appendChild(jsc.picker.crossBY); jsc.picker.cross.appendChild(jsc.picker.crossBX); jsc.picker.cross.appendChild(jsc.picker.crossLY); jsc.picker.cross.appendChild(jsc.picker.crossLX); jsc.picker.padB.appendChild(jsc.picker.cross); jsc.picker.box.appendChild(jsc.picker.padB); jsc.picker.box.appendChild(jsc.picker.padM); jsc.picker.sld.appendChild(jsc.picker.sldGrad.elm); jsc.picker.sldB.appendChild(jsc.picker.sld); jsc.picker.sldB.appendChild(jsc.picker.sldPtrOB); jsc.picker.sldPtrOB.appendChild(jsc.picker.sldPtrMB); jsc.picker.sldPtrMB.appendChild(jsc.picker.sldPtrIB); jsc.picker.sldPtrIB.appendChild(jsc.picker.sldPtrS); jsc.picker.box.appendChild(jsc.picker.sldB); jsc.picker.box.appendChild(jsc.picker.sldM); jsc.picker.asld.appendChild(jsc.picker.asldGrad.elm); jsc.picker.asldB.appendChild(jsc.picker.asld); jsc.picker.asldB.appendChild(jsc.picker.asldPtrOB); jsc.picker.asldPtrOB.appendChild(jsc.picker.asldPtrMB); jsc.picker.asldPtrMB.appendChild(jsc.picker.asldPtrIB); jsc.picker.asldPtrIB.appendChild(jsc.picker.asldPtrS); jsc.picker.box.appendChild(jsc.picker.asldB); jsc.picker.box.appendChild(jsc.picker.asldM); jsc.picker.box.appendChild(jsc.picker.pal); jsc.picker.btn.appendChild(jsc.picker.btnT); jsc.picker.box.appendChild(jsc.picker.btn); jsc.picker.boxB.appendChild(jsc.picker.box); jsc.picker.wrap.appendChild(jsc.picker.boxS); jsc.picker.wrap.appendChild(jsc.picker.boxB); jsc.picker.wrap.addEventListener("touchstart", jsc.onPickerTouchStart, jsc.isPassiveEventSupported ? { passive: false } : false) } var p = jsc.picker; var displaySlider = !!jsc.getSliderChannel(THIS); var displayAlphaSlider = THIS.hasAlphaChannel(); var pickerDims = jsc.getPickerDims(THIS); var crossOuterSize = 2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize; var controlPadding = jsc.getControlPadding(THIS); var borderRadius = Math.min(THIS.borderRadius, Math.round(THIS.padding * Math.PI)); var padCursor = "crosshair"; p.wrap.className = "jscolor-picker-wrap"; p.wrap.style.clear = "both"; p.wrap.style.width = pickerDims.borderW + "px"; p.wrap.style.height = pickerDims.borderH + "px"; p.wrap.style.zIndex = THIS.zIndex; p.box.className = "jscolor-picker"; p.box.style.width = pickerDims.paddedW + "px"; p.box.style.height = pickerDims.paddedH + "px"; p.box.style.position = "relative"; p.boxS.className = "jscolor-picker-shadow"; p.boxS.style.position = "absolute"; p.boxS.style.left = "0"; p.boxS.style.top = "0"; p.boxS.style.width = "100%"; p.boxS.style.height = "100%"; jsc.setBorderRadius(p.boxS, borderRadius + "px"); p.boxB.className = "jscolor-picker-border"; p.boxB.style.position = "relative"; p.boxB.style.border = THIS.borderWidth + "px solid"; p.boxB.style.borderColor = THIS.borderColor; p.boxB.style.background = THIS.backgroundColor; jsc.setBorderRadius(p.boxB, borderRadius + "px"); p.padM.style.background = "rgba(255,0,0,.2)"; p.sldM.style.background = "rgba(0,255,0,.2)"; p.asldM.style.background = "rgba(0,0,255,.2)"; p.padM.style.opacity = p.sldM.style.opacity = p.asldM.style.opacity = "0"; p.pad.style.position = "relative"; p.pad.style.width = THIS.width + "px"; p.pad.style.height = THIS.height + "px"; p.padCanvas.draw(THIS.width, THIS.height, jsc.getPadYChannel(THIS)); p.padB.style.position = "absolute"; p.padB.style.left = THIS.padding + "px"; p.padB.style.top = THIS.padding + "px"; p.padB.style.border = THIS.controlBorderWidth + "px solid"; p.padB.style.borderColor = THIS.controlBorderColor; p.padM.style.position = "absolute"; p.padM.style.left = 0 + "px"; p.padM.style.top = 0 + "px"; p.padM.style.width = THIS.padding + 2 * THIS.controlBorderWidth + THIS.width + controlPadding + "px"; p.padM.style.height = 2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height + "px"; p.padM.style.cursor = padCursor; jsc.setData(p.padM, { instance: THIS, control: "pad" }); p.cross.style.position = "absolute"; p.cross.style.left = p.cross.style.top = "0"; p.cross.style.width = p.cross.style.height = crossOuterSize + "px"; p.crossBY.style.position = p.crossBX.style.position = "absolute"; p.crossBY.style.background = p.crossBX.style.background = THIS.pointerBorderColor; p.crossBY.style.width = p.crossBX.style.height = 2 * THIS.pointerBorderWidth + THIS.pointerThickness + "px"; p.crossBY.style.height = p.crossBX.style.width = crossOuterSize + "px"; p.crossBY.style.left = p.crossBX.style.top = Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2) - THIS.pointerBorderWidth + "px"; p.crossBY.style.top = p.crossBX.style.left = "0"; p.crossLY.style.position = p.crossLX.style.position = "absolute"; p.crossLY.style.background = p.crossLX.style.background = THIS.pointerColor; p.crossLY.style.height = p.crossLX.style.width = crossOuterSize - 2 * THIS.pointerBorderWidth + "px"; p.crossLY.style.width = p.crossLX.style.height = THIS.pointerThickness + "px"; p.crossLY.style.left = p.crossLX.style.top = Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2) + "px"; p.crossLY.style.top = p.crossLX.style.left = THIS.pointerBorderWidth + "px"; p.sld.style.overflow = "hidden"; p.sld.style.width = THIS.sliderSize + "px"; p.sld.style.height = THIS.height + "px"; p.sldGrad.draw(THIS.sliderSize, THIS.height, "#000", "#000"); p.sldB.style.display = displaySlider ? "block" : "none"; p.sldB.style.position = "absolute"; p.sldB.style.left = THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + 2 * controlPadding + "px"; p.sldB.style.top = THIS.padding + "px"; p.sldB.style.border = THIS.controlBorderWidth + "px solid"; p.sldB.style.borderColor = THIS.controlBorderColor; p.sldM.style.display = displaySlider ? "block" : "none"; p.sldM.style.position = "absolute"; p.sldM.style.left = THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding + "px"; p.sldM.style.top = 0 + "px"; p.sldM.style.width = THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth + (displayAlphaSlider ? 0 : Math.max(0, THIS.padding - controlPadding)) + "px"; p.sldM.style.height = 2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height + "px"; p.sldM.style.cursor = "default"; jsc.setData(p.sldM, { instance: THIS, control: "sld" }); p.sldPtrIB.style.border = p.sldPtrOB.style.border = THIS.pointerBorderWidth + "px solid " + THIS.pointerBorderColor; p.sldPtrOB.style.position = "absolute"; p.sldPtrOB.style.left = -(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + "px"; p.sldPtrOB.style.top = "0"; p.sldPtrMB.style.border = THIS.pointerThickness + "px solid " + THIS.pointerColor; p.sldPtrS.style.width = THIS.sliderSize + "px"; p.sldPtrS.style.height = jsc.pub.sliderInnerSpace + "px"; p.asld.style.overflow = "hidden"; p.asld.style.width = THIS.sliderSize + "px"; p.asld.style.height = THIS.height + "px"; p.asldGrad.draw(THIS.sliderSize, THIS.height, "#000"); p.asldB.style.display = displayAlphaSlider ? "block" : "none"; p.asldB.style.position = "absolute"; p.asldB.style.left = THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding + (displaySlider ? THIS.sliderSize + 3 * controlPadding + 2 * THIS.controlBorderWidth : 0) + "px"; p.asldB.style.top = THIS.padding + "px"; p.asldB.style.border = THIS.controlBorderWidth + "px solid"; p.asldB.style.borderColor = THIS.controlBorderColor; p.asldM.style.display = displayAlphaSlider ? "block" : "none"; p.asldM.style.position = "absolute"; p.asldM.style.left = THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding + (displaySlider ? THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth : 0) + "px"; p.asldM.style.top = 0 + "px"; p.asldM.style.width = THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth + Math.max(0, THIS.padding - controlPadding) + "px"; p.asldM.style.height = 2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height + "px"; p.asldM.style.cursor = "default"; jsc.setData(p.asldM, { instance: THIS, control: "asld" }); p.asldPtrIB.style.border = p.asldPtrOB.style.border = THIS.pointerBorderWidth + "px solid " + THIS.pointerBorderColor; p.asldPtrOB.style.position = "absolute"; p.asldPtrOB.style.left = -(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + "px"; p.asldPtrOB.style.top = "0"; p.asldPtrMB.style.border = THIS.pointerThickness + "px solid " + THIS.pointerColor; p.asldPtrS.style.width = THIS.sliderSize + "px"; p.asldPtrS.style.height = jsc.pub.sliderInnerSpace + "px"; p.pal.className = "jscolor-palette"; p.pal.style.display = pickerDims.palette.rows ? "block" : "none"; p.pal.style.position = "absolute"; p.pal.style.left = THIS.padding + "px"; p.pal.style.top = 2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height + "px"; p.pal.innerHTML = ""; var chessboard = jsc.genColorPreviewCanvas("rgba(0,0,0,0)"); var si = 0; for (var r = 0; r < pickerDims.palette.rows; r++){ for (var c = 0; c < pickerDims.palette.cols && si < THIS._palette.length; c++, si++){ var sampleColor = THIS._palette[si]; var sampleCssColor = jsc.rgbaColor.apply(null, sampleColor.rgba); var sc = jsc.createEl("div"); sc.style.width = pickerDims.palette.cellW - 2 * THIS.controlBorderWidth + "px"; sc.style.height = pickerDims.palette.cellH - 2 * THIS.controlBorderWidth + "px"; sc.style.backgroundColor = sampleCssColor; var sw = jsc.createEl("div"); sw.className = "jscolor-palette-sample"; sw.style.display = "block"; sw.style.position = "absolute"; sw.style.left = (pickerDims.palette.cols <= 1 ? 0 : Math.round(10 * (c * ((pickerDims.contentW - pickerDims.palette.cellW) / (pickerDims.palette.cols - 1)))) / 10) + "px"; sw.style.top = r * (pickerDims.palette.cellH + THIS.paletteSpacing) + "px"; sw.style.border = THIS.controlBorderWidth + "px solid"; sw.style.borderColor = THIS.controlBorderColor; sw.style.cursor = "pointer"; if (sampleColor.rgba[3] !== null && sampleColor.rgba[3] < 1) { sw.style.backgroundImage = "url('" + chessboard.canvas.toDataURL() + "')"; sw.style.backgroundRepeat = "repeat"; sw.style.backgroundPosition = "center center" } jsc.setData(sw, { instance: THIS, control: "palette-sample", color: sampleColor }); sw.addEventListener("click", jsc.onPaletteSampleClick, false); sw.appendChild(sc); p.pal.appendChild(sw) } } function setBtnBorder() { var insetColors = THIS.controlBorderColor.split(/\s+/); var outsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + " " + insetColors[0] + " " + insetColors[0] + " " + insetColors[1]; p.btn.style.borderColor = outsetColor } var btnPadding = 15; p.btn.className = "jscolor-btn-close"; p.btn.style.display = THIS.closeButton ? "block" : "none"; p.btn.style.position = "absolute"; p.btn.style.left = THIS.padding + "px"; p.btn.style.bottom = THIS.padding + "px"; p.btn.style.padding = "0 " + btnPadding + "px"; p.btn.style.maxWidth = pickerDims.contentW - 2 * THIS.controlBorderWidth - 2 * btnPadding + "px"; p.btn.style.overflow = "hidden"; p.btn.style.height = THIS.buttonHeight + "px"; p.btn.style.whiteSpace = "nowrap"; p.btn.style.border = THIS.controlBorderWidth + "px solid"; setBtnBorder(); p.btn.style.color = THIS.buttonColor; p.btn.style.font = "12px sans-serif"; p.btn.style.textAlign = "center"; p.btn.style.cursor = "pointer"; p.btn.onmousedown = function () { THIS.hide() }; p.btnT.style.lineHeight = THIS.buttonHeight + "px"; p.btnT.innerHTML = ""; p.btnT.appendChild(window.document.createTextNode(THIS.closeText)); redrawPad(); redrawSld(); redrawASld(); if (jsc.picker.owner && jsc.picker.owner !== THIS) { jsc.removeClass(jsc.picker.owner.targetElement, jsc.pub.activeClassName) } jsc.picker.owner = THIS; if (THIS.container === window.document.body) { jsc.redrawPosition() } else { jsc._drawPosition(THIS, 0, 0, "relative", false) } if (p.wrap.parentNode !== THIS.container) { THIS.container.appendChild(p.wrap) } jsc.addClass(THIS.targetElement, jsc.pub.activeClassName) } function redrawPad() { var yChannel = jsc.getPadYChannel(THIS); var x = Math.round(THIS.channels.h / 360 * (THIS.width - 1)); var y = Math.round((1 - THIS.channels[yChannel] / 100) * (THIS.height - 1)); var crossOuterSize = 2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize; var ofs = -Math.floor(crossOuterSize / 2); jsc.picker.cross.style.left = x + ofs + "px"; jsc.picker.cross.style.top = y + ofs + "px"; switch (jsc.getSliderChannel(THIS)) { case "s": var rgb1 = jsc.HSV_RGB(THIS.channels.h, 100, THIS.channels.v); var rgb2 = jsc.HSV_RGB(THIS.channels.h, 0, THIS.channels.v); var color1 = "rgb(" + Math.round(rgb1[0]) + "," + Math.round(rgb1[1]) + "," + Math.round(rgb1[2]) + ")"; var color2 = "rgb(" + Math.round(rgb2[0]) + "," + Math.round(rgb2[1]) + "," + Math.round(rgb2[2]) + ")"; jsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2); break; case "v": var rgb = jsc.HSV_RGB(THIS.channels.h, THIS.channels.s, 100); var color1 = "rgb(" + Math.round(rgb[0]) + "," + Math.round(rgb[1]) + "," + Math.round(rgb[2]) + ")"; var color2 = "#000"; jsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2); break }jsc.picker.asldGrad.draw(THIS.sliderSize, THIS.height, THIS.toHEXString()) } function redrawSld() { var sldChannel = jsc.getSliderChannel(THIS); if (sldChannel) { var y = Math.round((1 - THIS.channels[sldChannel] / 100) * (THIS.height - 1)); jsc.picker.sldPtrOB.style.top = y - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) - Math.floor(jsc.pub.sliderInnerSpace / 2) + "px" } jsc.picker.asldGrad.draw(THIS.sliderSize, THIS.height, THIS.toHEXString()) } function redrawASld() { var y = Math.round((1 - THIS.channels.a) * (THIS.height - 1)); jsc.picker.asldPtrOB.style.top = y - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) - Math.floor(jsc.pub.sliderInnerSpace / 2) + "px" } function isPickerOwner() { return jsc.picker && jsc.picker.owner === THIS } function onValueKeyDown(ev) { if (jsc.eventKey(ev) === "Enter") { if (THIS.valueElement) { THIS.processValueInput(THIS.valueElement.value) } THIS.tryHide() } } function onAlphaKeyDown(ev) { if (jsc.eventKey(ev) === "Enter") { if (THIS.alphaElement) { THIS.processAlphaInput(THIS.alphaElement.value) } THIS.tryHide() } } function onValueChange(ev) { if (jsc.getData(ev, "internal")) { return } var oldVal = THIS.valueElement.value; THIS.processValueInput(THIS.valueElement.value); jsc.triggerCallback(THIS, "onChange"); if (THIS.valueElement.value !== oldVal) { jsc.triggerInputEvent(THIS.valueElement, "change", true, true) } } function onAlphaChange(ev) { if (jsc.getData(ev, "internal")) { return } var oldVal = THIS.alphaElement.value; THIS.processAlphaInput(THIS.alphaElement.value); jsc.triggerCallback(THIS, "onChange"); jsc.triggerInputEvent(THIS.valueElement, "change", true, true); if (THIS.alphaElement.value !== oldVal) { jsc.triggerInputEvent(THIS.alphaElement, "change", true, true) } } function onValueInput(ev) { if (jsc.getData(ev, "internal")) { return } if (THIS.valueElement) { THIS.fromString(THIS.valueElement.value, jsc.flags.leaveValue) } jsc.triggerCallback(THIS, "onInput") } function onAlphaInput(ev) { if (jsc.getData(ev, "internal")) { return } if (THIS.alphaElement) { THIS.fromHSVA(null, null, null, parseFloat(THIS.alphaElement.value), jsc.flags.leaveAlpha) } jsc.triggerCallback(THIS, "onInput"); jsc.triggerInputEvent(THIS.valueElement, "input", true, true) } if (jsc.pub.options) { for (var opt in jsc.pub.options) { if (jsc.pub.options.hasOwnProperty(opt)) { try { setOption(opt, jsc.pub.options[opt]) } catch (e) { console.warn(e) } } } } var presetsArr = []; if (opts.preset) { if (typeof opts.preset === "string") { presetsArr = opts.preset.split(/\s+/) } else if (Array.isArray(opts.preset)) { presetsArr = opts.preset.slice() } else { console.warn("Unrecognized preset value") } } if (presetsArr.indexOf("default") === -1) { presetsArr.push("default") } for (var i = presetsArr.length - 1; i >= 0; i -= 1){ var pres = presetsArr[i]; if (!pres) { continue } if (!jsc.pub.presets.hasOwnProperty(pres)) { console.warn("Unknown preset: %s", pres); continue } for (var opt in jsc.pub.presets[pres]) { if (jsc.pub.presets[pres].hasOwnProperty(opt)) { try { setOption(opt, jsc.pub.presets[pres][opt]) } catch (e) { console.warn(e) } } } } var nonProperties = ["preset"]; for (var opt in opts) { if (opts.hasOwnProperty(opt)) { if (nonProperties.indexOf(opt) === -1) { try { setOption(opt, opts[opt]) } catch (e) { console.warn(e) } } } } if (this.container === undefined) { this.container = window.document.body } else { this.container = jsc.node(this.container) } if (!this.container) { throw new Error("Cannot instantiate color picker without a container element") } this.targetElement = jsc.node(targetElement); if (!this.targetElement) { if (typeof targetElement === "string" && /^[a-zA-Z][\w:.-]*$/.test(targetElement)) { var possiblyId = targetElement; throw new Error("If '" + possiblyId + "' is supposed to be an ID, please use '#" + possiblyId + "' or any valid CSS selector.") } throw new Error("Cannot instantiate color picker without a target element") } if (this.targetElement.jscolor && this.targetElement.jscolor instanceof jsc.pub) { throw new Error("Color picker already installed on this element") } this.targetElement.jscolor = this; jsc.addClass(this.targetElement, jsc.pub.className); jsc.instances.push(this); if (jsc.isButton(this.targetElement)) { if (this.targetElement.type.toLowerCase() !== "button") { this.targetElement.type = "button" } if (jsc.isButtonEmpty(this.targetElement)) { jsc.removeChildren(this.targetElement); this.targetElement.appendChild(window.document.createTextNode(" ")); var compStyle = jsc.getCompStyle(this.targetElement); var currMinWidth = parseFloat(compStyle["min-width"]) || 0; if (currMinWidth < this.previewSize) { jsc.setStyle(this.targetElement, { "min-width": this.previewSize + "px" }, this.forceStyle) } } } if (this.valueElement === undefined) { if (jsc.isTextInput(this.targetElement)) { this.valueElement = this.targetElement } else { } } else if (this.valueElement === null) { } else { this.valueElement = jsc.node(this.valueElement) } if (this.alphaElement) { this.alphaElement = jsc.node(this.alphaElement) } if (this.previewElement === undefined) { this.previewElement = this.targetElement } else if (this.previewElement === null) { } else { this.previewElement = jsc.node(this.previewElement) } if (this.valueElement && jsc.isTextInput(this.valueElement)) { var valueElementOrigEvents = { onInput: this.valueElement.oninput }; this.valueElement.oninput = null; this.valueElement.addEventListener("keydown", onValueKeyDown, false); this.valueElement.addEventListener("change", onValueChange, false); this.valueElement.addEventListener("input", onValueInput, false); if (valueElementOrigEvents.onInput) { this.valueElement.addEventListener("input", valueElementOrigEvents.onInput, false) } this.valueElement.setAttribute("autocomplete", "off"); this.valueElement.setAttribute("autocorrect", "off"); this.valueElement.setAttribute("autocapitalize", "off"); this.valueElement.setAttribute("spellcheck", false) } if (this.alphaElement && jsc.isTextInput(this.alphaElement)) { this.alphaElement.addEventListener("keydown", onAlphaKeyDown, false); this.alphaElement.addEventListener("change", onAlphaChange, false); this.alphaElement.addEventListener("input", onAlphaInput, false); this.alphaElement.setAttribute("autocomplete", "off"); this.alphaElement.setAttribute("autocorrect", "off"); this.alphaElement.setAttribute("autocapitalize", "off"); this.alphaElement.setAttribute("spellcheck", false) } var initValue = "FFFFFF"; if (this.value !== undefined) { initValue = this.value } else if (this.valueElement && this.valueElement.value !== undefined) { initValue = this.valueElement.value } var initAlpha = undefined; if (this.alpha !== undefined) { initAlpha = "" + this.alpha } else if (this.alphaElement && this.alphaElement.value !== undefined) { initAlpha = this.alphaElement.value } this._currentFormat = null; if (["auto", "any"].indexOf(this.format.toLowerCase()) > -1) { var color = jsc.parseColorString(initValue); this._currentFormat = color ? color.format : "hex" } else { this._currentFormat = this.format.toLowerCase() } this.processValueInput(initValue); if (initAlpha !== undefined) { this.processAlphaInput(initAlpha) } if (this.random) { this.randomize.apply(this, Array.isArray(this.random) ? this.random : []) } } }; jsc.pub.className = "jscolor"; jsc.pub.activeClassName = "jscolor-active"; jsc.pub.looseJSON = true; jsc.pub.presets = {}; jsc.pub.presets["default"] = {}; jsc.pub.presets["light"] = { backgroundColor: "rgba(255,255,255,1)", controlBorderColor: "rgba(187,187,187,1)", buttonColor: "rgba(0,0,0,1)" }; jsc.pub.presets["dark"] = { backgroundColor: "rgba(51,51,51,1)", controlBorderColor: "rgba(153,153,153,1)", buttonColor: "rgba(240,240,240,1)" }; jsc.pub.presets["small"] = { width: 101, height: 101, padding: 10, sliderSize: 14, paletteCols: 8 }; jsc.pub.presets["medium"] = { width: 181, height: 101, padding: 12, sliderSize: 16, paletteCols: 10 }; jsc.pub.presets["large"] = { width: 271, height: 151, padding: 12, sliderSize: 24, paletteCols: 15 }; jsc.pub.presets["thin"] = { borderWidth: 1, controlBorderWidth: 1, pointerBorderWidth: 1 }; jsc.pub.presets["thick"] = { borderWidth: 2, controlBorderWidth: 2, pointerBorderWidth: 2 }; jsc.pub.sliderInnerSpace = 3; jsc.pub.chessboardSize = 8; jsc.pub.chessboardColor1 = "#666666"; jsc.pub.chessboardColor2 = "#999999"; jsc.pub.previewSeparator = ["rgba(255,255,255,.65)", "rgba(128,128,128,.65)"]; jsc.pub.init = function () { if (jsc.initialized) { return } window.document.addEventListener("mousedown", jsc.onDocumentMouseDown, false); window.document.addEventListener("keyup", jsc.onDocumentKeyUp, false); window.addEventListener("resize", jsc.onWindowResize, false); window.addEventListener("scroll", jsc.onWindowScroll, false); jsc.pub.install(); jsc.initialized = true; while (jsc.readyQueue.length) { var func = jsc.readyQueue.shift(); func() } }; jsc.pub.install = function (rootNode) { var success = true; try { jsc.installBySelector("[data-jscolor]", rootNode) } catch (e) { success = false; console.warn(e) } if (jsc.pub.lookupClass) { try { jsc.installBySelector("input." + jsc.pub.lookupClass + ", " + "button." + jsc.pub.lookupClass, rootNode) } catch (e) { } } return success }; jsc.pub.ready = function (func) { if (typeof func !== "function") { console.warn("Passed value is not a function"); return false } if (jsc.initialized) { func() } else { jsc.readyQueue.push(func) } return true }; jsc.pub.trigger = function (eventNames) { var triggerNow = function () { jsc.triggerGlobal(eventNames) }; if (jsc.initialized) { triggerNow() } else { jsc.pub.ready(triggerNow) } }; jsc.pub.hide = function () { if (jsc.picker && jsc.picker.owner) { jsc.picker.owner.hide() } }; jsc.pub.chessboard = function (color) { if (!color) { color = "rgba(0,0,0,0)" } var preview = jsc.genColorPreviewCanvas(color); return preview.canvas.toDataURL() }; jsc.pub.background = function (color) { var backgrounds = []; backgrounds.push(jsc.genColorPreviewGradient(color)); var preview = jsc.genColorPreviewCanvas(); backgrounds.push(["url('" + preview.canvas.toDataURL() + "')", "left top", "repeat"].join(" ")); return backgrounds.join(", ") }; jsc.pub.options = {}; jsc.pub.lookupClass = "jscolor"; jsc.pub.installByClassName = function () { console.error('jscolor.installByClassName() is DEPRECATED. Use data-jscolor="" attribute instead of a class name.' + jsc.docsRef); return false }; jsc.register(); return jsc.pub }(); if (typeof window.jscolor === "undefined") { window.jscolor = window.JSColor = jscolor } return jscolor }); diff --git a/dep/markdown-it.min.js b/dep/markdown-it.min.js deleted file mode 100644 index 943e1f9..0000000 --- a/dep/markdown-it.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * markdown-it 12.2.0 - * @licence MIT - * @source https://github.com/markdown-it/markdown-it - */ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).markdownit=r()}(this,(function(){"use strict";function e(e){if(e.__esModule)return e;var r=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var r={Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",amp:"&",AMP:"&",andand:"\u2a55",And:"\u2a53",and:"\u2227",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angmsd:"\u2221",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",apacir:"\u2a6f",ap:"\u2248",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250c",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252c",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxuL:"\u255b",boxUl:"\u255c",boxUL:"\u255d",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255a",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253c",boxvH:"\u256a",boxVh:"\u256b",boxVH:"\u256c",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251c",boxvR:"\u255e",boxVr:"\u255f",boxVR:"\u2560",bprime:"\u2035",breve:"\u02d8",Breve:"\u02d8",brvbar:"\xa6",bscr:"\ud835\udcb7",Bscr:"\u212c",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsolb:"\u29c5",bsol:"\\",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",cap:"\u2229",Cap:"\u22d2",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",centerdot:"\xb7",CenterDot:"\xb7",cfr:"\ud835\udd20",Cfr:"\u212d",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25cb",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",conint:"\u222e",Conint:"\u222f",ContourIntegral:"\u222e",copf:"\ud835\udd54",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xa9",COPY:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",cross:"\u2717",Cross:"\u2a2f",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",cupbrcap:"\u2a48",cupcap:"\u2a46",CupCap:"\u224d",cup:"\u222a",Cup:"\u22d3",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21a1",dArr:"\u21d3",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21ca",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",diamond:"\u22c4",Diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21d3",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21bd",DownRightTeeVector:"\u295f",DownRightVectorBar:"\u2957",DownRightVector:"\u21c1",DownTeeArrow:"\u21a7",DownTee:"\u22a4",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",Ecirc:"\xca",ecirc:"\xea",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",escr:"\u212f",Escr:"\u2130",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",forall:"\u2200",ForAll:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",fscr:"\ud835\udcbb",Fscr:"\u2131",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",gescc:"\u2aa9",ges:"\u2a7e",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",gg:"\u226b",Gg:"\u22d9",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2aa5",gl:"\u2277",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gnE:"\u2269",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",gtcc:"\u2aa7",gtcir:"\u2a7a",gt:">",GT:">",Gt:"\u226b",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",harrcir:"\u2948",harr:"\u2194",hArr:"\u21d4",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",Hfr:"\u210c",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",hopf:"\ud835\udd59",Hopf:"\u210d",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\ud835\udcbd",Hscr:"\u210b",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",ifr:"\ud835\udd26",Ifr:"\u2111",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",incare:"\u2105",in:"\u2208",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",intcal:"\u22ba",int:"\u222b",Int:"\u222c",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",iscr:"\ud835\udcbe",Iscr:"\u2110",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",lang:"\u27e8",Lang:"\u27ea",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",larrb:"\u21e4",larrbfs:"\u291f",larr:"\u2190",Larr:"\u219e",lArr:"\u21d0",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",latail:"\u2919",lAtail:"\u291b",lat:"\u2aab",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lBarr:"\u290e",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27e8",LeftArrowBar:"\u21e4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21d0",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21c3",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTeeArrow:"\u21a4",LeftTee:"\u22a3",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangleBar:"\u29cf",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21bf",LeftVectorBar:"\u2952",LeftVector:"\u21bc",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",lescc:"\u2aa8",les:"\u2a7d",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21c7",ll:"\u226a",Ll:"\u22d8",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoustache:"\u23b0",lmoust:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lnE:"\u2268",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftrightarrow:"\u27f7",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longmapsto:"\u27fc",longrightarrow:"\u27f6",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",Lscr:"\u2112",lsh:"\u21b0",Lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",lt:"<",LT:"<",Lt:"\u226a",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",midast:"*",midcir:"\u2af0",mid:"\u2223",middot:"\xb7",minusb:"\u229f",minus:"\u2212",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",mscr:"\ud835\udcc2",Mscr:"\u2133",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266e",naturals:"\u2115",natur:"\u266e",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21d7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nharr:"\u21ae",nhArr:"\u21ce",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlarr:"\u219a",nlArr:"\u21cd",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219a",nLeftarrow:"\u21cd",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",nopf:"\ud835\udd5f",Nopf:"\u2115",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",nprec:"\u2280",npreceq:"\u2aaf\u0338",npre:"\u2aaf\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219b",nrArr:"\u21cf",nrarrw:"\u219d\u0338",nrightarrow:"\u219b",nRightarrow:"\u21cf",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21d6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",Ocirc:"\xd4",ocirc:"\xf4",ocir:"\u229a",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",orarr:"\u21bb",Or:"\u2a54",or:"\u2228",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",otimesas:"\u2a36",Otimes:"\u2a37",otimes:"\u2297",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",para:"\xb6",parallel:"\u2225",par:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plus:"+",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",popf:"\ud835\udd61",Popf:"\u2119",pound:"\xa3",prap:"\u2ab7",Pr:"\u2abb",pr:"\u227a",prcue:"\u227c",precapprox:"\u2ab7",prec:"\u227a",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",pre:"\u2aaf",prE:"\u2ab3",precsim:"\u227e",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportional:"\u221d",Proportion:"\u2237",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",qopf:"\ud835\udd62",Qopf:"\u211a",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",quot:'"',QUOT:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",rang:"\u27e9",Rang:"\u27eb",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21a0",rArr:"\u21d2",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",ratail:"\u291a",rAtail:"\u291c",ratio:"\u2236",rationals:"\u211a",rbarr:"\u290d",rBarr:"\u290f",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",Re:"\u211c",rect:"\u25ad",reg:"\xae",REG:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",rfr:"\ud835\udd2f",Rfr:"\u211c",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrowBar:"\u21e5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21d2",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVectorBar:"\u2955",RightDownVector:"\u21c2",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTeeArrow:"\u21a6",RightTee:"\u22a2",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangleBar:"\u29d0",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVectorBar:"\u2954",RightUpVector:"\u21be",RightVectorBar:"\u2953",RightVector:"\u21c0",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoustache:"\u23b1",rmoust:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",ropf:"\ud835\udd63",Ropf:"\u211d",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",rscr:"\ud835\udcc7",Rscr:"\u211b",rsh:"\u21b1",Rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2abc",sc:"\u227b",sccue:"\u227d",sce:"\u2ab0",scE:"\u2ab4",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdotb:"\u22a1",sdot:"\u22c5",sdote:"\u2a66",searhk:"\u2925",searr:"\u2198",seArr:"\u21d8",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",solbar:"\u233f",solb:"\u29c4",sol:"/",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25a1",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squ:"\u25a1",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",sub:"\u2282",Sub:"\u22d0",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subset:"\u2282",Subset:"\u22d0",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succapprox:"\u2ab8",succ:"\u227b",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",sum:"\u2211",Sum:"\u2211",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"\u2283",Sup:"\u22d1",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",supset:"\u2283",Supset:"\u22d1",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21d9",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",tilde:"\u02dc",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2a31",timesb:"\u22a0",times:"\xd7",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",topbot:"\u2336",topcir:"\u2af1",top:"\u22a4",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",uarr:"\u2191",Uarr:"\u219f",uArr:"\u21d1",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21d1",UpArrowDownArrow:"\u21c5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21d5",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03c5",Upsi:"\u03d2",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTeeArrow:"\u21a5",UpTee:"\u22a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",varr:"\u2195",vArr:"\u21d5",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",vBar:"\u2ae8",Vbar:"\u2aeb",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22a2",vDash:"\u22a8",Vdash:"\u22a9",VDash:"\u22ab",Vdashl:"\u2ae6",veebar:"\u22bb",vee:"\u2228",Vee:"\u22c1",veeeq:"\u225a",vellip:"\u22ee",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",wedge:"\u2227",Wedge:"\u22c0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xharr:"\u27f7",xhArr:"\u27fa",Xi:"\u039e",xi:"\u03be",xlarr:"\u27f5",xlArr:"\u27f8",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrarr:"\u27f6",xrArr:"\u27f9",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",yuml:"\xff",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",zfr:"\ud835\udd37",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",Zopf:"\u2124",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"},t=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,n={};function s(e,r,t){var o,i,a,c,l,u="";for("string"!=typeof r&&(t=r,r=s.defaultChars),void 0===t&&(t=!0),l=function(e){var r,t,s=n[e];if(s)return s;for(s=n[e]=[],r=0;r<128;r++)t=String.fromCharCode(r),/^[0-9a-z]$/i.test(t)?s.push(t):s.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2));for(r=0;r=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1=56320&&c<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[o]);return u}s.defaultChars=";/?:@&=+$,-_.!~*'()#",s.componentChars="-_.!~*'()";var o=s,i={};function a(e,r){var t;return"string"!=typeof r&&(r=a.defaultChars),t=function(e){var r,t,n=i[e];if(n)return n;for(n=i[e]=[],r=0;r<128;r++)t=String.fromCharCode(r),n.push(t);for(r=0;r=55296&&c<=57343?"\ufffd\ufffd\ufffd":String.fromCharCode(c),r+=6):240==(248&s)&&r+91114111?l+="\ufffd\ufffd\ufffd\ufffd":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),r+=9):l+="\ufffd";return l}))}a.defaultChars=";/?:@&=+$,#",a.componentChars="";var c=a;function l(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var u=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(f),m=["%","/","?",";","#"].concat(d),g=["/","?","#"],_=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,k={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};l.prototype.parse=function(e,r){var t,n,s,o,i,a=e;if(a=a.trim(),!r&&1===e.split("#").length){var c=h.exec(a);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}var l=u.exec(a);if(l&&(s=(l=l[0]).toLowerCase(),this.protocol=l,a=a.substr(l.length)),(r||l||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(i="//"===a.substr(0,2))||l&&k[l]||(a=a.substr(2),this.slashes=!0)),!k[l]&&(i||l&&!v[l])){var p,f,d=-1;for(t=0;t127?D+="x":D+=x[w];if(!D.match(_)){var q=A.slice(0,t),S=A.slice(t+1),F=x.match(b);F&&(q.push(F[1]),S.unshift(F[2])),S.length&&(a=S.join(".")+a),this.hostname=q.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var L=a.indexOf("#");-1!==L&&(this.hash=a.substr(L),a=a.slice(0,L));var z=a.indexOf("?");return-1!==z&&(this.search=a.substr(z),a=a.slice(0,z)),a&&(this.pathname=a),v[s]&&this.hostname&&!this.pathname&&(this.pathname=""),this},l.prototype.parseHost=function(e){var r=p.exec(e);r&&(":"!==(r=r[0])&&(this.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(this.hostname=e)};var C={encode:o,decode:c,format:function(e){var r="";return r+=e.protocol||"",r+=e.slashes?"//":"",r+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?r+="["+e.hostname+"]":r+=e.hostname||"",r+=e.port?":"+e.port:"",r+=e.pathname||"",r+=e.search||"",r+=e.hash||""},parse:function(e,r){if(e&&e instanceof l)return e;var t=new l;return t.parse(e,r),t}},y=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,A=/[\0-\x1F\x7F-\x9F]/,x=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,D={Any:y,Cc:A,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:t,Z:x},w=function(e,r,t){return e(t={path:r,exports:{},require:function(e,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&t.path)}},t.exports),t.exports}((function(e,n){var s=Object.prototype.hasOwnProperty;function o(e,r){return s.call(e,r)}function i(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function a(e){if(e>65535){var r=55296+((e-=65536)>>10),t=56320+(1023&e);return String.fromCharCode(r,t)}return String.fromCharCode(e)}var c=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,l=new RegExp(c.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),u=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;var p=/[&<>"]/,h=/[&<>"]/g,f={"&":"&","<":"<",">":">",'"':"""};function d(e){return f[e]}var m=/[.?*+^$[\]\\(){}|-]/g;n.lib={},n.lib.mdurl=C,n.lib.ucmicro=D,n.assign=function(e){var r=Array.prototype.slice.call(arguments,1);return r.forEach((function(r){if(r){if("object"!=typeof r)throw new TypeError(r+"must be object");Object.keys(r).forEach((function(t){e[t]=r[t]}))}})),e},n.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},n.has=o,n.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(c,"$1")},n.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(l,(function(e,t,n){return t||function(e,t){var n=0;return o(r,t)?r[t]:35===t.charCodeAt(0)&&u.test(t)&&i(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?a(n):e}(e,n)}))},n.isValidEntityCode=i,n.fromCodePoint=a,n.escapeHtml=function(e){return p.test(e)?e.replace(h,d):e},n.arrayReplaceAt=function(e,r,t){return[].concat(e.slice(0,r),t,e.slice(r+1))},n.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},n.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},n.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},n.isPunctChar=function(e){return t.test(e)},n.escapeRE=function(e){return e.replace(m,"\\$&")},n.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"\u1e7e"==="\u1e9e".toLowerCase()&&(e=e.replace(/\u1e9e/g,"\xdf")),e.toLowerCase().toUpperCase()}})),E=w.unescapeAll,q=w.unescapeAll,S={parseLinkLabel:function(e,r,t){var n,s,o,i,a=-1,c=e.posMax,l=e.pos;for(e.pos=r+1,n=1;e.pos32)return i;if(41===n){if(0===s)break;s--}r++}return o===r||0!==s||(i.str=E(e.slice(o,r)),i.lines=0,i.pos=r,i.ok=!0),i},parseLinkTitle:function(e,r,t){var n,s,o=0,i=r,a={ok:!1,pos:0,lines:0,str:""};if(r>=t)return a;if(34!==(s=e.charCodeAt(r))&&39!==s&&40!==s)return a;for(r++,40===s&&(s=41);r"+z(e[r].content)+""},T.code_block=function(e,r,t,n,s){var o=e[r];return""+z(e[r].content)+"\n"},T.fence=function(e,r,t,n,s){var o,i,a,c,l,u=e[r],p=u.info?L(u.info).trim():"",h="",f="";return p&&(h=(a=p.split(/(\s+)/g))[0],f=a.slice(2).join("")),0===(o=t.highlight&&t.highlight(u.content,h,f)||z(u.content)).indexOf(""+o+"\n"):"
"+o+"
\n"},T.image=function(e,r,t,n,s){var o=e[r];return o.attrs[o.attrIndex("alt")][1]=s.renderInlineAsText(o.children,t,n),s.renderToken(e,r,t)},T.hardbreak=function(e,r,t){return t.xhtmlOut?"
\n":"
\n"},T.softbreak=function(e,r,t){return t.breaks?t.xhtmlOut?"
\n":"
\n":"\n"},T.text=function(e,r){return z(e[r].content)},T.html_block=function(e,r){return e[r].content},T.html_inline=function(e,r){return e[r].content},I.prototype.renderAttrs=function(e){var r,t,n;if(!e.attrs)return"";for(n="",r=0,t=e.attrs.length;r\n":">")},I.prototype.renderInline=function(e,r,t){for(var n,s="",o=this.rules,i=0,a=e.length;i/i.test(e)}var U=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,V=/\((c|tm|r|p)\)/i,Z=/\((c|tm|r|p)\)/gi,G={c:"\xa9",r:"\xae",p:"\xa7",tm:"\u2122"};function $(e,r){return G[r.toLowerCase()]}function H(e){var r,t,n=0;for(r=e.length-1;r>=0;r--)"text"!==(t=e[r]).type||n||(t.content=t.content.replace(Z,$)),"link_open"===t.type&&"auto"===t.info&&n--,"link_close"===t.type&&"auto"===t.info&&n++}function J(e){var r,t,n=0;for(r=e.length-1;r>=0;r--)"text"!==(t=e[r]).type||n||U.test(t.content)&&(t.content=t.content.replace(/\+-/g,"\xb1").replace(/\.{2,}/g,"\u2026").replace(/([?!])\u2026/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1\u2014").replace(/(^|\s)--(?=\s|$)/gm,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1\u2013")),"link_open"===t.type&&"auto"===t.info&&n--,"link_close"===t.type&&"auto"===t.info&&n++}var W=w.isWhiteSpace,Y=w.isPunctChar,K=w.isMdAsciiPunct,Q=/['"]/,X=/['"]/g;function ee(e,r,t){return e.substr(0,r)+t+e.substr(r+1)}function re(e,r){var t,n,s,o,i,a,c,l,u,p,h,f,d,m,g,_,b,k,v,C,y;for(v=[],t=0;t=0&&!(v[b].level<=c);b--);if(v.length=b+1,"text"===n.type){i=0,a=(s=n.content).length;e:for(;i=0)u=s.charCodeAt(o.index-1);else for(b=t-1;b>=0&&("softbreak"!==e[b].type&&"hardbreak"!==e[b].type);b--)if(e[b].content){u=e[b].content.charCodeAt(e[b].content.length-1);break}if(p=32,i=48&&u<=57&&(_=g=!1),g&&_&&(g=h,_=f),g||_){if(_)for(b=v.length-1;b>=0&&(l=v[b],!(v[b].level=0&&(t=this.attrs[r][1]),t},te.prototype.attrJoin=function(e,r){var t=this.attrIndex(e);t<0?this.attrPush([e,r]):this.attrs[t][1]=this.attrs[t][1]+" "+r};var ne=te;function se(e,r,t){this.src=e,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=r}se.prototype.Token=ne;var oe=se,ie=[["normalize",function(e){var r;r=(r=e.src.replace(N,"\n")).replace(O,"\ufffd"),e.src=r}],["block",function(e){var r;e.inlineMode?((r=new e.Token("inline","",0)).content=e.src,r.map=[0,1],r.children=[],e.tokens.push(r)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}],["inline",function(e){var r,t,n,s=e.tokens;for(t=0,n=s.length;t=0;r--)if("link_close"!==(i=s[r]).type){if("html_inline"===i.type&&(b=i.content,/^\s]/i.test(b)&&f>0&&f--,j(i.content)&&f++),!(f>0)&&"text"===i.type&&e.md.linkify.test(i.content)){for(l=i.content,_=e.md.linkify.match(l),a=[],h=i.level,p=0,c=0;c<_.length;c++)d=_[c].url,m=e.md.normalizeLink(d),e.md.validateLink(m)&&(g=_[c].text,g=_[c].schema?"mailto:"!==_[c].schema||/^mailto:/i.test(g)?e.md.normalizeLinkText(g):e.md.normalizeLinkText("mailto:"+g).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+g).replace(/^http:\/\//,""),(u=_[c].index)>p&&((o=new e.Token("text","",0)).content=l.slice(p,u),o.level=h,a.push(o)),(o=new e.Token("link_open","a",1)).attrs=[["href",m]],o.level=h++,o.markup="linkify",o.info="auto",a.push(o),(o=new e.Token("text","",0)).content=g,o.level=h,a.push(o),(o=new e.Token("link_close","a",-1)).level=--h,o.markup="linkify",o.info="auto",a.push(o),p=_[c].lastIndex);p=0;r--)"inline"===e.tokens[r].type&&(V.test(e.tokens[r].content)&&H(e.tokens[r].children),U.test(e.tokens[r].content)&&J(e.tokens[r].children))}],["smartquotes",function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)"inline"===e.tokens[r].type&&Q.test(e.tokens[r].content)&&re(e.tokens[r].children,e)}]];function ae(){this.ruler=new B;for(var e=0;e=o)return-1;if((t=e.src.charCodeAt(s++))<48||t>57)return-1;for(;;){if(s>=o)return-1;if(!((t=e.src.charCodeAt(s++))>=48&&t<=57)){if(41===t||46===t)break;return-1}if(s-n>=10)return-1}return s`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",ve="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Ce={HTML_TAG_RE:new RegExp("^(?:"+ke+"|"+ve+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),HTML_OPEN_CLOSE_TAG_RE:new RegExp("^(?:"+ke+"|"+ve+")")},ye=Ce.HTML_OPEN_CLOSE_TAG_RE,Ae=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(ye.source+"\\s*$"),/^$/,!1]],xe=w.isSpace,De=w.isSpace;function we(e,r,t,n){var s,o,i,a,c,l,u,p;for(this.src=e,this.md=r,this.env=t,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",p=!1,i=a=l=u=0,c=(o=this.src).length;a0&&this.level++,this.tokens.push(n),n},we.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},we.prototype.skipEmptyLines=function(e){for(var r=this.lineMax;er;)if(!De(this.src.charCodeAt(--e)))return e+1;return e},we.prototype.skipChars=function(e,r){for(var t=this.src.length;et;)if(r!==this.src.charCodeAt(--e))return e+1;return e},we.prototype.getLines=function(e,r,t,n){var s,o,i,a,c,l,u,p=e;if(e>=r)return"";for(l=new Array(r-e),s=0;pt?new Array(o-t+1).join(" ")+this.src.slice(a,c):this.src.slice(a,c)}return l.join("")},we.prototype.Token=ne;var Ee=we,qe=[["table",function(e,r,t,n){var s,o,i,a,c,l,u,p,h,f,d,m,g,_,b,k,v,C;if(r+2>t)return!1;if(l=r+1,e.sCount[l]=4)return!1;if((i=e.bMarks[l]+e.tShift[l])>=e.eMarks[l])return!1;if(124!==(v=e.src.charCodeAt(i++))&&45!==v&&58!==v)return!1;if(i>=e.eMarks[l])return!1;if(124!==(C=e.src.charCodeAt(i++))&&45!==C&&58!==C&&!le(C))return!1;if(45===v&&le(C))return!1;for(;i=4)return!1;if((u=pe(o)).length&&""===u[0]&&u.shift(),u.length&&""===u[u.length-1]&&u.pop(),0===(p=u.length)||p!==f.length)return!1;if(n)return!0;for(_=e.parentType,e.parentType="table",k=e.md.block.ruler.getRules("blockquote"),(h=e.push("table_open","table",1)).map=m=[r,0],(h=e.push("thead_open","thead",1)).map=[r,r+1],(h=e.push("tr_open","tr",1)).map=[r,r+1],a=0;a=4)break;for((u=pe(o)).length&&""===u[0]&&u.shift(),u.length&&""===u[u.length-1]&&u.pop(),l===r+2&&((h=e.push("tbody_open","tbody",1)).map=g=[r+2,0]),(h=e.push("tr_open","tr",1)).map=[l,l+1],a=0;a=4))break;s=++n}return e.line=s,(o=e.push("code_block","code",0)).content=e.getLines(r,s,4+e.blkIndent,!1)+"\n",o.map=[r,e.line],!0}],["fence",function(e,r,t,n){var s,o,i,a,c,l,u,p=!1,h=e.bMarks[r]+e.tShift[r],f=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4)return!1;if(h+3>f)return!1;if(126!==(s=e.src.charCodeAt(h))&&96!==s)return!1;if(c=h,(o=(h=e.skipChars(h,s))-c)<3)return!1;if(u=e.src.slice(c,h),i=e.src.slice(h,f),96===s&&i.indexOf(String.fromCharCode(s))>=0)return!1;if(n)return!0;for(a=r;!(++a>=t)&&!((h=c=e.bMarks[a]+e.tShift[a])<(f=e.eMarks[a])&&e.sCount[a]=4||(h=e.skipChars(h,s))-c=4)return!1;if(62!==e.src.charCodeAt(D++))return!1;if(n)return!0;for(a=h=e.sCount[r]+1,32===e.src.charCodeAt(D)?(D++,a++,h++,s=!1,k=!0):9===e.src.charCodeAt(D)?(k=!0,(e.bsCount[r]+h)%4==3?(D++,a++,h++,s=!1):s=!0):k=!1,f=[e.bMarks[r]],e.bMarks[r]=D;D=w,_=[e.sCount[r]],e.sCount[r]=h-a,b=[e.tShift[r]],e.tShift[r]=D-e.bMarks[r],C=e.md.block.ruler.getRules("blockquote"),g=e.parentType,e.parentType="blockquote",p=r+1;p=(w=e.eMarks[p])));p++)if(62!==e.src.charCodeAt(D++)||A){if(l)break;for(v=!1,i=0,c=C.length;i=w,d.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(k?1:0),_.push(e.sCount[p]),e.sCount[p]=h-a,b.push(e.tShift[p]),e.tShift[p]=D-e.bMarks[p]}for(m=e.blkIndent,e.blkIndent=0,(y=e.push("blockquote_open","blockquote",1)).markup=">",y.map=u=[r,0],e.md.block.tokenize(e,r,p),(y=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=x,e.parentType=g,u[1]=e.line,i=0;i=4)return!1;if(42!==(s=e.src.charCodeAt(c++))&&45!==s&&95!==s)return!1;for(o=1;c=4)return!1;if(e.listIndent>=0&&e.sCount[r]-e.listIndent>=4&&e.sCount[r]=e.blkIndent&&(z=!0),(w=ge(e,r))>=0){if(u=!0,q=e.bMarks[r]+e.tShift[r],g=Number(e.src.slice(q,w-1)),z&&1!==g)return!1}else{if(!((w=me(e,r))>=0))return!1;u=!1}if(z&&e.skipSpaces(w)>=e.eMarks[r])return!1;if(m=e.src.charCodeAt(w-1),n)return!0;for(d=e.tokens.length,u?(L=e.push("ordered_list_open","ol",1),1!==g&&(L.attrs=[["start",g]])):L=e.push("bullet_list_open","ul",1),L.map=f=[r,0],L.markup=String.fromCharCode(m),b=r,E=!1,F=e.md.block.ruler.getRules("list"),C=e.parentType,e.parentType="list";b=_?1:k-l)>4&&(c=1),a=l+c,(L=e.push("list_item_open","li",1)).markup=String.fromCharCode(m),L.map=p=[r,0],u&&(L.info=e.src.slice(q,w-1)),x=e.tight,A=e.tShift[r],y=e.sCount[r],v=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=a,e.tight=!0,e.tShift[r]=o-e.bMarks[r],e.sCount[r]=k,o>=_&&e.isEmpty(r+1)?e.line=Math.min(e.line+2,t):e.md.block.tokenize(e,r,t,!0),e.tight&&!E||(T=!1),E=e.line-r>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=v,e.tShift[r]=A,e.sCount[r]=y,e.tight=x,(L=e.push("list_item_close","li",-1)).markup=String.fromCharCode(m),b=r=e.line,p[1]=b,o=e.bMarks[r],b>=t)break;if(e.sCount[b]=4)break;for(S=!1,i=0,h=F.length;i=4)return!1;if(91!==e.src.charCodeAt(C))return!1;for(;++C3||e.sCount[A]<0)){for(_=!1,l=0,u=b.length;l=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(c))return!1;for(a=e.src.slice(c,l),s=0;s=4)return!1;if(35!==(s=e.src.charCodeAt(c))||c>=l)return!1;for(o=1,s=e.src.charCodeAt(++c);35===s&&c6||cc&&xe(e.src.charCodeAt(i-1))&&(l=i),e.line=r+1,(a=e.push("heading_open","h"+String(o),1)).markup="########".slice(0,o),a.map=[r,e.line],(a=e.push("inline","",0)).content=e.src.slice(c,l).trim(),a.map=[r,e.line],a.children=[],(a=e.push("heading_close","h"+String(o),-1)).markup="########".slice(0,o)),!0)},["paragraph","reference","blockquote"]],["lheading",function(e,r,t){var n,s,o,i,a,c,l,u,p,h,f=r+1,d=e.md.block.ruler.getRules("paragraph");if(e.sCount[r]-e.blkIndent>=4)return!1;for(h=e.parentType,e.parentType="paragraph";f3)){if(e.sCount[f]>=e.blkIndent&&(c=e.bMarks[f]+e.tShift[f])<(l=e.eMarks[f])&&(45===(p=e.src.charCodeAt(c))||61===p)&&(c=e.skipChars(c,p),(c=e.skipSpaces(c))>=l)){u=61===p?1:2;break}if(!(e.sCount[f]<0)){for(s=!1,o=0,i=d.length;o3||e.sCount[c]<0)){for(n=!1,s=0,o=l.length;s=t))&&!(e.sCount[i]=c){e.line=t;break}for(n=0;n?@[]^_`{|}~-".split("").forEach((function(e){Ie[e.charCodeAt(0)]=1}));function Re(e,r){var t,n,s,o,i,a=[],c=r.length;for(t=0;t=0;t--)95!==(n=r[t]).marker&&42!==n.marker||-1!==n.end&&(s=r[n.end],a=t>0&&r[t-1].end===n.end+1&&r[t-1].token===n.token-1&&r[n.end+1].token===s.token+1&&r[t-1].marker===n.marker,i=String.fromCharCode(n.marker),(o=e.tokens[n.token]).type=a?"strong_open":"em_open",o.tag=a?"strong":"em",o.nesting=1,o.markup=a?i+i:i,o.content="",(o=e.tokens[s.token]).type=a?"strong_close":"em_close",o.tag=a?"strong":"em",o.nesting=-1,o.markup=a?i+i:i,o.content="",a&&(e.tokens[r[t-1].token].content="",e.tokens[r[n.end+1].token].content="",t--))}var Oe={tokenize:function(e,r){var t,n,s=e.pos,o=e.src.charCodeAt(s);if(r)return!1;if(95!==o&&42!==o)return!1;for(n=e.scanDelims(e.pos,42===o),t=0;t\x00-\x20]*)$/,$e=Ce.HTML_TAG_RE;var He=w.has,Je=w.isValidEntityCode,We=w.fromCodePoint,Ye=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ke=/^&([a-z][a-z0-9]{1,31});/i;function Qe(e,r){var t,n,s,o,i,a,c,l,u={},p=r.length;for(t=0;ti;n-=o.jump+1)if((o=r[n]).marker===s.marker&&o.open&&o.end<0&&(c=!1,(o.close||s.open)&&(o.length+s.length)%3==0&&(o.length%3==0&&s.length%3==0||(c=!0)),!c)){l=n>0&&!r[n-1].open?r[n-1].jump+1:0,s.jump=t-n+l,s.open=!1,o.end=t,o.jump=l,o.close=!1,a=-1;break}-1!==a&&(u[s.marker][(s.open?3:0)+(s.length||0)%3]=a)}}var Xe=w.isWhiteSpace,er=w.isPunctChar,rr=w.isMdAsciiPunct;function tr(e,r,t,n){this.src=e,this.env=t,this.md=r,this.tokens=n,this.tokens_meta=Array(n.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1}tr.prototype.pushPending=function(){var e=new ne("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},tr.prototype.push=function(e,r,t){this.pending&&this.pushPending();var n=new ne(e,r,t),s=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(s),n},tr.prototype.scanDelims=function(e,r){var t,n,s,o,i,a,c,l,u,p=e,h=!0,f=!0,d=this.posMax,m=this.src.charCodeAt(e);for(t=e>0?this.src.charCodeAt(e-1):32;p=0&&32===e.pending.charCodeAt(t)?t>=1&&32===e.pending.charCodeAt(t-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),s++;s=f)return!1;if(d=a,(c=e.md.helpers.parseLinkDestination(e.src,a,e.posMax)).ok){for(u=e.md.normalizeLink(c.str),e.md.validateLink(u)?a=c.pos:u="",d=a;a=f||41!==e.src.charCodeAt(a))&&(m=!0),a++}if(m){if(void 0===e.env.references)return!1;if(a=0?s=e.src.slice(d,a++):a=o+1):a=o+1,s||(s=e.src.slice(i,o)),!(l=e.env.references[Pe(s)]))return e.pos=h,!1;u=l.href,p=l.title}return r||(e.pos=i,e.posMax=o,e.push("link_open","a",1).attrs=t=[["href",u]],p&&t.push(["title",p]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=a,e.posMax=f,!0}],["image",function(e,r){var t,n,s,o,i,a,c,l,u,p,h,f,d,m="",g=e.pos,_=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(a=e.pos+2,(i=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((c=i+1)<_&&40===e.src.charCodeAt(c)){for(c++;c<_&&(n=e.src.charCodeAt(c),Ve(n)||10===n);c++);if(c>=_)return!1;for(d=c,(u=e.md.helpers.parseLinkDestination(e.src,c,e.posMax)).ok&&(m=e.md.normalizeLink(u.str),e.md.validateLink(m)?c=u.pos:m=""),d=c;c<_&&(n=e.src.charCodeAt(c),Ve(n)||10===n);c++);if(u=e.md.helpers.parseLinkTitle(e.src,c,e.posMax),c<_&&d!==c&&u.ok)for(p=u.str,c=u.pos;c<_&&(n=e.src.charCodeAt(c),Ve(n)||10===n);c++);else p="";if(c>=_||41!==e.src.charCodeAt(c))return e.pos=g,!1;c++}else{if(void 0===e.env.references)return!1;if(c<_&&91===e.src.charCodeAt(c)?(d=c+1,(c=e.md.helpers.parseLinkLabel(e,c))>=0?o=e.src.slice(d,c++):c=i+1):c=i+1,o||(o=e.src.slice(a,i)),!(l=e.env.references[Ue(o)]))return e.pos=g,!1;m=l.href,p=l.title}return r||(s=e.src.slice(a,i),e.md.inline.parse(s,e.md,e.env,f=[]),(h=e.push("image","img",0)).attrs=t=[["src",m],["alt",""]],h.children=f,h.content=s,p&&t.push(["title",p])),e.pos=c,e.posMax=_,!0}],["autolink",function(e,r){var t,n,s,o,i,a,c=e.pos;if(60!==e.src.charCodeAt(c))return!1;for(i=e.pos,a=e.posMax;;){if(++c>=a)return!1;if(60===(o=e.src.charCodeAt(c)))return!1;if(62===o)break}return t=e.src.slice(i+1,c),Ge.test(t)?(n=e.md.normalizeLink(t),!!e.md.validateLink(n)&&(r||((s=e.push("link_open","a",1)).attrs=[["href",n]],s.markup="autolink",s.info="auto",(s=e.push("text","",0)).content=e.md.normalizeLinkText(t),(s=e.push("link_close","a",-1)).markup="autolink",s.info="auto"),e.pos+=t.length+2,!0)):!!Ze.test(t)&&(n=e.md.normalizeLink("mailto:"+t),!!e.md.validateLink(n)&&(r||((s=e.push("link_open","a",1)).attrs=[["href",n]],s.markup="autolink",s.info="auto",(s=e.push("text","",0)).content=e.md.normalizeLinkText(t),(s=e.push("link_close","a",-1)).markup="autolink",s.info="auto"),e.pos+=t.length+2,!0))}],["html_inline",function(e,r){var t,n,s,o=e.pos;return!!e.md.options.html&&(s=e.posMax,!(60!==e.src.charCodeAt(o)||o+2>=s)&&(!(33!==(t=e.src.charCodeAt(o+1))&&63!==t&&47!==t&&!function(e){var r=32|e;return r>=97&&r<=122}(t))&&(!!(n=e.src.slice(o).match($e))&&(r||(e.push("html_inline","",0).content=e.src.slice(o,o+n[0].length)),e.pos+=n[0].length,!0))))}],["entity",function(e,t){var n,s,o=e.pos,i=e.posMax;if(38!==e.src.charCodeAt(o))return!1;if(o+10&&n++,"text"===s[r].type&&r+1=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},ir.prototype.parse=function(e,r,t,n){var s,o,i,a=new this.State(e,r,t,n);for(this.tokenize(a),i=(o=this.ruler2.getRules("")).length,s=0;s=3&&":"===e[r-3]||r>=3&&"/"===e[r-3]?0:n.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(e,r,t){var n=e.slice(r);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(n)?n.match(t.re.mailto)[0].length:0}}},dr="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function mr(e){var r=e.re=function(e){var r={};return r.src_Any=y.source,r.src_Cc=A.source,r.src_Z=x.source,r.src_P=t.source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|"),r.src_pseudo_letter="(?:(?![><\uff5c]|"+r.src_ZPCc+")"+r.src_Any+")",r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth="(?:(?:(?!"+r.src_ZCc+"|[@/\\[\\]()]).)+@)?",r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator="(?=$|[><\uff5c]|"+r.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+r.src_ZPCc+"))",r.src_path="(?:[/?#](?:(?!"+r.src_ZCc+"|[><\uff5c]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+r.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+r.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+r.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+r.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+r.src_ZCc+"|[']).)+\\'|\\'(?="+r.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+r.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+r.src_ZCc+").|\\!+(?!"+r.src_ZCc+"|[!]).|\\?(?!"+r.src_ZCc+"|[?]).)+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+r.src_pseudo_letter+"{1,63})",r.src_domain="(?:"+r.src_xn+"|(?:"+r.src_pseudo_letter+")|(?:"+r.src_pseudo_letter+"(?:-|"+r.src_pseudo_letter+"){0,61}"+r.src_pseudo_letter+"))",r.src_host="(?:(?:(?:(?:"+r.src_domain+")\\.)*"+r.src_domain+"))",r.tpl_host_fuzzy="(?:"+r.src_ip4+"|(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%)))",r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%))",r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+r.src_ZPCc+"|>|$))",r.tpl_email_fuzzy='(^|[><\uff5c]|"|\\(|'+r.src_ZCc+")("+r.src_email_name+"@"+r.tpl_host_fuzzy_strict+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+r.src_ZPCc+"))((?![$+<=>^`|\uff5c])"+r.tpl_host_port_fuzzy_strict+r.src_path+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+r.src_ZPCc+"))((?![$+<=>^`|\uff5c])"+r.tpl_host_port_no_ip_fuzzy_strict+r.src_path+")",r}(e.__opts__),n=e.__tlds__.slice();function s(e){return e.replace("%TLDS%",r.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(r.src_xn),r.src_tlds=n.join("|"),r.email_fuzzy=RegExp(s(r.tpl_email_fuzzy),"i"),r.link_fuzzy=RegExp(s(r.tpl_link_fuzzy),"i"),r.link_no_ip_fuzzy=RegExp(s(r.tpl_link_no_ip_fuzzy),"i"),r.host_fuzzy_test=RegExp(s(r.tpl_host_fuzzy_test),"i");var o=[];function i(e,r){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+r)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(r){var t=e.__schemas__[r];if(null!==t){var n={validate:null,link:null};if(e.__compiled__[r]=n,"[object Object]"===lr(t))return!function(e){return"[object RegExp]"===lr(e)}(t.validate)?ur(t.validate)?n.validate=t.validate:i(r,t):n.validate=function(e){return function(r,t){var n=r.slice(t);return e.test(n)?n.match(e)[0].length:0}}(t.validate),void(ur(t.normalize)?n.normalize=t.normalize:t.normalize?i(r,t):n.normalize=function(e,r){r.normalize(e)});!function(e){return"[object String]"===lr(e)}(t)?i(r,t):o.push(r)}})),o.forEach((function(r){e.__compiled__[e.__schemas__[r]]&&(e.__compiled__[r].validate=e.__compiled__[e.__schemas__[r]].validate,e.__compiled__[r].normalize=e.__compiled__[e.__schemas__[r]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,r){r.normalize(e)}};var a=Object.keys(e.__compiled__).filter((function(r){return r.length>0&&e.__compiled__[r]})).map(pr).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><\uff5c]|"+r.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><\uff5c]|"+r.src_ZPCc+"))("+a+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function gr(e,r){var t=e.__index__,n=e.__last_index__,s=e.__text_cache__.slice(t,n);this.schema=e.__schema__.toLowerCase(),this.index=t+r,this.lastIndex=n+r,this.raw=s,this.text=s,this.url=s}function _r(e,r){var t=new gr(e,r);return e.__compiled__[t.schema].normalize(t,e),t}function br(e,r){if(!(this instanceof br))return new br(e,r);var t;r||(t=e,Object.keys(t||{}).reduce((function(e,r){return e||hr.hasOwnProperty(r)}),!1)&&(r=e,e={})),this.__opts__=cr({},hr,r),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=cr({},fr,e),this.__compiled__={},this.__tlds__=dr,this.__tlds_replaced__=!1,this.re={},mr(this)}br.prototype.add=function(e,r){return this.__schemas__[e]=r,mr(this),this},br.prototype.set=function(e){return this.__opts__=cr(this.__opts__,e),this},br.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var r,t,n,s,o,i,a,c;if(this.re.schema_test.test(e))for((a=this.re.schema_search).lastIndex=0;null!==(r=a.exec(e));)if(s=this.testSchemaAt(e,r[2],a.lastIndex)){this.__schema__=r[2],this.__index__=r.index+r[1].length,this.__last_index__=r.index+r[0].length+s;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c=0&&null!==(n=e.match(this.re.email_fuzzy))&&(o=n.index+n[1].length,i=n.index+n[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=i)),this.__index__>=0},br.prototype.pretest=function(e){return this.re.pretest.test(e)},br.prototype.testSchemaAt=function(e,r,t){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,t,this):0},br.prototype.match=function(e){var r=0,t=[];this.__index__>=0&&this.__text_cache__===e&&(t.push(_r(this,r)),r=this.__last_index__);for(var n=r?e.slice(r):e;this.test(n);)t.push(_r(this,r)),n=n.slice(this.__last_index__),r+=this.__last_index__;return t.length?t:null},br.prototype.tlds=function(e,r){return e=Array.isArray(e)?e:[e],r?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,r,t){return e!==t[r-1]})).reverse(),mr(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,mr(this),this)},br.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},br.prototype.onCompile=function(){};var kr=br,vr=2147483647,Cr=36,yr=/^xn--/,Ar=/[^\x20-\x7E]/,xr=/[\x2E\u3002\uFF0E\uFF61]/g,Dr={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},wr=Math.floor,Er=String.fromCharCode; -/** - * Punycode v1.4.1 - * @license MIT - * @source https://mths.be/punycode - */ -function qr(e){throw new RangeError(Dr[e])}function Sr(e,r){for(var t=e.length,n=[];t--;)n[t]=r(e[t]);return n}function Fr(e,r){var t=e.split("@"),n="";return t.length>1&&(n=t[0]+"@",e=t[1]),n+Sr((e=e.replace(xr,".")).split("."),r).join(".")}function Lr(e){for(var r,t,n=[],s=0,o=e.length;s=55296&&r<=56319&&s65535&&(r+=Er((e-=65536)>>>10&1023|55296),e=56320|1023&e),r+=Er(e)})).join("")}function Tr(e,r){return e+22+75*(e<26)-((0!=r)<<5)}function Ir(e,r,t){var n=0;for(e=t?wr(e/700):e>>1,e+=wr(e/r);e>455;n+=Cr)e=wr(e/35);return wr(n+36*e/(e+38))}function Mr(e){var r,t,n,s,o,i,a,c,l,u,p,h=[],f=e.length,d=0,m=128,g=72;for((t=e.lastIndexOf("-"))<0&&(t=0),n=0;n=128&&qr("not-basic"),h.push(e.charCodeAt(n));for(s=t>0?t+1:0;s=f&&qr("invalid-input"),((c=(p=e.charCodeAt(s++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:Cr)>=Cr||c>wr((vr-d)/i))&&qr("overflow"),d+=c*i,!(c<(l=a<=g?1:a>=g+26?26:a-g));a+=Cr)i>wr(vr/(u=Cr-l))&&qr("overflow"),i*=u;g=Ir(d-o,r=h.length+1,0==o),wr(d/r)>vr-m&&qr("overflow"),m+=wr(d/r),d%=r,h.splice(d++,0,m)}return zr(h)}function Rr(e){var r,t,n,s,o,i,a,c,l,u,p,h,f,d,m,g=[];for(h=(e=Lr(e)).length,r=128,t=0,o=72,i=0;i=r&&pwr((vr-t)/(f=n+1))&&qr("overflow"),t+=(a-r)*f,r=a,i=0;ivr&&qr("overflow"),p==r){for(c=t,l=Cr;!(c<(u=l<=o?1:l>=o+26?26:l-o));l+=Cr)m=c-u,d=Cr-u,g.push(Er(Tr(u+m%d,0))),c=wr(m/d);g.push(Er(Tr(c,0))),o=Ir(t,f,n==s),t=0,++n}++t,++r}return g.join("")}function Br(e){return Fr(e,(function(e){return yr.test(e)?Mr(e.slice(4).toLowerCase()):e}))}function Nr(e){return Fr(e,(function(e){return Ar.test(e)?"xn--"+Rr(e):e}))}var Or="1.4.1",Pr={decode:Lr,encode:zr},jr={version:Or,ucs2:Pr,toASCII:Nr,toUnicode:Br,encode:Rr,decode:Mr},Ur=e(Object.freeze({__proto__:null,decode:Mr,encode:Rr,toUnicode:Br,toASCII:Nr,version:Or,ucs2:Pr,default:jr})),Vr={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},Zr=/^(vbscript|javascript|file|data):/,Gr=/^data:image\/(gif|png|jpeg|webp);/;function $r(e){var r=e.trim().toLowerCase();return!Zr.test(r)||!!Gr.test(r)}var Hr=["http:","https:","mailto:"];function Jr(e){var r=C.parse(e,!0);if(r.hostname&&(!r.protocol||Hr.indexOf(r.protocol)>=0))try{r.hostname=Ur.toASCII(r.hostname)}catch(e){}return C.encode(C.format(r))}function Wr(e){var r=C.parse(e,!0);if(r.hostname&&(!r.protocol||Hr.indexOf(r.protocol)>=0))try{r.hostname=Ur.toUnicode(r.hostname)}catch(e){}return C.decode(C.format(r),C.decode.defaultChars+"%")}function Yr(e,r){if(!(this instanceof Yr))return new Yr(e,r);r||w.isString(e)||(r=e||{},e="default"),this.inline=new ar,this.block=new Fe,this.core=new ce,this.renderer=new M,this.linkify=new kr,this.validateLink=$r,this.normalizeLink=Jr,this.normalizeLinkText=Wr,this.utils=w,this.helpers=w.assign({},S),this.options={},this.configure(e),r&&this.set(r)}return Yr.prototype.set=function(e){return w.assign(this.options,e),this},Yr.prototype.configure=function(e){var r,t=this;if(w.isString(e)&&!(e=Vr[r=e]))throw new Error('Wrong `markdown-it` preset "'+r+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach((function(r){e.components[r].rules&&t[r].ruler.enableOnly(e.components[r].rules),e.components[r].rules2&&t[r].ruler2.enableOnly(e.components[r].rules2)})),this},Yr.prototype.enable=function(e,r){var t=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(r){t=t.concat(this[r].ruler.enable(e,!0))}),this),t=t.concat(this.inline.ruler2.enable(e,!0));var n=e.filter((function(e){return t.indexOf(e)<0}));if(n.length&&!r)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},Yr.prototype.disable=function(e,r){var t=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(r){t=t.concat(this[r].ruler.disable(e,!0))}),this),t=t.concat(this.inline.ruler2.disable(e,!0));var n=e.filter((function(e){return t.indexOf(e)<0}));if(n.length&&!r)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},Yr.prototype.use=function(e){var r=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,r),this},Yr.prototype.parse=function(e,r){if("string"!=typeof e)throw new Error("Input data should be a String");var t=new this.core.State(e,this,r);return this.core.process(t),t.tokens},Yr.prototype.render=function(e,r){return r=r||{},this.renderer.render(this.parse(e,r),this.options,r)},Yr.prototype.parseInline=function(e,r){var t=new this.core.State(e,this,r);return t.inlineMode=!0,this.core.process(t),t.tokens},Yr.prototype.renderInline=function(e,r){return r=r||{},this.renderer.render(this.parseInline(e,r),this.options,r)},Yr})); \ No newline at end of file diff --git a/dep/prism.min.js b/dep/prism.min.js deleted file mode 100644 index e027665..0000000 --- a/dep/prism.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * PrismJS 1.25.0 - * @licence MIT - * @source https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+powershell+regex - */ -var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,e={},M={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof W?new W(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=l.reach);y+=m.value.length,m=m.next){var b=m.value;if(t.length>n.length)return;if(!(b instanceof W)){var k,x=1;if(h){if(!(k=z(v,y,n,f)))break;var w=k.index,A=k.index+k[0].length,P=y;for(P+=m.value.length;P<=w;)m=m.next,P+=m.value.length;if(P-=m.value.length,y=P,m.value instanceof W)continue;for(var E=m;E!==t.tail&&(Pl.reach&&(l.reach=N);var j=m.prev;O&&(j=I(t,j,O),y+=O.length),q(t,j,x);var C=new W(o,g?M.tokenize(S,g):S,d,S);if(m=I(t,j,C),L&&I(t,m,L),1l.reach&&(l.reach=_.reach)}}}}}}(e,a,n,a.head,0),function(e){var n=[],t=e.head.next;for(;t!==e.tail;)n.push(t.value),t=t.next;return n}(a)},hooks:{all:{},add:function(e,n){var t=M.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=M.hooks.all[e];if(t&&t.length)for(var r,a=0;r=t[a++];)r(n)}},Token:W};function W(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=0|(r||"").length}function z(e,n,t,r){e.lastIndex=n;var a=e.exec(t);if(a&&r&&a[1]){var i=a[1].length;a.index+=i,a[0]=a[0].slice(i)}return a}function i(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function I(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function q(e,n,t){for(var r=n.next,a=0;a"+a.content+""},!u.document)return u.addEventListener&&(M.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,r=n.code,a=n.immediateClose;u.postMessage(M.highlight(r,M.languages[t],t)),a&&u.close()},!1)),M;var t=M.util.currentScript();function r(){M.manual||M.highlightAll()}if(t&&(M.filename=t.src,t.hasAttribute("data-manual")&&(M.manual=!0)),!M.manual){var a=document.readyState;"loading"===a||"interactive"===a&&t&&t.defer?document.addEventListener("DOMContentLoaded",r):window.requestAnimationFrame?window.requestAnimationFrame(r):window.setTimeout(r,16)}return M}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); -Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,function(){return a}),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml; -!function(s){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(Prism); -Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}; -Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),Prism.languages.js=Prism.languages.javascript; -!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=a.variable[1].inside,o=0;o/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:{function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:{}}}},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:true|false)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(\W?)(?:!|-(?:eq|ne|gt|ge|lt|le|sh[lr]|not|b?(?:and|x?or)|(?:Not)?(?:Like|Match|Contains|In)|Replace|Join|is(?:Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/},r=i.string[0].inside;r.boolean=i.boolean,r.variable=i.variable,r.function.inside=i}(); -!function(a){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|c[a-zA-Z]|0[0-7]{0,2}|[123][0-7]{2}|.)/,t="(?:[^\\\\-]|"+n.source+")",s=RegExp(t+"-"+t),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={charset:{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"charset-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"charset-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,charclass:{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,charclass:{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]| t.join('-'), - s = (t) => { - switch (t[0]) { - case 'data': - return `attr(${n(t)})`; - case 'attr': - case 'counter': - return `${t[0]}(${n(t.slice(1))})`; - case 'var': - return `var(--${n(t)})`; - case void 0: - return 'attr(data-content)'; - default: - return JSON.stringify(n(t)); - } - }, - i = (t, { theme: r }) => { - let e = Array.isArray(t) ? n(t) : t; - return { - content: - (e && r('content', [e], '')) || (c.has(e) && e) || (Array.isArray(t) ? s(t) : e), - }; - }, - u = (t, r) => (Array.isArray(t) ? i(t, r) : o(i, t)); -export { u as content }; diff --git a/dep/twind-css.mjs b/dep/twind-css.mjs deleted file mode 100644 index f337731..0000000 --- a/dep/twind-css.mjs +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Twind v0.16.16 - * @license MIT - * @source https://unpkg.com/twind@0.16.16/css/css.js?module - */ - -// src/css/index.ts -import { apply, hash, directive } from "./twind.mjs"; - -// src/internal/util.ts -var includes = (value, search) => !!~value.indexOf(search); -var join = (parts, separator = "-") => parts.join(separator); -var hyphenate = value => value.replace(/[A-Z]/g, "-$&").toLowerCase(); -var evalThunk = (value, context) => { - while (typeof value == "function") { - value = value(context); - } - return value; -}; -var isCSSProperty = (key, value) => !includes("@:&", key[0]) && (includes("rg", (typeof value)[5]) || Array.isArray(value)); -var merge = (target, source, context) => source ? Object.keys(source).reduce((target2, key) => { - const value = evalThunk(source[key], context); - if (isCSSProperty(key, value)) { - target2[hyphenate(key)] = value; - } else { - target2[key] = key[0] == "@" && includes("figa", key[1]) ? (target2[key] || []).concat(value) : merge(target2[key] || {}, value, context); - } - return target2; -}, target) : target; -var escape = typeof CSS !== "undefined" && CSS.escape || (className => className.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g, "\\$&").replace(/^\d/, "\\3$& ")); -var buildMediaQuery = screen2 => { - if (!Array.isArray(screen2)) { - screen2 = [screen2]; - } - return "@media " + join(screen2.map(screen3 => { - if (typeof screen3 == "string") { - screen3 = { min: screen3 }; - } - return screen3.raw || join(Object.keys(screen3).map(feature => `(${feature}-width:${screen3[feature]})`), " and "); - }), ","); -}; - -// src/css/index.ts -var translate = (tokens, context) => { - const collect = (target, token) => Array.isArray(token) ? token.reduce(collect, target) : merge(target, evalThunk(token, context), context); - return tokens.reduce(collect, {}); -}; -var newRule = /\s*(?:([\w-%@]+)\s*:?\s*([^{;]+?)\s*(?:;|$|})|([^;}{]*?)\s*{)|(})/gi; -var ruleClean = /\/\*[\s\S]*?\*\/|\s+|\n/gm; -var decorate = (selectors, currentBlock) => selectors.reduceRight((rules, selector) => ({ [selector]: rules }), currentBlock); -var saveBlock = (rules, selectors, currentBlock) => { - if (currentBlock) { - rules.push(decorate(selectors, currentBlock)); - } -}; -var interleave = (strings, interpolations, context) => { - let buffer = strings[0]; - const result = []; - for (let index = 0; index < interpolations.length;) { - const interpolation = evalThunk(interpolations[index], context); - if (interpolation && typeof interpolation == "object") { - result.push(buffer, interpolation); - buffer = strings[++index]; - } else { - buffer += (interpolation || "") + strings[++index]; - } - } - result.push(buffer); - return result; -}; -var astish = (values, context) => { - const selectors = []; - const rules = []; - let currentBlock; - let match; - for (let index = 0; index < values.length; index++) { - const value = values[index]; - if (typeof value == "string") { - while (match = newRule.exec(value.replace(ruleClean, " "))) { - if (!match[0]) - continue; - if (match[4]) { - currentBlock = saveBlock(rules, selectors, currentBlock); - selectors.pop(); - } - if (match[3]) { - currentBlock = saveBlock(rules, selectors, currentBlock); - selectors.push(match[3]); - } else if (!match[4]) { - if (!currentBlock) - currentBlock = {}; - const value2 = match[2] && /\S/.test(match[2]) ? match[2] : values[++index]; - if (value2) { - if (match[1] == "@apply") { - merge(currentBlock, evalThunk(apply(value2), context), context); - } else { - currentBlock[match[1]] = value2; - } - } - } - } - } else { - currentBlock = saveBlock(rules, selectors, currentBlock); - rules.push(decorate(selectors, value)); - } - } - saveBlock(rules, selectors, currentBlock); - return rules; -}; -var cssFactory = (tokens, context) => translate(Array.isArray(tokens[0]) && Array.isArray(tokens[0].raw) ? astish(interleave(tokens[0], tokens.slice(1), context), context) : tokens, context); -var css = (...tokens) => directive(cssFactory, tokens); -var keyframesFactory = (tokens, context) => { - const waypoints = cssFactory(tokens, context); - const id = hash(JSON.stringify(waypoints)); - context.tw(() => ({ [`@keyframes ${id}`]: waypoints })); - return id; -}; -var keyframes = (...tokens) => directive(keyframesFactory, tokens); -var animation = (value, waypoints) => waypoints === void 0 ? (...args) => animation(value, keyframes(...args)) : css({ - ...(value && typeof value == "object" ? value : { animation: value }), - animationName: typeof waypoints == "function" ? waypoints : keyframes(waypoints) }); - -var screenFactory = ({ size, rules }, context) => { - const media = buildMediaQuery(context.theme("screens", size)); - return rules === void 0 ? media : { - [media]: typeof rules == "function" ? evalThunk(rules, context) : cssFactory([rules], context) }; - -}; -var screen = (size, rules) => directive(screenFactory, { size, rules }); -export { -animation, -css, -keyframes, -screen }; \ No newline at end of file diff --git a/dep/twind.mjs b/dep/twind.mjs deleted file mode 100644 index 6d0ad35..0000000 --- a/dep/twind.mjs +++ /dev/null @@ -1,2402 +0,0 @@ -/** - * Twind v0.16.16 - * @license MIT - * @source https://unpkg.com/twind@0.16.16/twind.js?module - */ - -// src/internal/util.ts -var includes = (value, search) => !!~value.indexOf(search); -var join = (parts, separator = '-') => parts.join(separator); -var joinTruthy = (parts, separator) => join(parts.filter(Boolean), separator); -var tail = (array, startIndex = 1) => array.slice(startIndex); -var identity = (value) => value; -var noop = () => {}; -var capitalize = (value) => value[0].toUpperCase() + tail(value); -var hyphenate = (value) => value.replace(/[A-Z]/g, '-$&').toLowerCase(); -var evalThunk = (value, context) => { - while (typeof value == 'function') { - value = value(context); - } - return value; -}; -var ensureMaxSize = (map, max) => { - if (map.size > max) { - map.delete(map.keys().next().value); - } -}; -var isCSSProperty = (key, value) => - !includes('@:&', key[0]) && (includes('rg', (typeof value)[5]) || Array.isArray(value)); -var merge = (target, source, context) => - source - ? Object.keys(source).reduce((target2, key) => { - const value = evalThunk(source[key], context); - if (isCSSProperty(key, value)) { - target2[hyphenate(key)] = value; - } else { - target2[key] = - key[0] == '@' && includes('figa', key[1]) - ? (target2[key] || []).concat(value) - : merge(target2[key] || {}, value, context); - } - return target2; - }, target) - : target; -var escape = - (typeof CSS !== 'undefined' && CSS.escape) || - ((className) => - className.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g, '\\$&').replace(/^\d/, '\\3$& ')); -var buildMediaQuery = (screen) => { - if (!Array.isArray(screen)) { - screen = [screen]; - } - return ( - '@media ' + - join( - screen.map((screen2) => { - if (typeof screen2 == 'string') { - screen2 = { min: screen2 }; - } - return ( - screen2.raw || - join( - Object.keys(screen2).map((feature) => `(${feature}-width:${screen2[feature]})`), - ' and ' - ) - ); - }), - ',' - ) - ); -}; -var cyrb32 = (value) => { - for (var h = 9, index = value.length; index--; ) { - h = Math.imul(h ^ value.charCodeAt(index), 1597334677); - } - return 'tw-' + ((h ^ (h >>> 9)) >>> 0).toString(36); -}; -var sortedInsertionIndex = (array, element) => { - for (var low = 0, high = array.length; low < high; ) { - const pivot = (high + low) >> 1; - if (array[pivot] <= element) { - low = pivot + 1; - } else { - high = pivot; - } - } - return high; -}; - -// src/twind/parse.ts -var groupings; -var rules; -var startGrouping = (value = '') => { - groupings.push(value); - return ''; -}; -var endGrouping = (isWhitespace) => { - groupings.length = Math.max(groupings.lastIndexOf('') + ~~isWhitespace, 0); -}; -var onlyPrefixes = (s) => s && !includes('!:', s[0]); -var onlyVariants = (s) => s[0] == ':'; -var addRule = (directive2, negate) => { - rules.push({ - v: groupings.filter(onlyVariants), - d: directive2, - n: negate, - i: includes(groupings, '!'), - $: '', - }); -}; -var saveRule = (buffer) => { - const negate = buffer[0] == '-'; - if (negate) { - buffer = tail(buffer); - } - const prefix = join(groupings.filter(onlyPrefixes)); - addRule(buffer == '&' ? prefix : (prefix && prefix + '-') + buffer, negate); - return ''; -}; -var parseString = (token, isVariant) => { - let buffer = ''; - for (let char, dynamic = false, position2 = 0; (char = token[position2++]); ) { - if (dynamic || char == '[') { - buffer += char; - dynamic = char != ']'; - continue; - } - switch (char) { - case ':': - buffer = - buffer && - startGrouping(':' + (token[position2] == char ? token[position2++] : '') + buffer); - break; - case '(': - buffer = buffer && startGrouping(buffer); - startGrouping(); - break; - case '!': - startGrouping(char); - break; - case ')': - case ' ': - case ' ': - case '\n': - case '\r': - buffer = buffer && saveRule(buffer); - endGrouping(char !== ')'); - break; - default: - buffer += char; - } - } - if (buffer) { - if (isVariant) { - startGrouping(':' + buffer); - } else if (buffer.slice(-1) == '-') { - startGrouping(buffer.slice(0, -1)); - } else { - saveRule(buffer); - } - } -}; -var parseGroupedToken = (token) => { - startGrouping(); - parseToken(token); - endGrouping(); -}; -var parseGroup = (key, token) => { - if (token) { - startGrouping(); - const isVariant = includes('tbu', (typeof token)[1]); - parseString(key, isVariant); - if (isVariant) { - parseGroupedToken(token); - } - endGrouping(); - } -}; -var parseToken = (token) => { - switch (typeof token) { - case 'string': - parseString(token); - break; - case 'function': - addRule(token); - break; - case 'object': - if (Array.isArray(token)) { - token.forEach(parseGroupedToken); - } else if (token) { - Object.keys(token).forEach((key) => { - parseGroup(key, token[key]); - }); - } - } -}; -var staticsCaches = new WeakMap(); -var buildStatics = (strings) => { - let statics = staticsCaches.get(strings); - if (!statics) { - let slowModeIndex = NaN; - let buffer = ''; - statics = strings.map((token, index) => { - if ( - slowModeIndex !== slowModeIndex && - (token.slice(-1) == '[' || includes(':-(', (strings[index + 1] || '')[0])) - ) { - slowModeIndex = index; - } - if (index >= slowModeIndex) { - return (interpolation) => { - if (index == slowModeIndex) { - buffer = ''; - } - buffer += token; - if (includes('rg', (typeof interpolation)[5])) { - buffer += interpolation; - } else if (interpolation) { - parseString(buffer); - buffer = ''; - parseToken(interpolation); - } - if (index == strings.length - 1) { - parseString(buffer); - } - }; - } - const staticRules = (rules = []); - parseString(token); - const activeGroupings = [...groupings]; - rules = []; - return (interpolation) => { - rules.push(...staticRules); - groupings = [...activeGroupings]; - if (interpolation) { - parseToken(interpolation); - } - }; - }); - staticsCaches.set(strings, statics); - } - return statics; -}; -var parse = (tokens) => { - groupings = []; - rules = []; - if (Array.isArray(tokens[0]) && Array.isArray(tokens[0].raw)) { - buildStatics(tokens[0]).forEach((apply2, index) => apply2(tokens[index + 1])); - } else { - parseToken(tokens); - } - return rules; -}; - -// src/twind/directive.ts -var isFunctionFree; -var detectFunction = (key, value) => { - if (typeof value == 'function') { - isFunctionFree = false; - } - return value; -}; -var stringify = (data) => { - isFunctionFree = true; - const key = JSON.stringify(data, detectFunction); - return isFunctionFree && key; -}; -var cacheByFactory = new WeakMap(); -var directive = (factory, data) => { - const key = stringify(data); - let directive2; - if (key) { - var cache = cacheByFactory.get(factory); - if (!cache) { - cacheByFactory.set(factory, (cache = new Map())); - } - directive2 = cache.get(key); - } - if (!directive2) { - directive2 = Object.defineProperty( - (params, context) => { - context = Array.isArray(params) ? context : params; - return evalThunk(factory(data, context), context); - }, - 'toJSON', - { - value: () => key || data, - } - ); - - if (cache) { - cache.set(key, directive2); - ensureMaxSize(cache, 1e4); - } - } - return directive2; -}; - -// src/twind/apply.ts -var applyFactory = (tokens, { css }) => css(parse(tokens)); -var apply = (...tokens) => directive(applyFactory, tokens); - -// src/twind/helpers.ts -var positions = (resolve) => (value, position2, prefix, suffix) => { - if (value) { - const properties = position2 && resolve(position2); - if (properties && properties.length > 0) { - return properties.reduce((declarations, property2) => { - declarations[joinTruthy([prefix, property2, suffix])] = value; - return declarations; - }, {}); - } - } -}; -var corners = /* @__PURE__ */ positions( - (key) => - ({ - t: ['top-left', 'top-right'], - r: ['top-right', 'bottom-right'], - b: ['bottom-left', 'bottom-right'], - l: ['bottom-left', 'top-left'], - tl: ['top-left'], - tr: ['top-right'], - bl: ['bottom-left'], - br: ['bottom-right'], - }[key]) -); -var expandEdges = (key) => { - const parts = ({ x: 'lr', y: 'tb' }[key] || key || '').split('').sort(); - for (let index = parts.length; index--; ) { - if ( - !(parts[index] = { - t: 'top', - r: 'right', - b: 'bottom', - l: 'left', - }[parts[index]]) - ) - return; - } - if (parts.length) return parts; -}; -var edges = /* @__PURE__ */ positions(expandEdges); - -// src/twind/plugins.ts -var _; -var __; -var $; -var toColumnsOrRows = (x) => (x == 'cols' ? 'columns' : 'rows'); -var property = (property2) => (params, context, id) => ({ - [property2]: id + ((_ = join(params)) && '-' + _), -}); - -var propertyValue = (property2, separator) => (params, context, id) => - (_ = join(params, separator)) && { - [property2 || id]: _, - }; - -var themeProperty = - (section) => - (params, { theme: theme2 }, id) => - (_ = theme2(section || id, params)) && { - [section || id]: _, - }; - -var themePropertyFallback = - (section, separator) => - (params, { theme: theme2 }, id) => - (_ = theme2(section || id, params, join(params, separator))) && { - [section || id]: _, - }; - -var alias = (handler, name) => (params, context) => handler(params, context, name); -var display = property('display'); -var position = property('position'); -var textTransform = property('textTransform'); -var textDecoration = property('textDecoration'); -var fontStyle = property('fontStyle'); -var fontVariantNumeric = (key) => (params, context, id) => ({ - ['--tw-' + key]: id, - fontVariantNumeric: - 'var(--tw-ordinal,/*!*/ /*!*/) var(--tw-slashed-zero,/*!*/ /*!*/) var(--tw-numeric-figure,/*!*/ /*!*/) var(--tw-numeric-spacing,/*!*/ /*!*/) var(--tw-numeric-fraction,/*!*/ /*!*/)', -}); - -var inset = (params, { theme: theme2 }, id) => (_ = theme2('inset', params)) && { [id]: _ }; -var opacityProperty = (params, theme2, id, section = id) => - (_ = theme2(section + 'Opacity', tail(params))) && { - [`--tw-${id}-opacity`]: _, - }; - -var parseColorComponent = (chars, factor) => Math.round(parseInt(chars, 16) * factor); -var asRGBA = (color, opacityProperty2, opacityDefault) => { - if ( - color && - color[0] == '#' && - (_ = (color.length - 1) / 3) && - ($ = [17, 1, 0.062272][_ - 1]) - ) { - return `rgba(${parseColorComponent(color.substr(1, _), $)},${parseColorComponent( - color.substr(1 + _, _), - $ - )},${parseColorComponent(color.substr(1 + 2 * _, _), $)},${ - opacityProperty2 - ? `var(--tw-${opacityProperty2}${opacityDefault ? ',' + opacityDefault : ''})` - : opacityDefault || 1 - })`; - } - return color; -}; -var withOpacityFallback = (property2, kind, color) => - color && typeof color == 'string' - ? (_ = asRGBA(color, kind + '-opacity')) && _ !== color - ? { - [`--tw-${kind}-opacity`]: '1', - [property2]: [color, _], - } - : { [property2]: color } - : void 0; -var transparentTo = (color) => (($ = asRGBA(color, '', '0')) == _ ? 'transparent' : $); -var reversableEdge = (params, { theme: theme2 }, id, section, prefix, suffix) => - (_ = { x: ['right', 'left'], y: ['bottom', 'top'] }[params[0]]) && - ($ = `--tw-${id}-${params[0]}-reverse`) - ? params[1] == 'reverse' - ? { - [$]: '1', - } - : { - [$]: '0', - [joinTruthy([prefix, _[0], suffix])]: - (__ = theme2(section, tail(params))) && `calc(${__} * var(${$}))`, - [joinTruthy([prefix, _[1], suffix])]: __ && [ - __, - `calc(${__} * calc(1 - var(${$})))`, - ], - } - : void 0; -var placeHelper = (property2, params) => - params[0] && { - [property2]: (includes('wun', (params[0] || '')[3]) ? 'space-' : '') + params[0], - }; - -var contentPluginFor = (property2) => (params) => - includes(['start', 'end'], params[0]) - ? { [property2]: 'flex-' + params[0] } - : placeHelper(property2, params); -var gridPlugin = - (kind) => - (params, { theme: theme2 }) => { - if ((_ = theme2('grid' + capitalize(kind), params, ''))) { - return { ['grid-' + kind]: _ }; - } - switch (params[0]) { - case 'span': - return ( - params[1] && { - ['grid-' + kind]: `span ${params[1]} / span ${params[1]}`, - } - ); - - case 'start': - case 'end': - return ( - (_ = theme2( - 'grid' + capitalize(kind) + capitalize(params[0]), - tail(params), - join(tail(params)) - )) && { - [`grid-${kind}-${params[0]}`]: _, - } - ); - } - }; -var border = (params, { theme: theme2 }, id) => { - switch (params[0]) { - case 'solid': - case 'dashed': - case 'dotted': - case 'double': - case 'none': - return propertyValue('borderStyle')(params); - case 'collapse': - case 'separate': - return propertyValue('borderCollapse')(params); - case 'opacity': - return opacityProperty(params, theme2, id); - } - - return (_ = theme2(id + 'Width', params, '')) - ? { borderWidth: _ } - : withOpacityFallback('borderColor', id, theme2(id + 'Color', params)); -}; -var transform = (gpu) => - (gpu - ? 'translate3d(var(--tw-translate-x,0),var(--tw-translate-y,0),0)' - : 'translateX(var(--tw-translate-x,0)) translateY(var(--tw-translate-y,0))') + - ' rotate(var(--tw-rotate,0)) skewX(var(--tw-skew-x,0)) skewY(var(--tw-skew-y,0)) scaleX(var(--tw-scale-x,1)) scaleY(var(--tw-scale-y,1))'; -var transformXYFunction = (params, context, id) => - params[0] && - (_ = context.theme(id, params[1] || params[0])) && { - [`--tw-${id}-x`]: params[0] !== 'y' && _, - [`--tw-${id}-y`]: params[0] !== 'x' && _, - transform: [`${id}${params[1] ? params[0].toUpperCase() : ''}(${_})`, transform()], - }; - -var edgesPluginFor = (key) => (params, context, id) => - id[1] - ? edges(context.theme(key, params), id[1], key) - : themeProperty(key)(params, context, id); -var padding = edgesPluginFor('padding'); -var margin = edgesPluginFor('margin'); -var minMax = (params, { theme: theme2 }, id) => - (_ = { w: 'width', h: 'height' }[params[0]]) && { - [(_ = `${id}${capitalize(_)}`)]: theme2(_, tail(params)), - }; - -var filter = (params, { theme: theme2 }, id) => { - const parts = id.split('-'); - const prefix = parts[0] == 'backdrop' ? parts[0] + '-' : ''; - if (!prefix) { - params.unshift(...parts); - } - if (params[0] == 'filter') { - const filters = [ - 'blur', - 'brightness', - 'contrast', - 'grayscale', - 'hue-rotate', - 'invert', - prefix && 'opacity', - 'saturate', - 'sepia', - !prefix && 'drop-shadow', - ].filter(Boolean); - return params[1] == 'none' - ? { [prefix + 'filter']: 'none' } - : filters.reduce( - (css, key) => { - css['--tw-' + prefix + key] = 'var(--tw-empty,/*!*/ /*!*/)'; - return css; - }, - { - [prefix + 'filter']: filters.map((key) => `var(--tw-${prefix}${key})`).join(' '), - } - ); - } - $ = params.shift(); - if (includes(['hue', 'drop'], $)) $ += capitalize(params.shift()); - return ( - (_ = theme2(prefix ? 'backdrop' + capitalize($) : $, params)) && { - ['--tw-' + prefix + $]: (Array.isArray(_) ? _ : [_]) - .map((_4) => `${hyphenate($)}(${_4})`) - .join(' '), - } - ); -}; -var corePlugins = { - group: (params, { tag }, id) => tag(join([id, ...params])), - hidden: alias(display, 'none'), - inline: display, - block: display, - contents: display, - flow: display, - table: (params, context, id) => - includes(['auto', 'fixed'], params[0]) - ? { tableLayout: params[0] } - : display(params, context, id), - flex(params, context, id) { - switch (params[0]) { - case 'row': - case 'col': - return { - flexDirection: join(params[0] == 'col' ? ['column', ...tail(params)] : params), - }; - - case 'nowrap': - case 'wrap': - return { flexWrap: join(params) }; - case 'grow': - case 'shrink': - _ = context.theme('flex' + capitalize(params[0]), tail(params), params[1] || 1); - return ( - _ != null && { - ['flex-' + params[0]]: '' + _, - } - ); - } - - return (_ = context.theme('flex', params, '')) - ? { flex: _ } - : display(params, context, id); - }, - grid(params, context, id) { - switch (params[0]) { - case 'cols': - case 'rows': - return ( - (_ = context.theme( - 'gridTemplate' + capitalize(toColumnsOrRows(params[0])), - tail(params), - params.length == 2 && Number(params[1]) - ? `repeat(${params[1]},minmax(0,1fr))` - : join(tail(params)) - )) && { - ['gridTemplate-' + toColumnsOrRows(params[0])]: _, - } - ); - - case 'flow': - return ( - params.length > 1 && { - gridAutoFlow: join( - params[1] == 'col' ? ['column', ...tail(params, 2)] : tail(params), - ' ' - ), - } - ); - } - - return display(params, context, id); - }, - auto: (params, { theme: theme2 }) => - includes(['cols', 'rows'], params[0]) && - (_ = theme2( - 'gridAuto' + capitalize(toColumnsOrRows(params[0])), - tail(params), - join(tail(params)) - )) && { - ['gridAuto-' + toColumnsOrRows(params[0])]: _, - }, - - static: position, - fixed: position, - absolute: position, - relative: position, - sticky: position, - visible: { visibility: 'visible' }, - invisible: { visibility: 'hidden' }, - antialiased: { - WebkitFontSmoothing: 'antialiased', - MozOsxFontSmoothing: 'grayscale', - }, - - 'subpixel-antialiased': { - WebkitFontSmoothing: 'auto', - MozOsxFontSmoothing: 'auto', - }, - - truncate: { - overflow: 'hidden', - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - }, - - 'sr-only': { - position: 'absolute', - width: '1px', - height: '1px', - padding: '0', - margin: '-1px', - overflow: 'hidden', - whiteSpace: 'nowrap', - clip: 'rect(0,0,0,0)', - borderWidth: '0', - }, - - 'not-sr-only': { - position: 'static', - width: 'auto', - height: 'auto', - padding: '0', - margin: '0', - overflow: 'visible', - whiteSpace: 'normal', - clip: 'auto', - }, - - resize: (params) => ({ - resize: { x: 'horizontal', y: 'vertical' }[params[0]] || params[0] || 'both', - }), - - box: (params) => params[0] && { boxSizing: params[0] + '-box' }, - appearance: propertyValue(), - cursor: themePropertyFallback(), - float: propertyValue(), - clear: propertyValue(), - decoration: propertyValue('boxDecorationBreak'), - isolate: { isolation: 'isolate' }, - isolation: propertyValue(), - 'mix-blend': propertyValue('mixBlendMode'), - top: inset, - right: inset, - bottom: inset, - left: inset, - inset: (params, { theme: theme2 }) => - (_ = expandEdges(params[0])) - ? edges(theme2('inset', tail(params)), params[0]) - : (_ = theme2('inset', params)) && { - top: _, - right: _, - bottom: _, - left: _, - }, - - underline: textDecoration, - 'line-through': textDecoration, - 'no-underline': alias(textDecoration, 'none'), - 'text-underline': alias(textDecoration, 'underline'), - 'text-no-underline': alias(textDecoration, 'none'), - 'text-line-through': alias(textDecoration, 'line-through'), - uppercase: textTransform, - lowercase: textTransform, - capitalize: textTransform, - 'normal-case': alias(textTransform, 'none'), - 'text-normal-case': alias(textTransform, 'none'), - italic: fontStyle, - 'not-italic': alias(fontStyle, 'normal'), - 'font-italic': alias(fontStyle, 'italic'), - 'font-not-italic': alias(fontStyle, 'normal'), - font: (params, context, id) => - (_ = context.theme('fontFamily', params, '')) - ? { fontFamily: _ } - : themeProperty('fontWeight')(params, context, id), - items: (params) => - params[0] && { - alignItems: includes(['start', 'end'], params[0]) ? 'flex-' + params[0] : join(params), - }, - - 'justify-self': propertyValue(), - 'justify-items': propertyValue(), - justify: contentPluginFor('justifyContent'), - content: contentPluginFor('alignContent'), - self: contentPluginFor('alignSelf'), - place: (params) => params[0] && placeHelper('place-' + params[0], tail(params)), - overscroll: (params) => - params[0] && { - ['overscrollBehavior' + (params[1] ? '-' + params[0] : '')]: params[1] || params[0], - }, - - col: gridPlugin('column'), - row: gridPlugin('row'), - duration: themeProperty('transitionDuration'), - delay: themeProperty('transitionDelay'), - tracking: themeProperty('letterSpacing'), - leading: themeProperty('lineHeight'), - z: themeProperty('zIndex'), - opacity: themeProperty(), - ease: themeProperty('transitionTimingFunction'), - p: padding, - py: padding, - px: padding, - pt: padding, - pr: padding, - pb: padding, - pl: padding, - m: margin, - my: margin, - mx: margin, - mt: margin, - mr: margin, - mb: margin, - ml: margin, - w: themeProperty('width'), - h: themeProperty('height'), - min: minMax, - max: minMax, - fill: themeProperty(), - order: themeProperty(), - origin: themePropertyFallback('transformOrigin', ' '), - select: propertyValue('userSelect'), - 'pointer-events': propertyValue(), - align: propertyValue('verticalAlign'), - whitespace: propertyValue('whiteSpace'), - 'normal-nums': { fontVariantNumeric: 'normal' }, - ordinal: fontVariantNumeric('ordinal'), - 'slashed-zero': fontVariantNumeric('slashed-zero'), - 'lining-nums': fontVariantNumeric('numeric-figure'), - 'oldstyle-nums': fontVariantNumeric('numeric-figure'), - 'proportional-nums': fontVariantNumeric('numeric-spacing'), - 'tabular-nums': fontVariantNumeric('numeric-spacing'), - 'diagonal-fractions': fontVariantNumeric('numeric-fraction'), - 'stacked-fractions': fontVariantNumeric('numeric-fraction'), - overflow: (params, context, id) => - includes(['ellipsis', 'clip'], params[0]) - ? propertyValue('textOverflow')(params) - : params[1] - ? { ['overflow-' + params[0]]: params[1] } - : propertyValue()(params, context, id), - transform: (params) => - params[0] == 'none' - ? { transform: 'none' } - : { - '--tw-translate-x': '0', - '--tw-translate-y': '0', - '--tw-rotate': '0', - '--tw-skew-x': '0', - '--tw-skew-y': '0', - '--tw-scale-x': '1', - '--tw-scale-y': '1', - transform: transform(params[0] == 'gpu'), - }, - - rotate: (params, { theme: theme2 }) => - (_ = theme2('rotate', params)) && { - '--tw-rotate': _, - transform: [`rotate(${_})`, transform()], - }, - - scale: transformXYFunction, - translate: transformXYFunction, - skew: transformXYFunction, - gap: (params, context, id) => - (_ = { x: 'column', y: 'row' }[params[0]]) - ? { [_ + 'Gap']: context.theme('gap', tail(params)) } - : themeProperty('gap')(params, context, id), - stroke: (params, context, id) => - (_ = context.theme('stroke', params, '')) - ? { stroke: _ } - : themeProperty('strokeWidth')(params, context, id), - outline: (params, { theme: theme2 }) => - (_ = theme2('outline', params)) && { - outline: _[0], - outlineOffset: _[1], - }, - - 'break-normal': { - wordBreak: 'normal', - overflowWrap: 'normal', - }, - - 'break-words': { overflowWrap: 'break-word' }, - 'break-all': { wordBreak: 'break-all' }, - text(params, { theme: theme2 }, id) { - switch (params[0]) { - case 'left': - case 'center': - case 'right': - case 'justify': - return { textAlign: params[0] }; - case 'uppercase': - case 'lowercase': - case 'capitalize': - return textTransform([], _, params[0]); - case 'opacity': - return opacityProperty(params, theme2, id); - } - - const fontSize = theme2('fontSize', params, ''); - if (fontSize) { - return typeof fontSize == 'string' - ? { fontSize } - : { - fontSize: fontSize[0], - ...(typeof fontSize[1] == 'string' ? { lineHeight: fontSize[1] } : fontSize[1]), - }; - } - return withOpacityFallback('color', 'text', theme2('textColor', params)); - }, - bg(params, { theme: theme2 }, id) { - switch (params[0]) { - case 'fixed': - case 'local': - case 'scroll': - return propertyValue('backgroundAttachment', ',')(params); - case 'bottom': - case 'center': - case 'left': - case 'right': - case 'top': - return propertyValue('backgroundPosition', ' ')(params); - case 'no': - return params[1] == 'repeat' && propertyValue('backgroundRepeat')(params); - case 'repeat': - return includes('xy', params[1]) - ? propertyValue('backgroundRepeat')(params) - : { backgroundRepeat: params[1] || params[0] }; - case 'opacity': - return opacityProperty(params, theme2, id, 'background'); - case 'clip': - case 'origin': - return ( - params[1] && { - ['background-' + params[0]]: params[1] + (params[1] == 'text' ? '' : '-box'), - } - ); - - case 'blend': - return propertyValue('background-blend-mode')(tail(params)); - case 'gradient': - if (params[1] == 'to' && (_ = expandEdges(params[2]))) { - return { - backgroundImage: `linear-gradient(to ${join(_, ' ')},var(--tw-gradient-stops))`, - }; - } - } - - return (_ = theme2('backgroundPosition', params, '')) - ? { backgroundPosition: _ } - : (_ = theme2('backgroundSize', params, '')) - ? { backgroundSize: _ } - : (_ = theme2('backgroundImage', params, '')) - ? { backgroundImage: _ } - : withOpacityFallback('backgroundColor', 'bg', theme2('backgroundColor', params)); - }, - from: (params, { theme: theme2 }) => - (_ = theme2('gradientColorStops', params)) && { - '--tw-gradient-from': _, - '--tw-gradient-stops': `var(--tw-gradient-from),var(--tw-gradient-to,${transparentTo( - _ - )})`, - }, - - via: (params, { theme: theme2 }) => - (_ = theme2('gradientColorStops', params)) && { - '--tw-gradient-stops': `var(--tw-gradient-from),${_},var(--tw-gradient-to,${transparentTo( - _ - )})`, - }, - - to: (params, { theme: theme2 }) => - (_ = theme2('gradientColorStops', params)) && { - '--tw-gradient-to': _, - }, - - border: (params, context, id) => - expandEdges(params[0]) - ? edges(context.theme('borderWidth', tail(params)), params[0], 'border', 'width') - : border(params, context, id), - divide: (params, context, id) => - (_ = - reversableEdge(params, context, id, 'divideWidth', 'border', 'width') || - border(params, context, id)) && { - '&>:not([hidden])~:not([hidden])': _, - }, - - space: (params, context, id) => - (_ = reversableEdge(params, context, id, 'space', 'margin')) && { - '&>:not([hidden])~:not([hidden])': _, - }, - - placeholder: (params, { theme: theme2 }, id) => - (_ = - params[0] == 'opacity' - ? opacityProperty(params, theme2, id) - : withOpacityFallback('color', 'placeholder', theme2('placeholderColor', params))) && { - '&::placeholder': _, - }, - - shadow: (params, { theme: theme2 }) => - (_ = theme2('boxShadow', params)) && { - ':global': { - '*': { - '--tw-shadow': '0 0 transparent', - }, - }, - - '--tw-shadow': _ == 'none' ? '0 0 transparent' : _, - boxShadow: [ - _, - `var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)`, - ], - }, - - animate: (params, { theme: theme2, tag }) => { - if (($ = theme2('animation', params))) { - const parts = $.split(' '); - if ((_ = theme2('keyframes', parts[0], (__ = {}))) !== __) { - return ( - ($ = tag(parts[0])) && { - animation: $ + ' ' + join(tail(parts), ' '), - ['@keyframes ' + $]: _, - } - ); - } - return { animation: $ }; - } - }, - ring(params, { theme: theme2 }, id) { - switch (params[0]) { - case 'inset': - return { '--tw-ring-inset': 'inset' }; - case 'opacity': - return opacityProperty(params, theme2, id); - case 'offset': - return (_ = theme2('ringOffsetWidth', tail(params), '')) - ? { - '--tw-ring-offset-width': _, - } - : { - '--tw-ring-offset-color': theme2('ringOffsetColor', tail(params)), - }; - } - - return (_ = theme2('ringWidth', params, '')) - ? { - '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, - '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(${_} + var(--tw-ring-offset-width)) var(--tw-ring-color)`, - boxShadow: `var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)`, - ':global': { - '*': { - '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-ring-offset-width': theme2('ringOffsetWidth', '', '0px'), - '--tw-ring-offset-color': theme2('ringOffsetColor', '', '#fff'), - '--tw-ring-color': asRGBA( - theme2('ringColor', '', '#93c5fd'), - 'ring-opacity', - theme2('ringOpacity', '', '0.5') - ), - '--tw-ring-offset-shadow': '0 0 transparent', - '--tw-ring-shadow': '0 0 transparent', - }, - }, - } - : { - '--tw-ring-opacity': '1', - '--tw-ring-color': asRGBA(theme2('ringColor', params), 'ring-opacity'), - }; - }, - object: (params, context, id) => - includes(['contain', 'cover', 'fill', 'none', 'scale-down'], join(params)) - ? { objectFit: join(params) } - : themePropertyFallback('objectPosition', ' ')(params, context, id), - list: (params, context, id) => - join(params) == 'item' - ? display(params, context, id) - : includes(['inside', 'outside'], join(params)) - ? { listStylePosition: params[0] } - : themePropertyFallback('listStyleType')(params, context, id), - rounded: (params, context, id) => - corners(context.theme('borderRadius', tail(params), ''), params[0], 'border', 'radius') || - themeProperty('borderRadius')(params, context, id), - 'transition-none': { transitionProperty: 'none' }, - transition: (params, { theme: theme2 }) => ({ - transitionProperty: theme2('transitionProperty', params), - transitionTimingFunction: theme2('transitionTimingFunction', ''), - transitionDuration: theme2('transitionDuration', ''), - }), - - container: (params, { theme: theme2 }) => { - const { screens = theme2('screens'), center, padding: padding2 } = theme2('container'); - const paddingFor = (screen) => - (_ = - padding2 && - (typeof padding2 == 'string' ? padding2 : padding2[screen] || padding2.DEFAULT)) - ? { - paddingRight: _, - paddingLeft: _, - } - : {}; - return Object.keys(screens).reduce( - (rules2, screen) => { - if (($ = screens[screen]) && typeof $ == 'string') { - rules2[buildMediaQuery($)] = { - '&': { - 'max-width': $, - ...paddingFor(screen), - }, - }; - } - return rules2; - }, - { - width: '100%', - ...(center ? { marginRight: 'auto', marginLeft: 'auto' } : {}), - ...paddingFor('xs'), - } - ); - }, - filter, - blur: filter, - brightness: filter, - contrast: filter, - grayscale: filter, - 'hue-rotate': filter, - invert: filter, - saturate: filter, - sepia: filter, - 'drop-shadow': filter, - backdrop: filter, -}; - -// src/twind/preflight.ts -var createPreflight = (theme2) => ({ - ':root': { tabSize: 4 }, - 'body,blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre,fieldset,ol,ul': { margin: '0' }, - button: { backgroundColor: 'transparent', backgroundImage: 'none' }, - 'button,[type="button"],[type="reset"],[type="submit"]': { WebkitAppearance: 'button' }, - 'button:focus': { outline: ['1px dotted', '5px auto -webkit-focus-ring-color'] }, - 'fieldset,ol,ul,legend': { padding: '0' }, - 'ol,ul': { listStyle: 'none' }, - html: { - lineHeight: '1.5', - WebkitTextSizeAdjust: '100%', - fontFamily: theme2('fontFamily.sans', 'ui-sans-serif,system-ui,sans-serif'), - }, - - body: { fontFamily: 'inherit', lineHeight: 'inherit' }, - '*,::before,::after': { - boxSizing: 'border-box', - border: `0 solid ${theme2('borderColor.DEFAULT', 'currentColor')}`, - }, - - hr: { height: '0', color: 'inherit', borderTopWidth: '1px' }, - img: { borderStyle: 'solid' }, - textarea: { resize: 'vertical' }, - 'input::placeholder,textarea::placeholder': { - opacity: '1', - color: theme2('placeholderColor.DEFAULT', theme2('colors.gray.400', '#a1a1aa')), - }, - - 'button,[role="button"]': { cursor: 'pointer' }, - table: { textIndent: '0', borderColor: 'inherit', borderCollapse: 'collapse' }, - 'h1,h2,h3,h4,h5,h6': { fontSize: 'inherit', fontWeight: 'inherit' }, - a: { color: 'inherit', textDecoration: 'inherit' }, - 'button,input,optgroup,select,textarea': { - fontFamily: 'inherit', - fontSize: '100%', - margin: '0', - padding: '0', - lineHeight: 'inherit', - color: 'inherit', - }, - - 'button,select': { textTransform: 'none' }, - '::-moz-focus-inner': { borderStyle: 'none', padding: '0' }, - ':-moz-focusring': { outline: '1px dotted ButtonText' }, - ':-moz-ui-invalid': { boxShadow: 'none' }, - progress: { verticalAlign: 'baseline' }, - '::-webkit-inner-spin-button,::-webkit-outer-spin-button': { height: 'auto' }, - '[type="search"]': { WebkitAppearance: 'textfield', outlineOffset: '-2px' }, - '::-webkit-search-decoration': { WebkitAppearance: 'none' }, - '::-webkit-file-upload-button': { WebkitAppearance: 'button', font: 'inherit' }, - summary: { display: 'list-item' }, - 'abbr[title]': { textDecoration: 'underline dotted' }, - 'b,strong': { fontWeight: 'bolder' }, - 'pre,code,kbd,samp': { - fontFamily: theme2('fontFamily', 'mono', 'ui-monospace,monospace'), - fontSize: '1em', - }, - - 'sub,sup': { - fontSize: '75%', - lineHeight: '0', - position: 'relative', - verticalAlign: 'baseline', - }, - sub: { bottom: '-0.25em' }, - sup: { top: '-0.5em' }, - 'img,svg,video,canvas,audio,iframe,embed,object': { - display: 'block', - verticalAlign: 'middle', - }, - 'img,video': { maxWidth: '100%', height: 'auto' }, -}); - -// src/twind/variants.ts -var coreVariants = { - dark: '@media (prefers-color-scheme:dark)', - sticky: '@supports ((position: -webkit-sticky) or (position:sticky))', - 'motion-reduce': '@media (prefers-reduced-motion:reduce)', - 'motion-safe': '@media (prefers-reduced-motion:no-preference)', - first: '&:first-child', - last: '&:last-child', - even: '&:nth-child(2n)', - odd: '&:nth-child(odd)', - children: '&>*', - siblings: '&~*', - sibling: '&+*', - override: '&&', -}; - -// src/internal/dom.ts -var STYLE_ELEMENT_ID = '__twind'; -var getStyleElement = (nonce) => { - let element = self[STYLE_ELEMENT_ID]; - if (!element) { - element = document.head.appendChild(document.createElement('style')); - element.id = STYLE_ELEMENT_ID; - nonce && (element.nonce = nonce); - element.appendChild(document.createTextNode('')); - } - return element; -}; - -// src/twind/sheets.ts -var cssomSheet = ({ nonce, target = getStyleElement(nonce).sheet } = {}) => { - const offset = target.cssRules.length; - return { - target, - insert: (rule, index) => target.insertRule(rule, offset + index), - }; -}; -var voidSheet = () => ({ - target: null, - insert: noop, -}); - -// src/twind/modes.ts -var mode = (report) => ({ - unknown(section, key = [], optional, context) { - if (!optional) { - this.report({ id: 'UNKNOWN_THEME_VALUE', key: section + '.' + join(key) }, context); - } - }, - report({ id, ...info }) { - return report(`[${id}] ${JSON.stringify(info)}`); - }, -}); - -var warn = /* @__PURE__ */ mode((message) => console.warn(message)); -var strict = /* @__PURE__ */ mode((message) => { - throw new Error(message); -}); -var silent = /* @__PURE__ */ mode(noop); - -// src/twind/prefix.ts -import { - cssPropertyAlias, - cssPropertyPrefixFlags, - cssValuePrefixFlags, -} from './style-vendorizer.mjs'; -var noprefix = (property2, value, important) => - `${property2}:${value}${important ? ' !important' : ''}`; -var autoprefix = (property2, value, important) => { - let cssText = ''; - const propertyAlias = cssPropertyAlias(property2); - if (propertyAlias) cssText += `${noprefix(propertyAlias, value, important)};`; - let flags = cssPropertyPrefixFlags(property2); - if (flags & 1) cssText += `-webkit-${noprefix(property2, value, important)};`; - if (flags & 2) cssText += `-moz-${noprefix(property2, value, important)};`; - if (flags & 4) cssText += `-ms-${noprefix(property2, value, important)};`; - flags = cssValuePrefixFlags(property2, value); - if (flags & 1) cssText += `${noprefix(property2, `-webkit-${value}`, important)};`; - if (flags & 2) cssText += `${noprefix(property2, `-moz-${value}`, important)};`; - if (flags & 4) cssText += `${noprefix(property2, `-ms-${value}`, important)};`; - cssText += noprefix(property2, value, important); - return cssText; -}; - -// src/twind/theme.ts -var ratios = (start, end) => { - const result = {}; - do { - for (let dividend = 1; dividend < start; dividend++) { - result[`${dividend}/${start}`] = Number(((dividend / start) * 100).toFixed(6)) + '%'; - } - } while (++start <= end); - return result; -}; -var exponential = (stop, unit, start = 0) => { - const result = {}; - for (; start <= stop; start = start * 2 || 1) { - result[start] = start + unit; - } - return result; -}; -var linear = (stop, unit = '', divideBy = 1, start = 0, step = 1, result = {}) => { - for (; start <= stop; start += step) { - result[start] = start / divideBy + unit; - } - return result; -}; -var alias2 = (section) => (theme2) => theme2(section); -var themeFactory = (args, { theme: theme2 }) => theme2(...args); -var theme = (...args) => directive(themeFactory, args); -var defaultTheme = { - screens: { - sm: '640px', - md: '768px', - lg: '1024px', - xl: '1280px', - '2xl': '1536px', - }, - - colors: { - transparent: 'transparent', - current: 'currentColor', - black: '#000', - white: '#fff', - gray: { - 50: '#f9fafb', - 100: '#f3f4f6', - 200: '#e5e7eb', - 300: '#d1d5db', - 400: '#9ca3af', - 500: '#6b7280', - 600: '#4b5563', - 700: '#374151', - 800: '#1f2937', - 900: '#111827', - }, - - red: { - 50: '#fef2f2', - 100: '#fee2e2', - 200: '#fecaca', - 300: '#fca5a5', - 400: '#f87171', - 500: '#ef4444', - 600: '#dc2626', - 700: '#b91c1c', - 800: '#991b1b', - 900: '#7f1d1d', - }, - - yellow: { - 50: '#fffbeb', - 100: '#fef3c7', - 200: '#fde68a', - 300: '#fcd34d', - 400: '#fbbf24', - 500: '#f59e0b', - 600: '#d97706', - 700: '#b45309', - 800: '#92400e', - 900: '#78350f', - }, - - green: { - 50: '#ecfdf5', - 100: '#d1fae5', - 200: '#a7f3d0', - 300: '#6ee7b7', - 400: '#34d399', - 500: '#10b981', - 600: '#059669', - 700: '#047857', - 800: '#065f46', - 900: '#064e3b', - }, - - blue: { - 50: '#eff6ff', - 100: '#dbeafe', - 200: '#bfdbfe', - 300: '#93c5fd', - 400: '#60a5fa', - 500: '#3b82f6', - 600: '#2563eb', - 700: '#1d4ed8', - 800: '#1e40af', - 900: '#1e3a8a', - }, - - indigo: { - 50: '#eef2ff', - 100: '#e0e7ff', - 200: '#c7d2fe', - 300: '#a5b4fc', - 400: '#818cf8', - 500: '#6366f1', - 600: '#4f46e5', - 700: '#4338ca', - 800: '#3730a3', - 900: '#312e81', - }, - - purple: { - 50: '#f5f3ff', - 100: '#ede9fe', - 200: '#ddd6fe', - 300: '#c4b5fd', - 400: '#a78bfa', - 500: '#8b5cf6', - 600: '#7c3aed', - 700: '#6d28d9', - 800: '#5b21b6', - 900: '#4c1d95', - }, - - pink: { - 50: '#fdf2f8', - 100: '#fce7f3', - 200: '#fbcfe8', - 300: '#f9a8d4', - 400: '#f472b6', - 500: '#ec4899', - 600: '#db2777', - 700: '#be185d', - 800: '#9d174d', - 900: '#831843', - }, - }, - - spacing: { - px: '1px', - 0: '0px', - .../* @__PURE__ */ linear(4, 'rem', 4, 0.5, 0.5), - .../* @__PURE__ */ linear(12, 'rem', 4, 5), - 14: '3.5rem', - .../* @__PURE__ */ linear(64, 'rem', 4, 16, 4), - 72: '18rem', - 80: '20rem', - 96: '24rem', - }, - - durations: { - 75: '75ms', - 100: '100ms', - 150: '150ms', - 200: '200ms', - 300: '300ms', - 500: '500ms', - 700: '700ms', - 1e3: '1000ms', - }, - - animation: { - none: 'none', - spin: 'spin 1s linear infinite', - ping: 'ping 1s cubic-bezier(0, 0, 0.2, 1) infinite', - pulse: 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite', - bounce: 'bounce 1s infinite', - }, - - backdropBlur: /* @__PURE__ */ alias2('blur'), - backdropBrightness: /* @__PURE__ */ alias2('brightness'), - backdropContrast: /* @__PURE__ */ alias2('contrast'), - backdropGrayscale: /* @__PURE__ */ alias2('grayscale'), - backdropHueRotate: /* @__PURE__ */ alias2('hueRotate'), - backdropInvert: /* @__PURE__ */ alias2('invert'), - backdropOpacity: /* @__PURE__ */ alias2('opacity'), - backdropSaturate: /* @__PURE__ */ alias2('saturate'), - backdropSepia: /* @__PURE__ */ alias2('sepia'), - backgroundColor: /* @__PURE__ */ alias2('colors'), - backgroundImage: { - none: 'none', - }, - - backgroundOpacity: /* @__PURE__ */ alias2('opacity'), - backgroundSize: { - auto: 'auto', - cover: 'cover', - contain: 'contain', - }, - - blur: { - 0: '0', - sm: '4px', - DEFAULT: '8px', - md: '12px', - lg: '16px', - xl: '24px', - '2xl': '40px', - '3xl': '64px', - }, - - brightness: { - .../* @__PURE__ */ linear(200, '', 100, 0, 50), - .../* @__PURE__ */ linear(110, '', 100, 90, 5), - 75: '0.75', - 125: '1.25', - }, - - borderColor: (theme2) => ({ - ...theme2('colors'), - DEFAULT: theme2('colors.gray.200', 'currentColor'), - }), - - borderOpacity: /* @__PURE__ */ alias2('opacity'), - borderRadius: { - none: '0px', - sm: '0.125rem', - DEFAULT: '0.25rem', - md: '0.375rem', - lg: '0.5rem', - xl: '0.75rem', - '2xl': '1rem', - '3xl': '1.5rem', - '1/2': '50%', - full: '9999px', - }, - - borderWidth: { - DEFAULT: '1px', - .../* @__PURE__ */ exponential(8, 'px'), - }, - - boxShadow: { - sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)', - DEFAULT: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)', - md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)', - lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)', - xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)', - '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)', - inner: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)', - none: 'none', - }, - - contrast: { - .../* @__PURE__ */ linear(200, '', 100, 0, 50), - 75: '0.75', - 125: '1.25', - }, - - divideColor: /* @__PURE__ */ alias2('borderColor'), - divideOpacity: /* @__PURE__ */ alias2('borderOpacity'), - divideWidth: /* @__PURE__ */ alias2('borderWidth'), - dropShadow: { - sm: '0 1px 1px rgba(0,0,0,0.05)', - DEFAULT: ['0 1px 2px rgba(0, 0, 0, 0.1)', '0 1px 1px rgba(0, 0, 0, 0.06)'], - md: ['0 4px 3px rgba(0, 0, 0, 0.07)', '0 2px 2px rgba(0, 0, 0, 0.06)'], - lg: ['0 10px 8px rgba(0, 0, 0, 0.04)', '0 4px 3px rgba(0, 0, 0, 0.1)'], - xl: ['0 20px 13px rgba(0, 0, 0, 0.03)', '0 8px 5px rgba(0, 0, 0, 0.08)'], - '2xl': '0 25px 25px rgba(0, 0, 0, 0.15)', - none: '0 0 #0000', - }, - - fill: { current: 'currentColor' }, - grayscale: { - 0: '0', - DEFAULT: '100%', - }, - - hueRotate: { - 0: '0deg', - 15: '15deg', - 30: '30deg', - 60: '60deg', - 90: '90deg', - 180: '180deg', - }, - - invert: { - 0: '0', - DEFAULT: '100%', - }, - - flex: { - 1: '1 1 0%', - auto: '1 1 auto', - initial: '0 1 auto', - none: 'none', - }, - - fontFamily: { - sans: 'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split( - ',' - ), - serif: 'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(','), - mono: 'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split( - ',' - ), - }, - - fontSize: { - xs: ['0.75rem', '1rem'], - sm: ['0.875rem', '1.25rem'], - base: ['1rem', '1.5rem'], - lg: ['1.125rem', '1.75rem'], - xl: ['1.25rem', '1.75rem'], - '2xl': ['1.5rem', '2rem'], - '3xl': ['1.875rem', '2.25rem'], - '4xl': ['2.25rem', '2.5rem'], - '5xl': ['3rem', '1'], - '6xl': ['3.75rem', '1'], - '7xl': ['4.5rem', '1'], - '8xl': ['6rem', '1'], - '9xl': ['8rem', '1'], - }, - - fontWeight: { - thin: '100', - extralight: '200', - light: '300', - normal: '400', - medium: '500', - semibold: '600', - bold: '700', - extrabold: '800', - black: '900', - }, - - gridTemplateColumns: {}, - gridTemplateRows: {}, - gridAutoColumns: { - min: 'min-content', - max: 'max-content', - fr: 'minmax(0,1fr)', - }, - - gridAutoRows: { - min: 'min-content', - max: 'max-content', - fr: 'minmax(0,1fr)', - }, - - gridColumn: { - auto: 'auto', - 'span-full': '1 / -1', - }, - - gridRow: { - auto: 'auto', - 'span-full': '1 / -1', - }, - - gap: /* @__PURE__ */ alias2('spacing'), - gradientColorStops: /* @__PURE__ */ alias2('colors'), - height: (theme2) => ({ - auto: 'auto', - ...theme2('spacing'), - ...ratios(2, 6), - full: '100%', - screen: '100vh', - }), - - inset: (theme2) => ({ - auto: 'auto', - ...theme2('spacing'), - ...ratios(2, 4), - full: '100%', - }), - - keyframes: { - spin: { - from: { - transform: 'rotate(0deg)', - }, - - to: { - transform: 'rotate(360deg)', - }, - }, - - ping: { - '0%': { - transform: 'scale(1)', - opacity: '1', - }, - - '75%,100%': { - transform: 'scale(2)', - opacity: '0', - }, - }, - - pulse: { - '0%,100%': { - opacity: '1', - }, - - '50%': { - opacity: '.5', - }, - }, - - bounce: { - '0%, 100%': { - transform: 'translateY(-25%)', - animationTimingFunction: 'cubic-bezier(0.8,0,1,1)', - }, - - '50%': { - transform: 'none', - animationTimingFunction: 'cubic-bezier(0,0,0.2,1)', - }, - }, - }, - - letterSpacing: { - tighter: '-0.05em', - tight: '-0.025em', - normal: '0em', - wide: '0.025em', - wider: '0.05em', - widest: '0.1em', - }, - - lineHeight: { - none: '1', - tight: '1.25', - snug: '1.375', - normal: '1.5', - relaxed: '1.625', - loose: '2', - .../* @__PURE__ */ linear(10, 'rem', 4, 3), - }, - - margin: (theme2) => ({ - auto: 'auto', - ...theme2('spacing'), - }), - - maxHeight: (theme2) => ({ - ...theme2('spacing'), - full: '100%', - screen: '100vh', - }), - - maxWidth: (theme2, { breakpoints }) => ({ - none: 'none', - 0: '0rem', - xs: '20rem', - sm: '24rem', - md: '28rem', - lg: '32rem', - xl: '36rem', - '2xl': '42rem', - '3xl': '48rem', - '4xl': '56rem', - '5xl': '64rem', - '6xl': '72rem', - '7xl': '80rem', - full: '100%', - min: 'min-content', - max: 'max-content', - prose: '65ch', - ...breakpoints(theme2('screens')), - }), - - minHeight: { - 0: '0px', - full: '100%', - screen: '100vh', - }, - - minWidth: { - 0: '0px', - full: '100%', - min: 'min-content', - max: 'max-content', - }, - - opacity: { - .../* @__PURE__ */ linear(100, '', 100, 0, 10), - 5: '0.05', - 25: '0.25', - 75: '0.75', - 95: '0.95', - }, - - order: { - first: '-9999', - last: '9999', - none: '0', - .../* @__PURE__ */ linear(12, '', 1, 1), - }, - - outline: { - none: ['2px solid transparent', '2px'], - white: ['2px dotted white', '2px'], - black: ['2px dotted black', '2px'], - }, - - padding: /* @__PURE__ */ alias2('spacing'), - placeholderColor: /* @__PURE__ */ alias2('colors'), - placeholderOpacity: /* @__PURE__ */ alias2('opacity'), - ringColor: (theme2) => ({ - DEFAULT: theme2('colors.blue.500', '#3b82f6'), - ...theme2('colors'), - }), - - ringOffsetColor: /* @__PURE__ */ alias2('colors'), - ringOffsetWidth: /* @__PURE__ */ exponential(8, 'px'), - ringOpacity: (theme2) => ({ - DEFAULT: '0.5', - ...theme2('opacity'), - }), - - ringWidth: { - DEFAULT: '3px', - .../* @__PURE__ */ exponential(8, 'px'), - }, - - rotate: { - .../* @__PURE__ */ exponential(2, 'deg'), - .../* @__PURE__ */ exponential(12, 'deg', 3), - .../* @__PURE__ */ exponential(180, 'deg', 45), - }, - - saturate: /* @__PURE__ */ linear(200, '', 100, 0, 50), - scale: { - .../* @__PURE__ */ linear(150, '', 100, 0, 50), - .../* @__PURE__ */ linear(110, '', 100, 90, 5), - 75: '0.75', - 125: '1.25', - }, - - sepia: { - 0: '0', - DEFAULT: '100%', - }, - - skew: { - .../* @__PURE__ */ exponential(2, 'deg'), - .../* @__PURE__ */ exponential(12, 'deg', 3), - }, - - space: /* @__PURE__ */ alias2('spacing'), - stroke: { - current: 'currentColor', - }, - - strokeWidth: /* @__PURE__ */ linear(2), - textColor: /* @__PURE__ */ alias2('colors'), - textOpacity: /* @__PURE__ */ alias2('opacity'), - transitionDuration: (theme2) => ({ - DEFAULT: '150ms', - ...theme2('durations'), - }), - - transitionDelay: /* @__PURE__ */ alias2('durations'), - transitionProperty: { - none: 'none', - all: 'all', - DEFAULT: - 'background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter', - colors: 'background-color,border-color,color,fill,stroke', - opacity: 'opacity', - shadow: 'box-shadow', - transform: 'transform', - }, - - transitionTimingFunction: { - DEFAULT: 'cubic-bezier(0.4,0,0.2,1)', - linear: 'linear', - in: 'cubic-bezier(0.4,0,1,1)', - out: 'cubic-bezier(0,0,0.2,1)', - 'in-out': 'cubic-bezier(0.4,0,0.2,1)', - }, - - translate: (theme2) => ({ - ...theme2('spacing'), - ...ratios(2, 4), - full: '100%', - }), - - width: (theme2) => ({ - auto: 'auto', - ...theme2('spacing'), - ...ratios(2, 6), - ...ratios(12, 12), - screen: '100vw', - full: '100%', - min: 'min-content', - max: 'max-content', - }), - - zIndex: { - auto: 'auto', - .../* @__PURE__ */ linear(50, '', 1, 0, 10), - }, -}; - -var flattenColorPalette = (colors, target = {}, prefix = []) => { - Object.keys(colors).forEach((property2) => { - const value = colors[property2]; - if (property2 == 'DEFAULT') { - target[join(prefix)] = value; - target[join(prefix, '.')] = value; - } - const key = [...prefix, property2]; - target[join(key)] = value; - target[join(key, '.')] = value; - if (value && typeof value == 'object') { - flattenColorPalette(value, target, key); - } - }, target); - return target; -}; -var resolveContext = { - negative: () => ({}), - breakpoints: (screens) => - Object.keys(screens) - .filter((key) => typeof screens[key] == 'string') - .reduce((target, key) => { - target['screen-' + key] = screens[key]; - return target; - }, {}), -}; - -var handleArbitraryValues = (section, key) => - (key = key[0] == '[' && key.slice(-1) == ']' && key.slice(1, -1)) && - includes(section, 'olor') == /^(#|(hsl|rgb)a?\(|[a-z]+$)/.test(key) && - (includes(key, 'calc(') - ? key.replace( - /(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, - '$1 $2 ' - ) - : key); -var makeThemeResolver = (config) => { - const cache = new Map(); - const theme2 = { ...defaultTheme, ...config }; - const deref = (theme3, section) => { - const base = theme3 && theme3[section]; - const value = typeof base == 'function' ? base(resolve, resolveContext) : base; - return value && section == 'colors' ? flattenColorPalette(value) : value; - }; - const resolve = (section, key, defaultValue) => { - const keypath = section.split('.'); - section = keypath[0]; - if (keypath.length > 1) { - defaultValue = key; - key = join(tail(keypath), '.'); - } - let base = cache.get(section); - if (!base) { - cache.set(section, (base = { ...deref(theme2, section) })); - Object.assign(base, deref(theme2.extend, section)); - } - if (key != null) { - key = (Array.isArray(key) ? join(key) : key) || 'DEFAULT'; - const value = handleArbitraryValues(section, key) || base[key]; - return value == null - ? defaultValue - : Array.isArray(value) && !includes(['fontSize', 'outline', 'dropShadow'], section) - ? join(value, ',') - : value; - } - return base; - }; - return resolve; -}; - -// src/twind/translate.ts -var translate = (plugins, context) => (rule, isTranslating) => { - if (typeof rule.d == 'function') { - return rule.d(context); - } - const parameters = rule.d.split(/-(?![^[]*])/g); - if (!isTranslating && parameters[0] == 'tw' && rule.$ == rule.d) { - return rule.$; - } - for (let index = parameters.length; index; index--) { - const id = join(parameters.slice(0, index)); - const plugin = plugins[id]; - if (plugin) { - return typeof plugin == 'function' - ? plugin(tail(parameters, index), context, id) - : typeof plugin == 'string' - ? context[isTranslating ? 'css' : 'tw'](plugin) - : plugin; - } - } -}; - -// src/twind/decorate.ts -var _2; -var GROUP_RE = /^:(group(?:(?!-focus).+?)*)-(.+)$/; -var NOT_PREFIX_RE = /^(:not)-(.+)/; -var prepareVariantSelector = (variant) => (variant[1] == '[' ? tail(variant) : variant); -var decorate = (darkMode, variants, { theme: theme2, tag }) => { - const applyVariant = (translation, variant) => { - if ((_2 = theme2('screens', tail(variant), ''))) { - return { [buildMediaQuery(_2)]: translation }; - } - if (variant == ':dark' && darkMode == 'class') { - return { '.dark &': translation }; - } - if ((_2 = GROUP_RE.exec(variant))) { - return { [`.${escape(tag(_2[1]))}:${_2[2]} &`]: translation }; - } - return { - [variants[tail(variant)] || - '&' + - variant.replace( - NOT_PREFIX_RE, - (_4, not, variant2) => not + '(' + prepareVariantSelector(':' + variant2) + ')' - )]: translation, - }; - }; - return (translation, rule) => rule.v.reduceRight(applyVariant, translation); -}; - -// src/twind/presedence.ts -var _3; -var responsivePrecedence = (css) => - (((_3 = /(?:^|min-width: *)(\d+(?:.\d+)?)(p)?/.exec(css)) - ? +_3[1] / (_3[2] ? 15 : 1) / 10 - : 0) & - 31) << - 22; -var seperatorPrecedence = (string) => { - _3 = 0; - for (let index = string.length; index--; ) { - _3 += includes('-:,', string[index]); - } - return _3; -}; -var atRulePresedence = (css) => (seperatorPrecedence(css) & 15) << 18; -var PRECEDENCES_BY_PSEUDO_CLASS = [ - 'rst', - 'st', - 'en', - 'd', - 'nk', - 'sited', - 'pty', - 'ecked', - 'cus-w', - 'ver', - 'cus', - 'cus-v', - 'tive', - 'sable', - 'ad-on', - 'tiona', - 'quire', -]; - -var pseudoPrecedence = (pseudoClass) => - 1 << - (~(_3 = PRECEDENCES_BY_PSEUDO_CLASS.indexOf( - pseudoClass.replace(GROUP_RE, ':$2').slice(3, 8) - )) - ? _3 - : 17); -var makeVariantPresedenceCalculator = (theme2, variants) => (presedence, variant) => - presedence | - ((_3 = theme2('screens', tail(variant), '')) - ? (1 << 27) | responsivePrecedence(buildMediaQuery(_3)) - : variant == ':dark' - ? 1 << 30 - : (_3 = variants[variant] || variant.replace(NOT_PREFIX_RE, ':$2'))[0] == '@' - ? atRulePresedence(_3) - : pseudoPrecedence(variant)); -var declarationPropertyPrecedence = (property2) => - property2[0] == '-' - ? 0 - : seperatorPrecedence(property2) + - ((_3 = /^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7}$)|([fl].{5}l|g.{8}$|pl))/.exec( - property2 - )) - ? +!!_3[1] || -!!_3[2] - : 0) + - 1; - -// src/twind/serialize.ts -var stringifyBlock = (body, selector) => selector + '{' + body + '}'; -var serialize = (prefix, variants, context) => { - const { theme: theme2, tag } = context; - const tagVar = (_4, property2) => '--' + tag(property2); - const tagVars = (value) => `${value}`.replace(/--(tw-[\w-]+)\b/g, tagVar); - const stringifyDeclaration = (property2, value, important) => { - property2 = tagVars(property2); - return Array.isArray(value) - ? join( - value.filter(Boolean).map((value2) => prefix(property2, tagVars(value2), important)), - ';' - ) - : prefix(property2, tagVars(value), important); - }; - let rules2; - const stringify3 = (atRules, selector, presedence, css, important) => { - if (Array.isArray(css)) { - css.forEach( - (css2) => css2 && stringify3(atRules, selector, presedence, css2, important) - ); - return; - } - let declarations = ''; - let maxPropertyPresedence = 0; - let numberOfDeclarations = 0; - if (css['@apply']) { - css = merge( - evalThunk(apply(css['@apply']), context), - { ...css, '@apply': void 0 }, - context - ); - } - Object.keys(css).forEach((key) => { - const value = evalThunk(css[key], context); - if (isCSSProperty(key, value)) { - if (value !== '' && key.length > 1) { - const property2 = hyphenate(key); - numberOfDeclarations += 1; - maxPropertyPresedence = Math.max( - maxPropertyPresedence, - declarationPropertyPrecedence(property2) - ); - declarations = - (declarations && declarations + ';') + - stringifyDeclaration(property2, value, important); - } - } else if (value) { - if (key == ':global') { - key = '@global'; - } - if (key[0] == '@') { - if (key[1] == 'g') { - stringify3([], '', 0, value, important); - } else if (key[1] == 'f') { - stringify3([], key, 0, value, important); - } else if (key[1] == 'k') { - const currentSize = rules2.length; - stringify3([], '', 0, value, important); - const waypoints = rules2.splice(currentSize, rules2.length - currentSize); - rules2.push({ - r: stringifyBlock( - join( - waypoints.map((p) => p.r), - '' - ), - key - ), - p: waypoints.reduce((sum, p) => sum + p.p, 0), - }); - } else if (key[1] == 'i') { - (Array.isArray(value) ? value : [value]).forEach( - (value2) => value2 && rules2.push({ p: 0, r: `${key} ${value2};` }) - ); - } else { - if (key[2] == 'c') { - key = buildMediaQuery(context.theme('screens', tail(key, 8).trim())); - } - stringify3( - [...atRules, key], - selector, - presedence | responsivePrecedence(key) | atRulePresedence(key), - value, - important - ); - } - } else { - stringify3( - atRules, - selector - ? join( - selector.split(/,(?![^[]*])/g).map((selectorPart) => - join( - key - .split(/,(?![^[]*])/g) - .map((keyPart) => - includes(keyPart, '&') - ? keyPart.replace(/&/g, selectorPart) - : (selectorPart && selectorPart + ' ') + keyPart - ), - ',' - ) - ), - ',' - ) - : key, - presedence, - value, - important - ); - } - } - }); - if (numberOfDeclarations) { - rules2.push({ - r: atRules.reduceRight(stringifyBlock, stringifyBlock(declarations, selector)), - p: - presedence * (1 << 8) + - (((Math.max(0, 15 - numberOfDeclarations) & 15) << 4) | - ((maxPropertyPresedence || 15) & 15)), - }); - } - }; - const variantPresedence = makeVariantPresedenceCalculator(theme2, variants); - return (css, className, rule, layer = 0) => { - layer <<= 28; - rules2 = []; - stringify3( - [], - className ? '.' + escape(className) : '', - rule ? rule.v.reduceRight(variantPresedence, layer) : layer, - css, - rule && rule.i - ); - return rules2; - }; -}; - -// src/twind/inject.ts -var inject = (sheet, mode2, init, context) => { - let sortedPrecedences; - init((value = []) => (sortedPrecedences = value)); - let insertedRules; - init((value = new Set()) => (insertedRules = value)); - return ({ r: css, p: presedence }) => { - if (!insertedRules.has(css)) { - insertedRules.add(css); - const index = sortedInsertionIndex(sortedPrecedences, presedence); - try { - sheet.insert(css, index); - sortedPrecedences.splice(index, 0, presedence); - } catch (error) { - if (!/:-[mwo]/.test(css)) { - mode2.report({ id: 'INJECT_CSS_ERROR', css, error }, context); - } - } - } - }; -}; - -// src/twind/configure.ts -var sanitize = (value, defaultValue, disabled, enabled = defaultValue) => - value === false ? disabled : value === true ? enabled : value || defaultValue; -var loadMode = (mode2) => - (typeof mode2 == 'string' ? { t: strict, a: warn, i: silent }[mode2[1]] : mode2) || warn; -var stringifyVariant = (selector, variant) => - selector + (variant[1] == ':' ? tail(variant, 2) + ':' : tail(variant)) + ':'; -var stringify2 = (rule, directive2 = rule.d) => - typeof directive2 == 'function' - ? '' - : rule.v.reduce(stringifyVariant, '') + - (rule.i ? '!' : '') + - (rule.n ? '-' : '') + - directive2; -var COMPONENT_PROPS = { _: { value: '', writable: true } }; -var configure = (config = {}) => { - const theme2 = makeThemeResolver(config.theme); - const mode2 = loadMode(config.mode); - const hash = sanitize(config.hash, false, false, cyrb32); - const important = config.important; - let activeRule = { v: [] }; - let translateDepth = 0; - const lastTranslations = []; - const context = { - tw: (...tokens) => process(tokens), - theme: (section, key, defaultValue) => { - var _a; - const value = - (_a = theme2(section, key, defaultValue)) != null - ? _a - : mode2.unknown( - section, - key == null || Array.isArray(key) ? key : key.split('.'), - defaultValue != null, - context - ); - return activeRule.n && value && includes('rg', (typeof value)[5]) - ? `calc(${value} * -1)` - : value; - }, - tag: (value) => (hash ? hash(value) : value), - css: (rules2) => { - translateDepth++; - const lastTranslationsIndex = lastTranslations.length; - try { - (typeof rules2 == 'string' ? parse([rules2]) : rules2).forEach(convert); - const css = Object.create(null, COMPONENT_PROPS); - for (let index = lastTranslationsIndex; index < lastTranslations.length; index++) { - const translation = lastTranslations[index]; - if (translation) { - switch (typeof translation) { - case 'object': - merge(css, translation, context); - break; - case 'string': - css._ += (css._ && ' ') + translation; - } - } - } - return css; - } finally { - lastTranslations.length = lastTranslationsIndex; - translateDepth--; - } - }, - }; - - const translate2 = translate({ ...corePlugins, ...config.plugins }, context); - const doTranslate = (rule) => { - const parentRule = activeRule; - activeRule = rule; - try { - return evalThunk(translate2(rule), context); - } finally { - activeRule = parentRule; - } - }; - const variants = { ...coreVariants, ...config.variants }; - const decorate2 = decorate(config.darkMode || 'media', variants, context); - const serialize2 = serialize( - sanitize(config.prefix, autoprefix, noprefix), - variants, - context - ); - const sheet = - config.sheet || (typeof window == 'undefined' ? voidSheet() : cssomSheet(config)); - const { init = (callback) => callback() } = sheet; - const inject2 = inject(sheet, mode2, init, context); - let idToClassName; - init((value = new Map()) => (idToClassName = value)); - const inlineDirectiveName = new WeakMap(); - const evaluateFunctions = (key, value) => - key == '_' - ? void 0 - : typeof value == 'function' - ? JSON.stringify(evalThunk(value, context), evaluateFunctions) - : value; - const convert = (rule) => { - if (!translateDepth && activeRule.v.length) { - rule = { ...rule, v: [...activeRule.v, ...rule.v], $: '' }; - } - if (!rule.$) { - rule.$ = stringify2(rule, inlineDirectiveName.get(rule.d)); - } - let className = translateDepth ? null : idToClassName.get(rule.$); - if (className == null) { - let translation = doTranslate(rule); - if (!rule.$) { - rule.$ = cyrb32(JSON.stringify(translation, evaluateFunctions)); - inlineDirectiveName.set(rule.d, rule.$); - rule.$ = stringify2(rule, rule.$); - } - if (translation && typeof translation == 'object') { - rule.v = rule.v.map(prepareVariantSelector); - if (important) rule.i = important; - translation = decorate2(translation, rule); - if (translateDepth) { - lastTranslations.push(translation); - } else { - const layer = - typeof rule.d == 'function' ? (typeof translation._ == 'string' ? 1 : 3) : 2; - className = - hash || typeof rule.d == 'function' ? (hash || cyrb32)(layer + rule.$) : rule.$; - serialize2(translation, className, rule, layer).forEach(inject2); - if (translation._) { - className += ' ' + translation._; - } - } - } else { - if (typeof translation == 'string') { - className = translation; - } else { - className = rule.$; - mode2.report({ id: 'UNKNOWN_DIRECTIVE', rule: className }, context); - } - if (translateDepth && typeof rule.d !== 'function') { - lastTranslations.push(className); - } - } - if (!translateDepth) { - idToClassName.set(rule.$, className); - ensureMaxSize(idToClassName, 3e4); - } - } - return className; - }; - const process = (tokens) => join(parse(tokens).map(convert).filter(Boolean), ' '); - const preflight = sanitize(config.preflight, identity, false); - if (preflight) { - const css = createPreflight(theme2); - const styles = serialize2( - typeof preflight == 'function' - ? evalThunk(preflight(css, context), context) || css - : { ...css, ...preflight } - ); - init((injected = (styles.forEach(inject2), true)) => injected); - } - return { - init: () => mode2.report({ id: 'LATE_SETUP_CALL' }, context), - process, - }; -}; - -// src/twind/instance.ts -var create = (config) => { - let process = (tokens) => { - init(); - return process(tokens); - }; - let init = (config2) => { - ({ process, init } = configure(config2)); - }; - if (config) init(config); - let context; - const fromContext = (key) => () => { - if (!context) { - process([ - (_4) => { - context = _4; - return ''; - }, - ]); - } - return context[key]; - }; - return { - tw: Object.defineProperties((...tokens) => process(tokens), { - theme: { - get: fromContext('theme'), - }, - }), - - setup: (config2) => init(config2), - }; -}; - -// src/twind/default.ts -var { tw, setup } = /* @__PURE__ */ create(); -export { - apply, - autoprefix, - create, - cssomSheet, - directive, - cyrb32 as hash, - mode, - noprefix, - setup, - silent, - strict, - theme, - tw, - voidSheet, - warn, -}; diff --git a/env/env.mjs b/env/env.mjs index af15ca2..17c905d 100644 --- a/env/env.mjs +++ b/env/env.mjs @@ -6,10 +6,7 @@ 'use strict'; -/** - * environment-specific methods and constants - * @module notion-enhancer/api/env - */ +/** environment-specific methods and constants */ /** * the environment/platform name code is currently being executed in diff --git a/env/fs.mjs b/env/fs.mjs index 8183ff3..020a37d 100644 --- a/env/fs.mjs +++ b/env/fs.mjs @@ -6,10 +6,7 @@ 'use strict'; -/** - * environment-specific filesystem reading - * @module notion-enhancer/api/fs - */ +/** environment-specific file reading */ /** * transform a path relative to the enhancer root directory into an absolute path @@ -21,7 +18,7 @@ export const localPath = chrome.runtime.getURL; /** * fetch and parse a json file's contents * @param {string} path - a url or within-the-enhancer filepath - * @param {object} [opts] - the second argument of a fetch() request + * @param {object=} opts - the second argument of a fetch() request * @returns {object} the json value of the requested file as a js object */ export const getJSON = (path, opts = {}) => @@ -30,7 +27,7 @@ export const getJSON = (path, opts = {}) => /** * fetch a text file's contents * @param {string} path - a url or within-the-enhancer filepath - * @param {object} [opts] - the second argument of a fetch() request + * @param {object=} opts - the second argument of a fetch() request * @returns {string} the text content of the requested file */ export const getText = (path, opts = {}) => diff --git a/env/storage.mjs b/env/storage.mjs index 91674f2..0018513 100644 --- a/env/storage.mjs +++ b/env/storage.mjs @@ -6,18 +6,15 @@ 'use strict'; -/** - * environment-specific data persistence - * @module notion-enhancer/api/storage - */ +/** environment-specific data persistence */ const _queue = [], _onChangeListeners = []; /** * get persisted data - * @param {array} path - the path of keys to the value being fetched - * @param {*} [fallback] - a default value if the path is not matched + * @param {string[]} path - the path of keys to the value being fetched + * @param {unknown=} fallback - a default value if the path is not matched * @returns {Promise} value ?? fallback */ export const get = (path, fallback = undefined) => { @@ -39,8 +36,8 @@ export const get = (path, fallback = undefined) => { /** * persist data - * @param {array} path - the path of keys to the value being set - * @param {*} value - the data to save + * @param {string[]} path - the path of keys to the value being set + * @param {unknown} value - the data to save * @returns {Promise} resolves when data has been saved */ export const set = (path, value) => { @@ -68,7 +65,7 @@ export const set = (path, value) => { } chrome.storage.local.set({ [namespace]: values[namespace] }, () => { _onChangeListeners.forEach((listener) => - listener({ type: 'set', path: pathClone, new: value, old }) + listener({ path: pathClone, new: value, old }) ); res(value); }); @@ -80,12 +77,13 @@ export const set = (path, value) => { /** * create a wrapper for accessing a partition of the storage - * @param {array} namespace - the path of keys to prefix all storage requests with - * @param {function} [get] - the storage get function to be wrapped - * @param {function} [set] - the storage set function to be wrapped + * @param {string[]} namespace - the path of keys to prefix all storage requests with + * @param {function=} get - the storage get function to be wrapped + * @param {function=} set - the storage set function to be wrapped * @returns {object} an object with the wrapped get/set functions */ export const db = (namespace, getFunc = get, setFunc = set) => { + if (typeof namespace === 'string') namespace = [namespace]; return { get: (path = [], fallback = undefined) => getFunc([...namespace, ...path], fallback), set: (path, value) => setFunc([...namespace, ...path], value), @@ -112,9 +110,7 @@ export const removeChangeListener = (callback) => { /** * @callback onStorageChangeCallback * @param {object} event - * @param {string} event.type - 'set' or 'reset' - * @param {string} event.namespace- the name of the store, e.g. a mod id - * @param {string} [event.key] - the key associated with the changed value - * @param {string} [event.new] - the new value being persisted to the store - * @param {string} [event.old] - the previous value associated with the key + * @param {string} event.path- the path of keys to the changed value + * @param {string=} event.new - the new value being persisted to the store + * @param {string=} event.old - the previous value associated with the key */ diff --git a/icon/animated.gif b/icon/animated.gif deleted file mode 100644 index 56f8300..0000000 Binary files a/icon/animated.gif and /dev/null differ diff --git a/icon/blackwhite-x128.png b/icon/blackwhite-x128.png deleted file mode 100644 index bc0b657..0000000 Binary files a/icon/blackwhite-x128.png and /dev/null differ diff --git a/icon/blackwhite-x16.png b/icon/blackwhite-x16.png deleted file mode 100644 index 69224de..0000000 Binary files a/icon/blackwhite-x16.png and /dev/null differ diff --git a/icon/blackwhite-x256.png b/icon/blackwhite-x256.png deleted file mode 100644 index 6d288a9..0000000 Binary files a/icon/blackwhite-x256.png and /dev/null differ diff --git a/icon/blackwhite-x32.png b/icon/blackwhite-x32.png deleted file mode 100644 index e8a517e..0000000 Binary files a/icon/blackwhite-x32.png and /dev/null differ diff --git a/icon/blackwhite-x48.png b/icon/blackwhite-x48.png deleted file mode 100644 index bf574dc..0000000 Binary files a/icon/blackwhite-x48.png and /dev/null differ diff --git a/icon/blackwhite-x512.png b/icon/blackwhite-x512.png deleted file mode 100644 index 0ecf16c..0000000 Binary files a/icon/blackwhite-x512.png and /dev/null differ diff --git a/icon/blackwhite.svg b/icon/blackwhite.svg deleted file mode 100644 index 7321a08..0000000 --- a/icon/blackwhite.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/icon/colour-x128.png b/icon/colour-x128.png deleted file mode 100644 index 4012672..0000000 Binary files a/icon/colour-x128.png and /dev/null differ diff --git a/icon/colour-x16.png b/icon/colour-x16.png deleted file mode 100644 index 21be6b5..0000000 Binary files a/icon/colour-x16.png and /dev/null differ diff --git a/icon/colour-x256.png b/icon/colour-x256.png deleted file mode 100644 index 30c25a0..0000000 Binary files a/icon/colour-x256.png and /dev/null differ diff --git a/icon/colour-x32.png b/icon/colour-x32.png deleted file mode 100644 index 8e14320..0000000 Binary files a/icon/colour-x32.png and /dev/null differ diff --git a/icon/colour-x48.png b/icon/colour-x48.png deleted file mode 100644 index 1e52a45..0000000 Binary files a/icon/colour-x48.png and /dev/null differ diff --git a/icon/colour-x512.png b/icon/colour-x512.png deleted file mode 100644 index f3adbac..0000000 Binary files a/icon/colour-x512.png and /dev/null differ diff --git a/icon/colour.svg b/icon/colour.svg deleted file mode 100644 index 99027d9..0000000 --- a/icon/colour.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/init.js b/init.js new file mode 100644 index 0000000..e8de939 --- /dev/null +++ b/init.js @@ -0,0 +1,35 @@ +/* + * notion-enhancer + * (c) 2021 dragonwocky (https://dragonwocky.me/) + * (https://notion-enhancer.github.io/) under the MIT license + */ + +'use strict'; + +(async () => { + const site = location.host.endsWith('.notion.site'), + page = location.pathname.split(/[/-]/g).reverse()[0].length === 32, + whitelisted = ['/', '/onboarding'].includes(location.pathname), + signedIn = localStorage['LRU:KeyValueStore2:current-user-id']; + + if (site || page || (whitelisted && signedIn)) { + const api = await import(chrome.runtime.getURL('api/index.mjs')), + { fs, registry, web } = api; + + for (const mod of await registry.list((mod) => registry.enabled(mod.id))) { + for (const sheet of mod.css?.client || []) { + web.loadStylesheet(`repo/${mod._dir}/${sheet}`); + } + for (let script of mod.js?.client || []) { + script = await import(fs.localPath(`repo/${mod._dir}/${script}`)); + script.default(api, await registry.db(mod.id)); + } + } + + const errors = await registry.errors(); + if (errors.length) { + console.log('[notion-enhancer] registry errors:'); + console.table(errors); + } + } +})(); diff --git a/launcher.js b/launcher.js deleted file mode 100644 index 730ba8f..0000000 --- a/launcher.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * notion-enhancer - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -(async () => { - if (location.pathname === '/') await new Promise((res, rej) => setTimeout(res, 500)); - - const site = location.host.endsWith('.notion.site'), - page = location.pathname.split(/[/-]/g).reverse()[0].length === 32; - - if (site || page) { - import(chrome.runtime.getURL('api/_.mjs')).then(async (api) => { - const { fs, registry, web } = api; - for (const mod of await registry.list((mod) => registry.enabled(mod.id))) { - for (const sheet of mod.css?.client || []) { - web.loadStylesheet(`repo/${mod._dir}/${sheet}`); - } - for (let script of mod.js?.client || []) { - script = await import(fs.localPath(`repo/${mod._dir}/${script}`)); - script.default(api, await registry.db(mod.id)); - } - } - const errors = await registry.errors(); - if (errors.length) { - console.log('[notion-enhancer] registry errors:'); - console.table(errors); - } - }); - } -})(); diff --git a/manifest.json b/manifest.json index c0e7351..4d4d969 100644 --- a/manifest.json +++ b/manifest.json @@ -6,32 +6,25 @@ "description": "an enhancer/customiser for the all-in-one productivity workspace notion.so", "homepage_url": "https://notion-enhancer.github.io", "icons": { - "16": "icon/colour-x16.png", - "32": "icon/colour-x32.png", - "48": "icon/colour-x48.png", - "128": "icon/colour-x128.png", - "256": "icon/colour-x256.png", - "512": "icon/colour-x512.png" + "16": "media/colour-x16.png", + "32": "media/colour-x32.png", + "48": "media/colour-x48.png", + "128": "media/colour-x128.png", + "256": "media/colour-x256.png", + "512": "media/colour-x512.png" }, "browser_action": {}, "background": { "scripts": ["worker.js"] }, "options_ui": { - "page": "repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html", + "page": "repo/menu/menu.html", "open_in_tab": true }, - "web_accessible_resources": ["env/*", "api/*", "dep/*", "icon/*", "repo/*"], + "web_accessible_resources": ["env/*", "api/*", "dep/*", "media/*", "repo/*"], "content_scripts": [ { "matches": ["https://*.notion.so/*", "https://*.notion.site/*"], - "js": ["launcher.js"] + "js": ["init.js"] } ], - "permissions": [ - "tabs", - "storage", - "unlimitedStorage", - "https://*.notion.so/*", - "https://*.notion.site/*", - "" - ] + "permissions": ["tabs", "storage", "clipboardRead", "clipboardWrite", "unlimitedStorage"] } diff --git a/media b/media new file mode 160000 index 0000000..2a0a179 --- /dev/null +++ b/media @@ -0,0 +1 @@ +Subproject commit 2a0a17998385f1d86148b9213451b3a5deff6bae diff --git a/repo b/repo new file mode 160000 index 0000000..76e36ab --- /dev/null +++ b/repo @@ -0,0 +1 @@ +Subproject commit 76e36ab47ca2ffd354280b5c907f9ebb827c30c4 diff --git a/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.css b/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.css deleted file mode 100644 index 7cf79f8..0000000 --- a/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.css +++ /dev/null @@ -1,9 +0,0 @@ -/* - * notion-enhancer: bypass-preview - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -.notion-peek-renderer { - display: none; -} diff --git a/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.mjs b/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.mjs deleted file mode 100644 index b510184..0000000 --- a/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/client.mjs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * notion-enhancer: bypass-preview - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -export default async function (api, db) { - const { web, components } = api; - await web.whenReady(); - - let _lastPage = {}; - function getCurrentPage() { - if (web.queryParams().get('p')) return { type: 'preview', id: web.queryParams().get('p') }; - return { type: 'page', id: location.pathname.split(/(-|\/)/g).reverse()[0] }; - } - - web.addDocumentObserver((event) => { - const currentPage = getCurrentPage(); - if (currentPage.id !== _lastPage.id || currentPage.type !== _lastPage.type) { - const openAsPage = document.querySelector( - '.notion-peek-renderer [style*="height: 45px;"] a' - ); - if (openAsPage) { - if (currentPage.id === _lastPage.id && currentPage.type === 'preview') { - history.back(); - } else openAsPage.click(); - } - _lastPage = getCurrentPage(); - } - }); -} diff --git a/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/mod.json b/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/mod.json deleted file mode 100644 index 1d0cfb4..0000000 --- a/repo/bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f/mod.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "bypass-preview", - "id": "cb6fd684-f113-4a7a-9423-8f0f0cff069f", - "version": "0.2.0", - "description": "go straight to the normal full view when opening a page.", - "tags": ["extension", "automation"], - "authors": [ - { - "name": "dragonwocky", - "email": "thedragonring.bod@gmail.com", - "homepage": "https://dragonwocky.me/", - "avatar": "https://dragonwocky.me/avatar.jpg" - } - ], - "js": { - "client": ["client.mjs"] - }, - "css": { - "client": ["client.css"] - }, - "options": [] -} diff --git a/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.css b/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.css deleted file mode 100644 index 310c6f9..0000000 --- a/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.css +++ /dev/null @@ -1,21 +0,0 @@ -/* - * notion-enhancer: calendar-scroll - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -#calendar-scroll-to-week { - background: var(--theme--button_hover); - border: 1px solid transparent; - font-size: var(--theme--font_label-size); - color: var(--theme--text); - height: 24px; - border-radius: 3px; - line-height: 1.2; - padding: 0 0.5em; - margin-right: 5px; -} -#calendar-scroll-to-week:hover { - background: transparent; - border: 1px solid var(--theme--button_hover); -} diff --git a/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.mjs b/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.mjs deleted file mode 100644 index 96c893a..0000000 --- a/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/client.mjs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * notion-enhancer core: bypass-preview - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -import { web } from '../../api/_.mjs'; - -const $button = web.createElement( - web.html`` -); -$button.addEventListener('click', async (event) => { - let $day = document.querySelector('.notion-calendar-view-day[style*="background:"]'); - while (!$day) { - const $toolbar = document.querySelector( - '.notion-calendar-view > :first-child > :first-child > :first-child' - ), - year = +$toolbar.children[0].innerText.split(' ')[1], - month = { - 'January': 0, - 'February': 1, - 'March': 2, - 'April': 3, - 'May': 4, - 'June': 5, - 'July': 6, - 'August': 7, - 'September': 8, - 'October': 9, - 'November': 10, - 'December': 11, - }[$toolbar.children[0].innerText.split(' ')[0]], - now = new Date(); - switch (true) { - case now.getFullYear() < year: - case now.getFullYear() === year && now.getMonth() < month: - $toolbar.children[3].click(); - break; - case now.getFullYear() > year: - case now.getFullYear() === year && now.getMonth() > month: - $toolbar.children[5].click(); - break; - default: - await new Promise((res, rej) => requestAnimationFrame(res)); - $day = document.querySelector('.notion-calendar-view-day[style*="background:"]'); - } - await new Promise((res, rej) => requestAnimationFrame(res)); - } - const $scroller = document.querySelector('.notion-frame .notion-scroller'); - $scroller.scroll({ - top: $day.offsetParent.offsetParent.offsetTop + 70, - behavior: 'auto', - }); -}); - -web.addDocumentObserver((event) => { - if (document.contains($button)) return; - const toolbar = document.querySelector( - '.notion-calendar-view > :first-child > :first-child > :first-child' - ); - if (toolbar) toolbar.insertBefore($button, toolbar.children[2]); -}); diff --git a/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/mod.json b/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/mod.json deleted file mode 100644 index 1e38790..0000000 --- a/repo/calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a/mod.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "calendar-scroll", - "id": "b1c7db33-dfee-489a-a76c-0dd66f7ed29a", - "version": "0.2.0", - "description": "add a button to jump down to the current week in fullpage/infinite-scroll calendars.", - "tags": ["extension", "shortcut"], - "authors": [ - { - "name": "dragonwocky", - "email": "thedragonring.bod@gmail.com", - "homepage": "https://dragonwocky.me/", - "avatar": "https://dragonwocky.me/avatar.jpg" - } - ], - "js": { - "client": ["client.mjs"] - }, - "css": { - "client": ["client.css"] - }, - "options": [] -} diff --git a/repo/components@36a2ffc9-27ff-480e-84a7-c7700a7d232d/mod.json b/repo/components@36a2ffc9-27ff-480e-84a7-c7700a7d232d/mod.json deleted file mode 100644 index bb0cc36..0000000 --- a/repo/components@36a2ffc9-27ff-480e-84a7-c7700a7d232d/mod.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "__comment": "pseudo-mod to allow configuration of API-provided components", - "name": "components", - "id": "36a2ffc9-27ff-480e-84a7-c7700a7d232d", - "version": "0.2.0", - "description": "shared notion-style elements.", - "tags": ["core"], - "authors": [ - { - "name": "dragonwocky", - "email": "thedragonring.bod@gmail.com", - "homepage": "https://dragonwocky.me/", - "avatar": "https://dragonwocky.me/avatar.jpg" - }, - { - "name": "CloudHill", - "email": "rh.cloudhill@gmail.com", - "homepage": "https://github.com/CloudHill", - "avatar": "https://avatars.githubusercontent.com/u/54142180" - } - ], - "js": {}, - "css": {}, - "options": [ - { - "type": "hotkey", - "key": "panel.hotkey", - "label": "toggle panel hotkey", - "value": "Ctrl+Alt+\\", - "tooltip": "opens/closes the side panel in notion - will only work if a mod is making use of it." - } - ] -} diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/blocks.mjs b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/blocks.mjs deleted file mode 100644 index 4f1a7e0..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/blocks.mjs +++ /dev/null @@ -1,237 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -import { fmt, web, registry, components } from '../../api/_.mjs'; -import { notifications } from './notifications.mjs'; -const profileDB = await registry.profileDB(); - -export const blocks = { - preview: (url) => web.html``, - title: (title) => web.html`

${web.escape(title)}

`, - version: (version) => web.html`v${web.escape(version)}`, - tags: (tags) => { - if (!tags.length) return ''; - return web.render( - web.html`

`, - tags.map((tag) => `#${web.escape(tag)}`).join(' ') - ); - }, - description: (description) => web.html`

- ${fmt.md.renderInline(description)} -

`, - authors: (authors) => { - const author = (author) => web.html` - ${web.escape(author.name)}'s avatar ${web.escape(author.name)} - `; - return web.render(web.html`

`, ...authors.map(author)); - }, - toggle: (label, checked) => { - const $label = web.html``, - $input = web.html``, - $feature = web.html``; - $label.addEventListener('keyup', (event) => { - if (['Enter', ' '].includes(event.key)) $input.checked = !$input.checked; - }); - return web.render($label, $input, $feature); - }, -}; - -export const options = { - toggle: async (mod, opt) => { - const checked = await profileDB.get([mod.id, opt.key], opt.value), - $toggle = blocks.toggle(opt.label, checked), - $tooltip = web.html`${await components.feather('info', { class: 'input-tooltip' })}`, - $label = $toggle.children[0], - $input = $toggle.children[1]; - if (opt.tooltip) { - $label.prepend($tooltip); - components.tooltip($tooltip, opt.tooltip); - } - $input.addEventListener('change', async (event) => { - await profileDB.set([mod.id, opt.key], $input.checked); - notifications.onChange(); - }); - return $toggle; - }, - select: async (mod, opt) => { - const value = await profileDB.get([mod.id, opt.key], opt.values[0]), - $tooltip = web.html`${await components.feather('info', { class: 'input-tooltip' })}`, - $label = web.render( - web.html``, - web.render(web.html`

`, opt.tooltip ? $tooltip : '', opt.label) - ), - $options = opt.values.map( - (option) => web.raw`` - ), - $select = web.html``, - $icon = web.html`${await components.feather('chevron-down', { class: 'input-icon' })}`; - if (opt.tooltip) components.tooltip($tooltip, opt.tooltip); - $select.addEventListener('change', async (event) => { - await profileDB.set([mod.id, opt.key], $select.value); - notifications.onChange(); - }); - return web.render($label, $select, $icon); - }, - text: async (mod, opt) => { - const value = await profileDB.get([mod.id, opt.key], opt.value), - $tooltip = web.html`${await components.feather('info', { class: 'input-tooltip' })}`, - $label = web.render( - web.html``, - web.render(web.html`

`, opt.tooltip ? $tooltip : '', opt.label) - ), - $input = web.html``, - $icon = web.html`${await components.feather('type', { class: 'input-icon' })}`; - if (opt.tooltip) components.tooltip($tooltip, opt.tooltip); - $input.addEventListener('change', async (event) => { - await profileDB.set([mod.id, opt.key], $input.value); - notifications.onChange(); - }); - return web.render($label, $input, $icon); - }, - number: async (mod, opt) => { - const value = await profileDB.get([mod.id, opt.key], opt.value), - $tooltip = web.html`${await components.feather('info', { class: 'input-tooltip' })}`, - $label = web.render( - web.html``, - web.render(web.html`

`, opt.tooltip ? $tooltip : '', opt.label) - ), - $input = web.html``, - $icon = web.html`${await components.feather('hash', { class: 'input-icon' })}`; - if (opt.tooltip) components.tooltip($tooltip, opt.tooltip); - $input.addEventListener('change', async (event) => { - await profileDB.set([mod.id, opt.key], $input.value); - notifications.onChange(); - }); - return web.render($label, $input, $icon); - }, - color: async (mod, opt) => { - const value = await profileDB.get([mod.id, opt.key], opt.value), - $tooltip = web.html`${await components.feather('info', { class: 'input-tooltip' })}`, - $label = web.render( - web.html``, - web.render(web.html`

`, opt.tooltip ? $tooltip : '', opt.label) - ), - $input = web.html``, - $icon = web.html`${await components.feather('droplet', { class: 'input-icon' })}`, - paint = () => { - $input.style.background = $picker.toBackground(); - $input.style.color = $picker.isLight() ? '#000' : '#fff'; - $input.style.padding = ''; - }, - $picker = new web.jscolor($input, { - value, - format: 'rgba', - previewSize: 0, - borderRadius: 3, - borderColor: 'var(--theme--ui_divider)', - controlBorderColor: 'var(--theme--ui_divider)', - backgroundColor: 'var(--theme--bg)', - onInput: paint, - onChange: paint, - }); - if (opt.tooltip) components.tooltip($tooltip, opt.tooltip); - $input.addEventListener('change', async (event) => { - await profileDB.set([mod.id, opt.key], $input.value); - notifications.onChange(); - }); - paint(); - return web.render($label, $input, $icon); - }, - file: async (mod, opt) => { - const { filename } = (await profileDB.get([mod.id, opt.key], {})) || {}, - $tooltip = web.html`${await components.feather('info', { class: 'input-tooltip' })}`, - $label = web.render( - web.html``, - web.render(web.html`

`, opt.tooltip ? $tooltip : '', opt.label) - ), - $pseudo = web.html`Upload file...`, - $input = web.html``, - $icon = web.html`${await components.feather('file', { class: 'input-icon' })}`, - $filename = web.html`${web.escape(filename || 'none')}`, - $latest = web.render(web.html``, $filename); - if (opt.tooltip) components.tooltip($tooltip, opt.tooltip); - $input.addEventListener('change', (event) => { - const file = event.target.files[0], - reader = new FileReader(); - reader.onload = async (progress) => { - $filename.innerText = file.name; - await profileDB.set([mod.id, opt.key], { - filename: file.name, - content: progress.currentTarget.result, - }); - notifications.onChange(); - }; - reader.readAsText(file); - }); - $latest.addEventListener('click', (event) => { - $filename.innerText = 'none'; - profileDB.set([mod.id, opt.key], {}); - }); - return web.render( - web.html`
`, - web.render($label, $input, $pseudo, $icon), - $latest - ); - }, - hotkey: async (mod, opt) => { - const value = await profileDB.get([mod.id, opt.key], opt.value), - $tooltip = web.html`${await components.feather('info', { class: 'input-tooltip' })}`, - $label = web.render( - web.html``, - web.render(web.html`

`, opt.tooltip ? $tooltip : '', opt.label) - ), - $input = web.html``, - $icon = web.html`${await components.feather('command', { class: 'input-icon' })}`; - if (opt.tooltip) components.tooltip($tooltip, opt.tooltip); - $input.addEventListener('keydown', async (event) => { - event.preventDefault(); - const pressed = [], - modifiers = { - metaKey: 'Meta', - ctrlKey: 'Control', - altKey: 'Alt', - shiftKey: 'Shift', - }; - for (const modifier in modifiers) { - if (event[modifier]) pressed.push(modifiers[modifier]); - } - const empty = ['Backspace', 'Delete'].includes(event.key) && !pressed.length; - if (!empty && !pressed.includes(event.key)) { - let key = event.key; - if (key === ' ') key = 'Space'; - if (key.length === 1) key = event.key.toUpperCase(); - pressed.push(key); - } - $input.value = pressed.join('+'); - await profileDB.set([mod.id, opt.key], $input.value); - notifications.onChange(); - }); - return web.render($label, $input, $icon); - }, -}; diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/client.css b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/client.css deleted file mode 100644 index e21c00a..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/client.css +++ /dev/null @@ -1,69 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -.enhancer--sidebarMenuLink { - user-select: none; - -webkit-user-select: none; - transition: background 20ms ease-in 0s; - cursor: pointer; - color: var(--theme--text_secondary); -} -.enhancer--sidebarMenuLink:hover { - background: var(--theme--ui_interactive-hover); -} -.enhancer--sidebarMenuLink svg { - width: 16px; - height: 16px; - margin-left: 2px; -} -.enhancer--sidebarMenuLink > div { - display: flex; - align-items: center; - min-height: 27px; - font-size: 14px; - padding: 2px 14px; - width: 100%; -} -.enhancer--sidebarMenuLink > div > :first-child { - flex-shrink: 0; - flex-grow: 0; - border-radius: 3px; - width: 22px; - height: 22px; - display: flex; - align-items: center; - justify-content: center; - margin-right: 8px; -} -.enhancer--sidebarMenuLink > div > :nth-child(2) { - flex: 1 1 auto; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.enhancer--sidebarMenuLink[data-has-notifications] { - color: var(--theme--text); -} -.enhancer--sidebarMenuLink > div > .enhancer--notificationBubble { - display: flex; -} -.enhancer--sidebarMenuLink > div > .enhancer--notificationBubble > div { - display: inline-flex; - align-items: center; - justify-content: center; - width: 16px; - height: 16px; - font-size: 10px; - font-weight: 600; - border-radius: 3px; - color: var(--theme--accent_red-text); - background: var(--theme--accent_red); -} -.enhancer--sidebarMenuLink > div > .enhancer--notificationBubble > div > span { - margin-bottom: 1px; - margin-left: -0.5px; -} diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/client.mjs b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/client.mjs deleted file mode 100644 index bee0597..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/client.mjs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -export default async function (api, db) { - const { env, fs, storage, registry, web } = api; - - web.addHotkeyListener(await db.get(['hotkey']), env.focusMenu); - - const updateTheme = () => - storage.set(['theme'], document.querySelector('.notion-dark-theme') ? 'dark' : 'light'); - web.addDocumentObserver((mutation) => { - if (mutation.target === document.body && document.hasFocus()) updateTheme(); - }); - if (document.hasFocus()) updateTheme(); - document.addEventListener('visibilitychange', updateTheme); - - const sidebarSelector = '.notion-sidebar-container .notion-sidebar > div:nth-child(4)'; - await web.whenReady([sidebarSelector]); - - const $sidebarLink = web.html``; - $sidebarLink.addEventListener('click', env.focusMenu); - - const notifications = { - cache: await storage.get(['notifications'], []), - provider: [ - registry.welcomeNotification, - ...(await fs.getJSON('https://notion-enhancer.github.io/notifications.json')), - ], - count: (await registry.errors()).length, - }; - for (const notification of notifications.provider) { - if ( - !notifications.cache.includes(notification.id) && - notification.version === env.version && - (!notification.environments || notification.environments.includes(env.name)) - ) { - notifications.count++; - } - } - if (notifications.count) { - $sidebarLink.dataset.hasNotifications = true; - web.render( - $sidebarLink.children[0], - web.html`
${notifications.count}
` - ); - } - - web.render(document.querySelector(sidebarSelector), $sidebarLink); -} diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/markdown.css b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/markdown.css deleted file mode 100644 index dc41b90..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/markdown.css +++ /dev/null @@ -1,165 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -.markdown table { - border-spacing: 0; - border: 1px solid var(--theme--ui_divider); -} -.markdown table th { - text-align: left; -} -.markdown table th, -.markdown table td { - padding: 5px 8px 6px; - border: 1px solid var(--theme--ui_divider); -} -.markdown h1 { - font-size: 1.875rem; - margin: 1rem 0 0.5rem 0; -} -.markdown h2 { - font-size: 1.5rem; - margin: 1rem 0 0.5rem 0; -} -.markdown h3 { - font-size: 1.25rem; - margin: 1rem 0 0.5rem 0; -} -.markdown ul, -.markdown ol { - padding-left: 1.25rem; -} -.markdown li { - margin: 0.4rem 0; -} -.markdown ol li { - padding-left: 0.25rem; -} -.markdown blockquote { - border-left: 2px solid currentColor; - padding-left: 0.75rem; - margin: 0.5rem 0; -} -.markdown hr { - border: 0.5px solid var(--theme--ui_divider); -} -.markdown.markdown-inline a { - opacity: 0.7; - text-decoration: none; - border-bottom: 0.05em solid var(--theme--text_secondary); -} -.markdown.markdown-inline a:hover { - opacity: 0.9; -} - -.markdown :not(pre) > code, -.markdown-inline code { - padding: 0.2em 0.4em; - border-radius: 3px; - background: var(--theme--code_inline); - color: var(--theme--code_inline-text); -} -.markdown pre { - padding: 2em 1.25em; - border-radius: 3px; - tab-size: 2; - white-space: pre; - overflow-x: auto; - background: var(--theme--code); - color: var(--theme--code_plain); -} -.markdown pre, -.markdown.markdown-inline code { - font-family: var(--theme--font_code); - font-size: 0.796875rem; - text-align: left; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - hyphens: none; - line-height: 1.5; -} - -/* - * https://prismjs.com/plugins/inline-color/ - */ -.markdown .inline-color-wrapper { - /* - * base64 svg (https://stackoverflow.com/a/21626701/7595472 - prevents visual glitches) - * - * - * - * - */ - background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyIDIiPjxwYXRoIGZpbGw9ImdyYXkiIGQ9Ik0wIDBoMnYySDB6Ii8+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0wIDBoMXYxSDB6TTEgMWgxdjFIMXoiLz48L3N2Zz4='); - background-position: center; - background-size: 110%; - display: inline-block; - height: 1.333ch; - width: 1.333ch; - margin: 0 0.333ch; - box-sizing: border-box; - border: 0.5px solid var(--theme--code_plain); - overflow: hidden; -} -.markdown .inline-color { - display: block; - height: 120%; - width: 120%; -} - -/* - * https://prismjs.com/plugins/match-braces/ - */ -.markdown .token.punctuation.brace-hover, -.markdown .token.punctuation.brace-selected { - outline: solid 1px; -} - -/* - * https://prismjs.com/plugins/show-language/ - * https://prismjs.com/plugins/copy-to-clipboard/ - */ -.markdown .code-toolbar { - position: relative; -} -.markdown .code-toolbar .toolbar-item { - position: absolute; - top: 0.35rem; - display: inline-block; - transition: opacity 200ms ease-in-out; - opacity: 0; -} -.markdown .code-toolbar .toolbar-item:first-child { - left: 0.8rem; -} -.markdown .code-toolbar .toolbar-item:last-child { - right: 0.8rem; -} -.markdown .code-toolbar:hover .toolbar-item, -.markdown .code-toolbar:focus-within .toolbar-item { - opacity: 1; -} -.markdown .code-toolbar .toolbar-item > * { - padding: 0.25rem 0.35rem; - color: var(--theme--text_secondary); - font-size: 11px; - font-family: inherit; -} -.markdown .code-toolbar .toolbar-item .copy-to-clipboard-button { - border: none; - background: none; - cursor: pointer; - border-radius: 3px; - transition: background 100ms ease-in-out; -} -.markdown .code-toolbar .toolbar-item .copy-to-clipboard-button:hover { - background: var(--theme--button-hover); -} -.markdown .code-toolbar .toolbar-item .copy-to-clipboard-button svg { - width: 1em; - margin-right: 0.5em; -} diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.css b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.css deleted file mode 100644 index ecf5bee..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.css +++ /dev/null @@ -1,25 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -::selection { - background: var(--theme--accent_blue-selection); -} - -::-webkit-scrollbar { - width: 10px; - height: 10px; - background: transparent; -} -::-webkit-scrollbar-track, -::-webkit-scrollbar-corner { - background: var(--theme--scrollbar_track) !important; -} -::-webkit-scrollbar-thumb { - background: var(--theme--scrollbar_thumb) !important; -} -::-webkit-scrollbar-thumb:hover { - background: var(--theme--scrollbar_thumb-hover) !important; -} diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html deleted file mode 100644 index ec6337a..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - notion-enhancer menu - - - - - diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.mjs b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.mjs deleted file mode 100644 index e171d69..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.mjs +++ /dev/null @@ -1,370 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -import { env, fs, storage, registry, web, components } from '../../api/_.mjs'; -import { notifications } from './notifications.mjs'; -import { blocks, options } from './blocks.mjs'; -import './styles.mjs'; - -const db = await registry.db('a6621988-551d-495a-97d8-3c568bca2e9e'), - profileName = await registry.profileName(), - profileDB = await registry.profileDB(); - -for (const mod of await registry.list((mod) => registry.enabled(mod.id))) { - for (const sheet of mod.css?.menu || []) { - web.loadStylesheet(`repo/${mod._dir}/${sheet}`); - } -} - -web.addHotkeyListener(await db.get(['hotkey']), env.focusNotion); - -const loadTheme = async () => { - document.documentElement.className = - (await storage.get(['theme'], 'light')) === 'dark' ? 'dark' : ''; -}; -document.addEventListener('visibilitychange', loadTheme); -loadTheme(); - -window.addEventListener('beforeunload', (event) => { - // trigger input save - document.activeElement.blur(); -}); - -const $main = web.html`
`, - $sidebar = web.html``, - $options = web.html`
-

Select a mod to view and configure its options.

-
`, - $profile = web.html``; - -let _$profileConfig; -$profile.addEventListener('click', async (event) => { - for (const $selected of document.querySelectorAll('.mod-selected')) { - $selected.className = 'mod'; - } - if (!_$profileConfig) { - const profileNames = [ - ...new Set([ - ...Object.keys(await storage.get(['profiles'], { default: {} })), - profileName, - ]), - ], - $options = profileNames.map( - (profile) => web.raw`` - ), - $select = web.html``, - $edit = web.html``, - $export = web.html``, - $import = web.html``, - $save = web.html``, - $delete = web.html``, - $error = web.html`

`; - $export.addEventListener('click', async (event) => { - const now = new Date(), - $a = web.html``; - web.render(document.body, $a); - $a.click(); - $a.remove(); - }); - $import.addEventListener('change', (event) => { - const file = event.target.files[0], - reader = new FileReader(); - reader.onload = async (progress) => { - try { - const profileUpload = JSON.parse(progress.currentTarget.result); - if (!profileUpload) throw Error; - await storage.set(['profiles', $select.value], profileUpload); - env.reload(); - } catch { - web.render(web.empty($error), 'Invalid JSON uploaded.'); - } - }; - reader.readAsText(file); - }); - $select.addEventListener('change', async (event) => { - if ($select.value === '--') { - $edit.value = ''; - } else $edit.value = $select.value; - }); - $save.addEventListener('click', async (event) => { - if (profileNames.includes($edit.value) && $select.value !== $edit.value) { - web.render( - web.empty($error), - `The profile "${web.escape($edit.value)}" already exists.` - ); - return false; - } - if (!$edit.value) { - web.render(web.empty($error), 'Profile names cannot be empty.'); - return false; - } - if (!$edit.value.match(/^[A-Za-z0-9_-]+$/)) { - web.render( - web.empty($error), - 'Profile names can only contain letters, numbers, dashes and underscores.' - ); - return false; - } - await storage.set(['currentprofile'], $edit.value); - if ($select.value === '--') { - await storage.set(['profiles', $edit.value], {}); - } else if ($select.value !== $edit.value) { - await storage.set( - ['profiles', $edit.value], - await storage.get(['profiles', $select.value], {}) - ); - await storage.set(['profiles', $select.value], undefined); - } - env.reload(); - }); - $delete.addEventListener('click', async (event) => { - await storage.set(['profiles', $select.value], undefined); - await storage.set( - ['currentprofile'], - profileNames.find((profile) => profile !== $select.value) || 'default' - ); - env.reload(); - }); - - _$profileConfig = web.render( - web.html`
`, - web.html`

- Profiles are used to switch entire configurations. - Here they can be selected, renamed or deleted. - Profile names can only contain letters, numbers, - dashes and underscores.
- Be careful - deleting a profile deletes all configuration - related to it. -

`, - web.render( - web.html``, - $select, - web.html`${await components.feather('chevron-down', { class: 'input-icon' })}` - ), - web.render( - web.html``, - $edit, - web.html`${await components.feather('type', { class: 'input-icon' })}` - ), - web.render(web.html`

`, $export, $import, $save, $delete), - $error - ); - } - web.render(web.empty($options), _$profileConfig); -}); - -const _$modListCache = {}, - generators = { - options: async (mod) => { - const $fragment = document.createDocumentFragment(); - for (const opt of mod.options) { - web.render($fragment, await options[opt.type](mod, opt)); - } - if (!mod.options.length) { - web.render($fragment, web.html`

No options.

`); - } - return $fragment; - }, - mod: async (mod) => { - const $mod = web.html`
`, - $toggle = blocks.toggle('', await registry.enabled(mod.id)); - $toggle.addEventListener('change', async (event) => { - if (event.target.checked && mod.tags.includes('theme')) { - const mode = mod.tags.includes('light') ? 'light' : 'dark', - id = mod.id, - mods = await registry.list( - (mod) => - mod.environments.includes(env.name) && - mod.tags.includes('theme') && - mod.tags.includes(mode) && - mod.id !== id - ); - for (const mod of mods) { - profileDB.set(['_mods', mod.id], false); - document.querySelector( - `[data-id="${web.escape(mod.id)}"] .toggle-check` - ).checked = false; - } - } - profileDB.set(['_mods', mod.id], event.target.checked); - notifications.onChange(); - }); - $mod.addEventListener('click', async (event) => { - if ($mod.className === 'mod-selected') return; - for (const $selected of document.querySelectorAll('.mod-selected')) { - $selected.className = 'mod'; - } - $mod.className = 'mod-selected'; - const fragment = [ - web.render(blocks.title(mod.name), blocks.version(mod.version)), - blocks.tags(mod.tags), - await generators.options(mod), - ]; - web.render(web.empty($options), ...fragment); - }); - return web.render( - web.html`
`, - web.render( - $mod, - mod.preview - ? blocks.preview( - mod.preview.startsWith('http') - ? mod.preview - : fs.localPath(`repo/${mod._dir}/${mod.preview}`) - ) - : '', - web.render( - web.html`
`, - web.render(blocks.title(mod.name), blocks.version(mod.version)), - blocks.tags(mod.tags), - blocks.description(mod.description), - blocks.authors(mod.authors), - mod.environments.includes(env.name) && !registry.core.includes(mod.id) - ? $toggle - : '' - ) - ) - ); - }, - modList: async (category, message = '') => { - if (!_$modListCache[category]) { - const $search = web.html``, - $list = web.html`
`, - mods = await registry.list( - (mod) => mod.environments.includes(env.name) && mod.tags.includes(category) - ); - web.addHotkeyListener(['/'], () => $search.focus()); - $search.addEventListener('input', (event) => { - const query = $search.value.toLowerCase(); - for (const $mod of $list.children) { - const matches = !query || $mod.innerText.toLowerCase().includes(query); - $mod.classList[matches ? 'remove' : 'add']('hidden'); - } - }); - for (const mod of mods) { - mod.tags = mod.tags.filter((tag) => tag !== category); - web.render($list, await generators.mod(mod)); - mod.tags.unshift(category); - } - _$modListCache[category] = web.render( - web.html`
`, - web.render( - web.html``, - $search, - web.html`${await components.feather('search', { class: 'input-icon' })}` - ), - message ? web.html`

${web.escape(message)}

` : '', - $list - ); - } - return _$modListCache[category]; - }, - }; - -const $notionNavItem = web.html`

- ${(await fs.getText('icon/colour.svg')).replace( - /width="\d+" height="\d+"/, - `class="nav-notion-icon"` - )} - notion-enhancer -

`; -$notionNavItem.addEventListener('click', env.focusNotion); - -const $coreNavItem = web.html`core`, - $extensionsNavItem = web.html`extensions`, - $themesNavItem = web.html`themes`; - -web.render( - document.body, - web.render( - web.html`
`, - web.render( - web.html`
`, - web.render( - web.html``, - $notionNavItem, - $coreNavItem, - $extensionsNavItem, - $themesNavItem, - web.html`docs`, - web.html`community` - ), - $main - ), - web.render($sidebar, $profile, $options) - ) -); - -function selectNavItem($item) { - for (const $selected of document.querySelectorAll('.nav-item-selected')) { - $selected.className = 'nav-item'; - } - $item.className = 'nav-item-selected'; -} - -import * as router from './router.mjs'; - -router.addView('core', async () => { - web.empty($main); - selectNavItem($coreNavItem); - return web.render($main, await generators.modList('core')); -}); - -router.addView('extensions', async () => { - web.empty($main); - selectNavItem($extensionsNavItem); - return web.render($main, await generators.modList('extension')); -}); - -router.addView('themes', async () => { - web.empty($main); - selectNavItem($themesNavItem); - return web.render( - $main, - await generators.modList( - 'theme', - `Dark themes will only work when Notion is in dark mode, - and light themes will only work when Notion is in light mode. - Only one theme of each mode can be enabled at a time.` - ) - ); -}); - -router.loadView('extensions', $main); diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/mod.json b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/mod.json deleted file mode 100644 index 0aa7b7f..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/mod.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "menu", - "id": "a6621988-551d-495a-97d8-3c568bca2e9e", - "version": "0.11.0", - "description": "the enhancer's graphical menu, related buttons and shortcuts.", - "tags": ["core"], - "authors": [ - { - "name": "dragonwocky", - "email": "thedragonring.bod@gmail.com", - "homepage": "https://dragonwocky.me/", - "avatar": "https://dragonwocky.me/avatar.jpg" - } - ], - "css": { - "client": ["client.css"], - "menu": ["menu.css", "markdown.css"] - }, - "js": { - "client": ["client.mjs"] - }, - "options": [ - { - "type": "hotkey", - "key": "hotkey", - "label": "toggle focus hotkey", - "value": "Ctrl+Alt+E", - "tooltip": "switches between notion & the enhancer menu" - } - ] -} diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/notifications.mjs b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/notifications.mjs deleted file mode 100644 index 97e0f93..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/notifications.mjs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -import { env, fs, storage, fmt, registry, web, components } from '../../api/_.mjs'; -import { tw } from './styles.mjs'; - -export const notifications = { - $container: web.html`
`, - cache: await storage.get(['notifications'], []), - provider: [ - registry.welcomeNotification, - ...(await fs.getJSON('https://notion-enhancer.github.io/notifications.json')), - ], - async add({ icon, message, id = undefined, color = undefined, link = undefined }) { - const $notification = link - ? web.html`` - : web.html``, - resolve = async () => { - if (id !== undefined) { - notifications.cache.push(id); - await storage.set(['notifications'], notifications.cache); - } - $notification.remove(); - }; - $notification.addEventListener('click', resolve); - $notification.addEventListener('keyup', (event) => { - if (['Enter', ' '].includes(event.key)) resolve(); - }); - web.render( - notifications.$container, - web.render( - $notification, - web.html` - ${fmt.md.renderInline(message)} - `, - web.html`${await components.feather(icon, { class: 'notification-icon' })}` - ) - ); - return $notification; - }, - _onChange: false, - async onChange() { - if (this._onChange) return; - this._onChange = true; - const $notification = await this.add({ - icon: 'refresh-cw', - message: 'Reload to apply changes.', - }); - $notification.addEventListener('click', env.reload); - }, -}; -web.render(document.body, notifications.$container); -for (const notification of notifications.provider) { - if ( - !notifications.cache.includes(notification.id) && - notification.version === env.version && - (!notification.environments || notification.environments.includes(env.name)) - ) { - notifications.add(notification); - } -} - -const errors = await registry.errors(); -if (errors.length) { - console.log('[notion-enhancer] registry errors:'); - console.table(errors); - notifications.add({ - icon: 'alert-circle', - message: 'Failed to load mods (check console).', - color: 'red', - }); -} diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/router.mjs b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/router.mjs deleted file mode 100644 index 8a5e70e..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/router.mjs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -import { web } from '../../api/_.mjs'; - -let _defaultView = ''; -const _views = new Map(); - -export function addView(name, loadFunc) { - _views.set(name, loadFunc); -} -export function removeView(name) { - _views.delete(name); -} - -function router(event) { - event.preventDefault(); - const anchor = event.path - ? event.path.find((anchor) => anchor.nodeName === 'A') - : event.target; - if (location.search !== anchor.getAttribute('href')) { - window.history.pushState(null, null, anchor.href); - loadView(); - } -} -function navigator(event) { - event.preventDefault(); - const anchor = event.path - ? event.path.find((anchor) => anchor.nodeName === 'A') - : event.target, - hash = anchor.getAttribute('href').slice(1); - document.getElementById(hash).scrollIntoView(true); - document.documentElement.scrollTop = 0; - history.replaceState({ search: location.search, hash }, null, `#${hash}`); -} - -export async function loadView(defaultView = null) { - if (defaultView) _defaultView = defaultView; - if (!_defaultView) throw new Error('no view root set.'); - - const query = web.queryParams(), - fallbackView = () => { - window.history.replaceState(null, null, `?view=${_defaultView}`); - return loadView(); - }; - if (!query.get('view') || document.body.dataset.view !== query.get('view')) { - if (_views.get(query.get('view'))) { - await _views.get(query.get('view'))(); - } else return fallbackView(); - } else return fallbackView(); -} - -window.addEventListener('popstate', (event) => { - if (event.state) loadView(); - document.getElementById(location.hash.slice(1))?.scrollIntoView(true); - document.documentElement.scrollTop = 0; -}); -web.addDocumentObserver((mutation) => { - mutation.target.querySelectorAll('a[href^="?"]').forEach((a) => { - a.removeEventListener('click', router); - a.addEventListener('click', router); - }); - mutation.target.querySelectorAll('a[href^="#"]').forEach((a) => { - a.removeEventListener('click', navigator); - a.addEventListener('click', navigator); - }); -}); diff --git a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/styles.mjs b/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/styles.mjs deleted file mode 100644 index 22e0604..0000000 --- a/repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/styles.mjs +++ /dev/null @@ -1,157 +0,0 @@ -/* - * notion-enhancer core: menu - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -// css-in-js for better component generation - -import { tw, apply, setup } from '../../dep/twind.mjs'; -import { content } from '../../dep/twind-content.mjs'; -const pseudoContent = content('""'); - -const mapColorVariables = (color) => ({ - 'text': `var(--theme--text_${color})`, - 'highlight': `var(--theme--highlight_${color})`, - 'highlight-text': `var(--theme--highlight_${color}-text)`, - 'block': `var(--theme--block_${color})`, - 'block-text': `var(--theme--block_${color}-text)`, - 'tag': `var(--theme--tag_${color})`, - 'tag-text': `var(--theme--tag_${color}-text)`, - 'callout': `var(--theme--callout_${color})`, - 'callout-text': `var(--theme--callout_${color}-text)`, -}); - -const customClasses = { - 'notifications-container': apply`absolute bottom-0 right-0 px-4 py-3 max-w-full w-96`, - 'notification': ([color = 'default']) => - apply`p-2 ${ - color === 'default' - ? 'bg-tag text-tag-text hover:bg-interactive-hover border border-divider' - : `bg-${color}-tag text-${color}-tag-text border border-${color}-text hover:bg-${color}-text` - } flex items-center rounded-full mt-3 shadow-md cursor-pointer`, - 'notification-text': apply`font-semibold text-xs mx-2 flex-auto`, - 'notification-icon': apply`fill-current opacity-75 h-4 w-4 mx-2`, - 'body-container': apply`flex w-full h-full overflow-hidden`, - 'content-container': apply`h-full w-full-96`, - 'nav': apply`px-4 py-3 flex flex-wrap items-center border-b border-divider h-64 sm:h-48 md:h-32 lg:h-16`, - 'nav-notion': apply`flex items-center font-semibold text-xl cursor-pointer select-none mr-4 - ml-4 sm:mb-4 md:w-full lg:(w-auto ml-0 mb-0)`, - 'nav-notion-icon': apply`h-12 w-12 mr-5 sm:(h-6 w-6 mr-3)`, - 'nav-item': apply`ml-4 px-3 py-2 rounded-md text-sm font-medium hover:bg-interactive-hover focus:bg-interactive-active`, - 'nav-item-selected': apply`ml-4 px-3 py-2 rounded-md text-sm font-medium ring-1 ring-divider bg-notion-secondary`, - 'main': apply`transition px-4 py-3 overflow-y-auto max-h-full-64 sm:max-h-full-48 md:max-h-full-32 lg:max-h-full-16`, - 'main-message': apply`mx-2.5 my-2.5 px-px text-sm text-foreground-secondary text-justify`, - 'mods-list': apply`flex flex-wrap`, - 'mod-container': apply`w-full md:w-1/2 lg:w-1/3 xl:w-1/4 2xl:w-1/5 px-2.5 py-2.5 box-border`, - 'mod': apply`relative h-full w-full flex flex-col overflow-hidden rounded-lg shadow-lg - bg-notion-secondary border border-divider cursor-pointer`, - 'mod-selected': apply`mod ring ring-accent-blue-focus`, - 'mod-body': apply`px-4 py-3 flex flex-col flex-auto children:cursor-pointer`, - 'mod-preview': apply`object-cover w-full h-32`, - 'mod-title': apply`mb-2 text-xl font-semibold tracking-tight flex items-center`, - 'mod-version': apply`mt-px ml-3 p-1 font-normal text-xs leading-none bg-tag text-tag-text rounded`, - 'mod-tags': apply`text-foreground-secondary mb-2 text-xs`, - 'mod-description': apply`mb-2 text-sm`, - 'mod-authors-container': apply`text-sm font-medium`, - 'mod-author': apply`flex items-center mb-2`, - 'mod-author-avatar': apply`inline object-cover w-5 h-5 rounded-full mr-2`, - 'sidebar': apply`h-full w-96 px-4 pt-3 pb-32 flex flex-col bg-notion-secondary border-l border-divider`, - 'profile-trigger': apply`block px-4 py-3 mb-2 rounded-md text-sm text-left font-semibold shadow-inner - bg-accent-red-hover border border-accent-red text-accent-red focus:(outline-none ring ring-inset ring-accent-red)`, - 'profile-actions': apply`flex`, - 'profile-save': apply`text-sm px-3 py-2 font-medium mt-2 bg-accent-blue text-accent-blue-text rounded-md flex-grow - hover:bg-accent-blue-hover focus:(bg-accent-blue-focus outline-none) text-center`, - 'profile-delete': apply`text-sm px-3 py-2 font-medium ml-3 mt-2 bg-red-tag text-red-tag-text rounded-md flex-grow - border border-red-text hover:bg-red-text focus:(outline-none bg-red-text) text-center`, - 'profile-export': apply`profile-save mr-2`, - 'profile-import': apply`profile-save mr-2`, - 'profile-error': apply`text-xs mt-2 text-red-text`, - 'profile-icon-action': apply`w-4 h-4 -mt-1 inline-block`, - 'profile-icon-text': apply`w-4 h-4 -mt-1 inline-block mr-1`, - 'options-container': apply`px-4 py-3 shadow-inner rounded-lg bg-notion border border-divider space-y-3`, - 'options-placeholder': apply`text-sm text-foreground-secondary`, - 'toggle-box': apply`w-9 h-5 p-0.5 flex items-center bg-toggle-off rounded-full duration-300 ease-in-out cursor-pointer`, - 'toggle-label': apply`relative text-sm flex w-full mt-auto`, - 'toggle-check': apply`appearance-none ml-auto checked:sibling:(bg-toggle-on after::translate-x-4)`, - 'toggle-feature': apply`after::(${pseudoContent} w-4 h-4 bg-toggle-feature rounded-full duration-300) cursor-pointer`, - 'input-label': apply`block text-sm mt-2 relative`, - 'input': apply`transition block w-full mt-2 pl-3 pr-14 py-2 text-sm rounded-md flex bg-input text-foreground - appearance-none placeholder-foreground-secondary ring-1 ring-divider focus:(outline-none ring ring-accent-blue-focus)`, - 'input-tooltip': apply`h-4 w-4 -mt-1 inline-block mr-2`, - 'input-icon': apply`absolute w-11 h-9 right-0 bottom-0 py-2 px-3 bg-notion-secondary rounded-r-md text-icon`, - 'input-placeholder': apply`text-foreground-secondary`, - 'select-option': apply`bg-notion-secondary`, - 'file-latest': apply`block w-full text-left text-foreground-secondary text-xs mt-2 hover:line-through cursor-pointer`, - 'search-container': apply`block mx-2.5 my-2.5 relative`, - 'search': apply`input pr-12`, -}; - -setup({ - preflight: { - html: apply`w-full h-full`, - body: apply`w-full h-full bg-notion font-sans text-foreground`, - }, - theme: { - fontFamily: { - sans: ['var(--theme--font_sans)'], - mono: ['var(--theme--font_mono)'], - }, - colors: { - 'notion': 'var(--theme--bg)', - 'notion-secondary': 'var(--theme--bg_secondary)', - 'notion-popup': 'var(--theme--bg_popup)', - 'divider': 'var(--theme--ui_divider)', - 'input': 'var(--theme--ui_input)', - 'icon': 'var(--theme--icon)', - 'icon-secondary': 'var(--theme--icon_secondary)', - 'foreground': 'var(--theme--text)', - 'foreground-secondary': 'var(--theme--text_secondary)', - 'interactive-hover': 'var(--theme--ui_interactive-hover)', - 'interactive-active': 'var(--theme--ui_interactive-active)', - 'tag': 'var(--theme--tag_default)', - 'tag-text': 'var(--theme--tag_default-text)', - 'toggle': { - 'on': 'var(--theme--ui_toggle-on)', - 'off': 'var(--theme--ui_toggle-off)', - 'feature': 'var(--theme--ui_toggle-feature)', - }, - 'accent': { - 'blue': 'var(--theme--accent_blue)', - 'blue-hover': 'var(--theme--accent_blue-hover)', - 'blue-focus': 'var(--theme--accent_blue-focus)', - 'blue-text': 'var(--theme--accent_blue-text)', - 'red': 'var(--theme--accent_red)', - 'red-hover': 'var(--theme--accent_red-hover)', - 'red-text': 'var(--theme--accent_red-text)', - }, - 'grey': mapColorVariables('grey'), - 'brown': mapColorVariables('brown'), - 'orange': mapColorVariables('orange'), - 'yellow': mapColorVariables('yellow'), - 'green': mapColorVariables('green'), - 'blue': mapColorVariables('blue'), - 'purple': mapColorVariables('purple'), - 'pink': mapColorVariables('pink'), - 'red': mapColorVariables('red'), - }, - extend: { - width: { - 'full-96': 'calc(100% - 24rem)', - }, - maxHeight: { - 'full-16': 'calc(100% - 4rem)', - 'full-32': 'calc(100% - 8rem)', - 'full-48': 'calc(100% - 12rem)', - 'full-64': 'calc(100% - 16rem)', - }, - }, - }, - plugins: customClasses, -}); - -tw`hidden ${Object.keys(customClasses).join(' ')}`; - -export { tw }; diff --git a/repo/registry.json b/repo/registry.json deleted file mode 100644 index 7977fb3..0000000 --- a/repo/registry.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "menu@a6621988-551d-495a-97d8-3c568bca2e9e", - "theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082", - "components@36a2ffc9-27ff-480e-84a7-c7700a7d232d", - "tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2", - "bypass-preview@cb6fd684-f113-4a7a-9423-8f0f0cff069f", - "calendar-scroll@b1c7db33-dfee-489a-a76c-0dd66f7ed29a" -] diff --git a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/client.mjs b/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/client.mjs deleted file mode 100644 index 4ec6ac3..0000000 --- a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/client.mjs +++ /dev/null @@ -1,20 +0,0 @@ -/* - * notion-enhancer core: theming - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -export default function (api, db) { - const { web } = api; - - const updateTheme = () => - document.documentElement.classList[ - document.body.classList.contains('dark') ? 'add' : 'remove' - ]('dark'); - updateTheme(); - web.addDocumentObserver((mutation) => { - if (mutation.target === document.body) updateTheme(); - }); -} diff --git a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/mod.json b/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/mod.json deleted file mode 100644 index 27b6db1..0000000 --- a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/mod.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "theming", - "id": "0f0bf8b6-eae6-4273-b307-8fc43f2ee082", - "version": "0.11.0", - "description": "the default theme variables, required by other themes & extensions.", - "tags": ["core"], - "authors": [ - { - "name": "dragonwocky", - "email": "thedragonring.bod@gmail.com", - "homepage": "https://dragonwocky.me/", - "avatar": "https://dragonwocky.me/avatar.jpg" - } - ], - "css": { - "frame": ["variables.css"], - "client": ["variables.css", "prism.css", "theme.css"], - "menu": ["variables.css", "prism.css"] - }, - "js": { - "client": ["client.mjs"] - }, - "options": [] -} diff --git a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/prism.css b/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/prism.css deleted file mode 100644 index 6d9ae4f..0000000 --- a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/prism.css +++ /dev/null @@ -1,156 +0,0 @@ -/* - * notion-enhancer core: theming - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -.token.property { - color: var(--theme--code_property) !important; -} -.token.tag { - color: var(--theme--code_tag) !important; -} -.token.boolean { - color: var(--theme--code_boolean) !important; -} -.token.number { - color: var(--theme--code_number) !important; -} -.token.constant { - color: var(--theme--code_constant) !important; -} -.token.symbol { - color: var(--theme--code_symbol) !important; -} -.token.deleted { - color: var(--theme--code_deleted) !important; -} -.token.selector { - color: var(--theme--code_selector) !important; -} -.token.attr-name { - color: var(--theme--code_attr-name) !important; -} -.token.string { - color: var(--theme--code_string) !important; -} -.token.char { - color: var(--theme--code_char) !important; -} -.token.builtin { - color: var(--theme--code_builtin) !important; -} -.token.inserted { - color: var(--theme--code_inserted) !important; -} -.token.operator { - color: var(--theme--code_operator) !important; -} -.token.entity { - color: var(--theme--code_entity) !important; -} -.token.url { - color: var(--theme--code_url) !important; -} -.token.variable { - color: var(--theme--code_variable) !important; -} -.token.comment { - color: var(--theme--code_comment) !important; -} -.token.cdata { - color: var(--theme--code_cdata) !important; -} -.token.prolog { - color: var(--theme--code_prolog) !important; -} -.token.doctype { - color: var(--theme--code_doctype) !important; -} -.token.atrule { - color: var(--theme--code_atrule) !important; -} -.token.attr-value { - color: var(--theme--code_attr-value) !important; -} -.token.keyword { - color: var(--theme--code_keyword) !important; -} -.token.regex { - color: var(--theme--code_regex) !important; -} -.token.important { - color: var(--theme--code_important) !important; -} -.token.function { - color: var(--theme--code_function) !important; -} -.token.class-name { - color: var(--theme--code_class-name) !important; -} -.token.parameter { - color: var(--theme--code_parameter) !important; -} -.token.decorator { - color: var(--theme--code_decorator) !important; -} -.token.id { - color: var(--theme--code_id) !important; -} -.token.class { - color: var(--theme--code_class) !important; -} -.token.pseudo-element { - color: var(--theme--code_pseudo-element) !important; -} -.token.pseudo-class { - color: var(--theme--code_pseudo-class) !important; -} -.token.attribute { - color: var(--theme--code_attribute) !important; -} -.token.value { - color: var(--theme--code_value) !important; -} -.token.unit { - color: var(--theme--code_unit) !important; -} -.token.punctuation { - color: var(--theme--code_punctuation) !important; - opacity: 0.7 !important; -} -.token.annotation { - color: var(--theme--code_annotation) !important; -} - -.token.operator { - background: transparent !important; -} -.token.namespace { - opacity: 0.7 !important; -} -.token.important, -.token.bold { - font-weight: bold !important; -} -.token.italic { - font-style: italic !important; -} -.token.entity { - cursor: help !important; -} -.token a { - color: inherit !important; -} -.token.punctuation.brace-hover, -.token.punctuation.brace-selected { - outline: solid 1px !important; -} - -.token.operator, -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string { - background: none !important; -} diff --git a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/theme.css b/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/theme.css deleted file mode 100644 index 7a4f74f..0000000 --- a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/theme.css +++ /dev/null @@ -1,1352 +0,0 @@ -/* - * notion-enhancer core: theming - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -/** layout **/ - -.notion-frame .notion-scroller [style*='env(safe-area-inset-'][style*=' width: 900px'], -.notion-frame .notion-scroller [style*='env(safe-area-inset-'][style*=';width: 900px'], -.notion-frame - .notion-scroller - [style*='height: 30vh'] - [style*='pointer-events:'][style*='max-width: 100%; width: 900px'] { - width: var(--theme--page-width) !important; -} -.notion-frame .notion-scroller [style*='env(safe-area-inset-'][style*=' width: 100%'], -.notion-frame - .notion-scroller - [style*='height: 30vh'] - [style*='pointer-events:'][style*='max-width: 100%; width: 100%'] { - width: var(--theme--page-width_full) !important; -} -.notion-frame - [style*='padding-left: calc(96px + env(safe-area-inset-left)); padding-right: calc(96px + env(safe-area-inset-right));'] { - padding-left: var(--theme--page-padding) !important; - padding-right: var(--theme--page-padding) !important; -} -[style^='position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; height: 30vh;'], -[style^='position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; height: 30vh;'] - img { - height: var(--theme--page_banner-height) !important; -} - -.notion-peek-renderer > :nth-child(2) { - max-width: var(--theme--page_preview-width) !important; -} - -.notion-peek-renderer - .notion-scroller.vertical - [style*='padding-left: calc(126px + env(safe-area-inset-left));'] { - padding-left: var(--theme--page_preview-padding) !important; -} -.notion-peek-renderer - .notion-scroller.vertical - [style*='padding-right: calc(126px + env(safe-area-inset-right));'] { - padding-right: var(--theme--page_preview-padding) !important; -} -.notion-peek-renderer - .notion-scroller.vertical - [style*='margin-left: calc(126px + env(safe-area-inset-left));'] { - margin-left: var(--theme--page_preview-padding) !important; -} -.notion-peek-renderer - .notion-scroller.vertical - [style*='margin-right: calc(126px + env(safe-area-inset-right));'] { - margin-right: var(--theme--page_preview-padding) !important; -} -.notion-peek-renderer .notion-page-content { - padding-left: var(--theme--page_preview-padding) !important; - padding-right: var(--theme--page_preview-padding) !important; - width: 100%; -} -.notion-peek-renderer - .notion-scroller.vertical - [style*='position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; height: 20vh;'], -.notion-peek-renderer - .notion-scroller.vertical - [style*='position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; height: 20vh;'] - img { - height: var(--theme--page_preview_banner-height) !important; -} - -/* backgrounds */ - -body, -.notion-cursor-listener, -.notion-frame, -.notion-timeline-view, -.notion-cursor-listener > div > :first-child[style*='z-index: 100;'], -.notion-space-settings > div > div > div:nth-child(2) > div, -.notion-body.dark .notion-collection_view_page-block > [style*='background: rgb(47, 52, 55)'], -.notion-body.dark .notion-collection_view_page-block[style*='background: rgb(47, 52, 55)'], -.notion-body:not(.dark) .notion-collection_view_page-block > [style*='background: white'], -.notion-body:not(.dark) .notion-collection_view_page-block[style*='background: white'], -.notion-body.dark .notion-collection_view-block > [style*='background: rgb(47, 52, 55)'], -.notion-body.dark .notion-collection_view-block[style*='background: rgb(47, 52, 55)'], -.notion-body:not(.dark) .notion-collection_view-block > [style*='background: white'], -.notion-body:not(.dark) .notion-collection_view-block[style*='background: white'], -.notion-body.dark .notion-timeline-view [style*='background: rgb(47, 52, 55)'], -.notion-body:not(.dark) - .notion-timeline-view - [style*='background: white']:not(.notion-timeline-item), -.notion-body:not(.dark) .notion-timeline-view [style*='background: rgb(253, 253, 253);'], -.notion-updates-menu footer > div[style*='background'], -:not(.notion-sidebar-container) > div > div > .notion-sidebar > :nth-child(2), -:not(.notion-sidebar-container) > div > div > .notion-sidebar > :nth-child(3), -:not(.notion-sidebar-container) > div > div > .notion-sidebar > :nth-child(3) > :nth-child(2), -.notion-peek-renderer > div[style*='background'], -.notion-peek-renderer > div[style*='background'] > :first-child, -.notion-peek-renderer > div[style*='background'] > :first-child > div > :nth-child(3), -.notion-page-template-modal { - background: var(--theme--bg) !important; -} -.notion-timeline-item-row + div > div > div, -.notion-timeline-view > :nth-child(2) > :first-child > div > div { - border: 1px solid var(--theme--bg) !important; - background: var(--theme--ui_toggle-off) !important; -} -.notion-timeline-item-row + div > div > div svg, -.notion-timeline-view > :nth-child(2) > :first-child > div > div svg { - fill: var(--theme--bg) !important; -} - -.notion-sidebar-container, -.notion-sidebar > [style*='border-top-right-radius'], -.notion-space-settings > div > div > div:first-child, -.notion-body.dark .notion-collection_view_page-block [style*='background: rgb(55, 60, 63)'], -.notion-body:not(.dark) - .notion-collection_view_page-block - [style*='background: rgb(247, 246, 243)'], -.notion-body.dark .notion-collection_view-block [style*='background: rgb(55, 60, 63)'], -.notion-body:not(.dark) - .notion-collection_view-block - [style*='background: rgb(247, 246, 243)'], -.notion-body.dark .notion-timeline-view [style*='background: rgb(55, 60, 63)'], -.notion-body:not(.dark) .notion-timeline-view [style*='background: rgb(247, 246, 243)'], -.notion-space-settings - > div - > div - > div:nth-child(2) - table - td[style*='background:']:not([style*='background: transparent']), -.notion-timeline-view > :first-child > div, -.notion-body:not(.dark) - .notion-timeline-view - > div - > div - > [style*='background: rgb(247, 247, 247); border-radius: 11px;'], -.notion-page-template-modal > :last-child, -.notion-page-template-modal > :last-child > div > :last-child { - background: var(--theme--bg_secondary) !important; -} - -.notion-default-overlay-container - [style*='position: absolute; inset: 0px; background: rgba(15, 15, 15, 0.6);']:empty { - background: var(--theme--ui_shadow) !important; -} - -.notion-overlay-container.notion-default-overlay-container - [style*='display: flex'] - > [style*='position: relative; max-width:'][style*='overflow: hidden']:not([style*='border-radius: 3px;'][style*='position: relative; max-width: calc(100vw - 24px); box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px; overflow: hidden;'][style*='padding: 4px 8px; font-size: 12px; line-height: 1.4; font-weight: 500;']), -.notion-overlay-container.notion-default-overlay-container - [style*='display: flex'] - > [style*='position: relative; max-width:'][style*='overflow: hidden'] - footer - > [style*='background-color:'], -.notion-updates-menu > :first-child > div[style*='background'], -#notion-app - > div - > div.notion-overlay-container.notion-default-overlay-container - > div:nth-child(2) - > div - > div:nth-child(2)[style*='margin-bottom: 0px; top: 90px; overflow: hidden; width: 75%;'], -.notion-default-overlay-container - > div - > div:not(.notion-peek-renderer) - > [style*='box-shadow'], -.notion-page-block.notion-collection-item > a[style*='background:'], -[style*='z-index:'][style*='box-shadow: '][style*='font-size: 12px;'][style*='min-height: 24px; overflow: hidden; pointer-events:'], -.notion-focusable[role='button'][tabindex='0'][style*='box-shadow:'][style*='background:'][style*='transition: background 20ms ease-in 0s; cursor: pointer;']:not([style*='rgb(46, 170, 220);']):not([style*='rgb(6, 156, 205);']):not([style*='rgb(0, 141, 190);']):not([style*='flex: 1 1 0%; white-space: nowrap; height: 26px; border-radius: 3px 0px 0px 3px;']), -.notion-text-action-menu > div > div, -.notion-default-overlay-container - [style*='min-width: 300px;'] - [style*='width: 240px'] - > .notion-focusable:not(:hover), -.notion-transclusion_reference-block > div > div > :nth-child(3), -.notion-transclusion_container-block > div > div > :nth-child(3), -.notion-page-block > div > div > div > .notion-focusable:not(:hover) { - background: var(--theme--bg_popup) !important; - box-shadow: var(--theme--ui_shadow, rgba(15, 15, 15, 0.05)) 0px 0px 0px 1px, - var(--theme--ui_shadow, rgba(15, 15, 15, 0.1)) 0px 3px 6px, - var(--theme--ui_shadow, rgba(15, 15, 15, 0.2)) 0px 9px 24px !important; -} - -.notion-media-menu > div > div > div[style*='background'], -.notion-media-menu > div > div > div > div[style*='background']:not(.notion-focusable), -.notion-body.dark - .notion-default-overlay-container - [style*='grid-template-columns: [boolean-start] 60px [boolean-end property-start] 120px [property-end opererator-start] 110px [operator-end value-start] auto [value-end menu-start] 32px [menu-end];'], -.notion-focusable[style*='background: rgb(80, 85, 88);'], -.notion-body:not(.dark) - .notion-default-overlay-container - [style*='grid-template-columns: [boolean-start] 60px [boolean-end property-start] 120px [property-end opererator-start] 110px [operator-end value-start] auto [value-end menu-start] 32px [menu-end];'] - .notion-focusable[style*='background: white;'], -.notion-timeline-item { - background: var(--theme--bg_popup) !important; -} - -.notion-discussion-input > div > div[style*='background'], -.notion-body.dark - .notion-default-overlay-container - [style*='grid-template-columns: [boolean-start] 60px [boolean-end property-start] 120px [property-end opererator-start] 110px [operator-end value-start] auto [value-end menu-start] 32px [menu-end];'] - [style*='grid-column: property-start / value-end; background: rgba(255, 255, 255, 0.02);'], -.notion-body:not(.dark) - .notion-default-overlay-container - [style*='grid-template-columns: [boolean-start] 60px [boolean-end property-start] 120px [property-end opererator-start] 110px [operator-end value-start] auto [value-end menu-start] 32px [menu-end];'] - [style*='grid-column: property-start / value-end; background: rgba(0, 0, 0, 0.02);'], -.notion-board-view [style*='width: 20px; margin-left: -20px; margin-top: -8px;'], -.notion-page-block > div > div > div[style*='background-color: white;'], -.line-numbers.notion-code-block + div .notion-focusable:not(:hover), -.notion-overlay-container - [style*='position: relative; max-width: calc(100vw - 24px); box-shadow:'] - > [style*='display: flex; align-items: center; padding: 8px 10px; width: 100%; background:'], -.notion-default-overlay-container - > div:nth-child(3) - > div - > div:nth-child(2) - > div:nth-child(2) - > div - > div - > div - > div - > div - > div:nth-child(2)[style*='position: absolute; display: inline-flex; min-width: 100%; height: 32px; z-index: 1; background:'], -.notion-default-overlay-container - > div:nth-child(2) - > div - > div:nth-child(2) - > div:nth-child(2) - > div - > div - > div - > div - > div - > div:nth-child(2)[style*='position: absolute; display: inline-flex; min-width: 100%; height: 32px; z-index: 1; background:'] { - background: transparent !important; -} - -.notion-timeline-view - > div - > div - > [style*='height: 100%; background-image: linear-gradient(to right, '] { - background-image: linear-gradient( - to right, - var(--theme--bg) 20%, - transparent 100% - ) !important; -} -.notion-timeline-view - > div - > div - > [style*='height: 100%; background-image: linear-gradient(to left, '] { - background-image: linear-gradient( - to left, - var(--theme--bg) 20%, - transparent 100% - ) !important; -} - -/** scrollbars **/ - -::-webkit-scrollbar-track, -::-webkit-scrollbar-corner { - background: var(--theme--scrollbar_track) !important; -} -::-webkit-scrollbar-thumb { - background: var(--theme--scrollbar_thumb) !important; -} -::-webkit-scrollbar-thumb:hover { - background: var(--theme--scrollbar_thumb-hover) !important; -} - -/** typography **/ - -[style*='Segoe UI'] { - font-family: var(--theme--font_sans) !important; -} -[style*='Georgia'] { - font-family: var(--theme--font_serif) !important; -} -[style*='iawriter-mono'] { - font-family: var(--theme--font_mono) !important; -} -[style*='SFMono-Regular'] { - font-family: var(--theme--font_code) !important; -} -.notion-selectable.notion-quote-block div[spellcheck='true'] { - font-family: var(--theme--font_quote) !important; -} -[placeholder='Heading 1'], -[placeholder='Heading 2'], -[placeholder='Heading 3'] { - font-family: var(--theme--font_headings) !important; -} - -/** ui **/ - -.notion-page-mention-token.notion-enable-hover:hover { - box-shadow: 0 0 0 3px var(--theme--ui_interactive-hover) !important; - background: var(--theme--ui_interactive-hover) !important; -} - -.notion-to_do-block [style*='background: rgb(46, 170, 220);'], -.notion-focusable - > [style*='width: 16px; height: 16px;'][style*='background: rgb(46, 170, 220);'], -.notion-focusable > [style*='border-radius: 44px;'][style*='background: rgb(46, 170, 220);'] { - background: var(--theme--ui_toggle-on) !important; -} -.notion-body.dark - .notion-focusable - > [style*='border-radius: 44px;'][style*='background: rgba(202, 204, 206, 0.3);'], -.notion-body:not(.dark) - .notion-focusable - > [style*='border-radius: 44px;'][style*='background: rgba(135, 131, 120, 0.3);'] { - background: var(--theme--ui_toggle-off) !important; -} - -.notion-focusable - > [style*='width: 16px; height: 16px;'][style*='background: rgb(46, 170, 220);'] - .check, -.notion-to_do-block .checkboxSquare[style*='fill: inherit'], -.notion-to_do-block .check { - fill: var(--theme--ui_toggle-feature) !important; -} -.notion-focusable > [style*='border-radius: 44px;'] > div:empty { - background: var(--theme--ui_toggle-feature) !important; -} - -.notion-body.dark [style*='background: rgb(71, 76, 80);'], -.notion-body:not(.dark) [style*='background: rgba(55, 53, 47, 0.08)'], -.notion-focusable[style*='z-index:'][style*='box-shadow: '][style*='font-size: 12px;'][style*='min-height: 24px; overflow: hidden; pointer-events:']:hover, -.notion-focusable[role='button'][tabindex='0'][style*='box-shadow:'][style*='background:'][style*='transition: background 20ms ease-in 0s; cursor: pointer;']:not([style*='rgb(6, 156, 205);']):not([style*='rgb(0, 141, 190);']):hover, -[style*='z-index:'][style*='box-shadow: '][style*='font-size: 12px;'][style*='min-height: 24px; overflow: hidden; pointer-events:'] - > .notion-focusable[style*='background']:hover, -.notion-body:not(.dark) - .notion-default-overlay-container - [style*='grid-template-columns: [boolean-start] 60px [boolean-end property-start] 120px [property-end opererator-start] 110px [operator-end value-start] auto [value-end menu-start] 32px [menu-end];'] - .notion-focusable[style*='background: rgb(239, 239, 238);'], -.line-numbers.notion-code-block + div .notion-focusable:hover { - background: var(--theme--ui_interactive-hover) !important; -} -.notion-body.dark .notion-focusable[role='button'][style*='background: rgb(63, 68, 71);'], -.notion-body:not(.dark) - .notion-focusable[role='button'][style*='background: rgba(55, 53, 47, 0.16)'], -[style*='z-index:'][style*='box-shadow: '][style*='font-size: 12px;'][style*='min-height: 24px; overflow: hidden; pointer-events:'] - > .notion-focusable[style*='background']:active, -.notion-body:not(.dark) - .notion-default-overlay-container - [style*='grid-template-columns: [boolean-start] 60px [boolean-end property-start] 120px [property-end opererator-start] 110px [operator-end value-start] auto [value-end menu-start] 32px [menu-end];'] - .notion-focusable[style*='background: rgb(223, 223, 222);'] { - background: var(--theme--ui_interactive-active) !important; -} - -.notion-focusable-within, -.notion-share-menu - .notion-block-permission-settings-public-access - + div - > div - > div - > div - > div - > .notion-focusable:first-child[role='button'][tabindex='0'][style*='user-select: none;'], -.notion-overlay-container - > div:nth-child(2) - > div - > div:nth-child(2) - > div:nth-child(2) - > div - > div - > div - > div - > div - > div:nth-child(1)[style*='display: flex; width: 100%; position: relative; z-index: 2; padding: 6px 10px; font-size: 14px; background:'], -.notion-overlay-container - > div:nth-child(3) - > div - > div:nth-child(2) - > div:nth-child(2) - > div - > div - > div - > div - > div - > div:nth-child(1)[style*='display: flex; width: 100%; position: relative; z-index: 2; padding: 6px 10px; font-size: 14px; background:'] { - background: var(--theme--ui_input) !important; -} - -.notion-overlay-container - [style*='border-radius: 3px;'][style*='position: relative; max-width: calc(100vw - 24px); box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px; overflow: hidden;'][style*='padding: 4px 8px; font-size: 12px; line-height: 1.4; font-weight: 500;'] { - background: var(--theme--ui_tooltip) !important; - box-shadow: var(--theme--ui_shadow) 0px 1px 4px !important; - color: var(--theme--ui_tooltip-title) !important; -} -.notion-overlay-container - [style*='border-radius: 3px;'][style*='position: relative; max-width: calc(100vw - 24px); box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px; overflow: hidden;'][style*='padding: 4px 8px; font-size: 12px; line-height: 1.4; font-weight: 500;'] - [style*='color: '] { - color: var(--theme--ui_tooltip-description) !important; -} - -.notion-help-button { - background: var(--theme--tag_default) !important; - box-shadow: var(--theme--ui_shadow, rgba(15, 15, 15, 0.15)) 0px 0px 0px 1px, - var(--theme--ui_shadow, rgba(15, 15, 15, 0.15)) 0px 2px 4px !important; -} - -.notion-body.dark - [style*='border-radius: 20px; box-shadow: rgba(255, 255, 255, 0.07) 0px 0px 0px 2px inset;'], -.notion-body:not(.dark) - [style*='border-radius: 20px; box-shadow: rgba(55, 53, 47, 0.09) 0px 0px 0px 2px inset;'] { - box-shadow: var(--theme--ui_divider) 0px 0px 0px 2px inset !important; -} -.notion-body.dark - [style*='box-shadow: rgba(255, 255, 255, 0.07) 0px 0px 0px 1px inset; border-radius: 3px;'], -.notion-body:not(.dark) - [style*='box-shadow: rgba(55, 53, 47, 0.09) 0px 0px 0px 1px inset; border-radius: 3px;'], -.notion-gallery-view - .notion-focusable[role='button'][style*='font-size: 14px; border-radius: 3px; box-shadow:']:last-child { - box-shadow: var(--theme--ui_divider) 0px 0px 0px 1px inset !important; -} -.notion-body.dark - [style*='border-radius: 3px; box-shadow: rgba(255, 255, 255, 0.1) 0px 0px 0px 1px;'], -.notion-body:not(.dark) - [style*='border-radius: 3px; box-shadow: rgba(55, 53, 47, 0.1) 0px 0px 0px 1px;'] { - box-shadow: var(--theme--ui_divider) 0px 0px 0px 1px !important; -} - -#notion-app - .DayPicker-Day--today:not(.DayPicker-Day--selected):not(.DayPicker-Day--value):not(.DayPicker-Day--start):not(.DayPicker-Day--end) { - color: var(--theme--accent_red-text) !important; -} -#notion-app - .DayPicker-Day--today:not(.DayPicker-Day--selected):not(.DayPicker-Day--value):not(.DayPicker-Day--start):not(.DayPicker-Day--end)::after, -.notion-timeline-view [style*='background: rgb(211, 79, 67); width: 22px;'], -.notion-timeline-view - [style*='width: 7px; height: 7px; background: rgb(211, 79, 67); border-radius: 100%;'] { - background: var(--theme--accent_red) !important; -} -#notion-app - .DayPicker-Day.DayPicker-Day--range.DayPicker-Day--start:not([style*='color: white'])::after, -#notion-app - .DayPicker-Day.DayPicker-Day--range.DayPicker-Day--end:not([style*='color: white'])::after { - content: ''; - background-color: var(--theme--accent_blue-selection) !important; - position: absolute; - width: 32px; - height: 30px; -} -#notion-app - .DayPicker-Day.DayPicker-Day--range.DayPicker-Day--start:not([style*='color: white'])::after { - border-top-left-radius: 3px; - border-bottom-left-radius: 3px; -} -#notion-app - .DayPicker-Day.DayPicker-Day--range.DayPicker-Day--end:not([style*='color: white'])::after { - border-top-right-radius: 3px; - border-bottom-right-radius: 3px; -} -.notion-calendar-view-day[style*='background'] { - background-color: var(--theme--accent_red) !important; - color: var(--theme--accent_red-text) !important; -} -.DayPicker-Day--outside, -.DayPicker-Weekday { - color: var(--theme--text_secondary) !important; -} -.notion-timeline-view [style*='height: 100%; border-right: 1px solid rgb(211, 79, 67);'] { - border-right: 1px solid var(--theme--accent_red) !important; -} - -/* link underline */ - -.notion-body.dark - [style*='background-image: linear-gradient(to right, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.14) 100%);'], -.notion-body:not(.dark) - [style*='background-image: linear-gradient(to right, rgba(55, 53, 47, 0.16) 0%, rgba(55, 53, 47, 0.16) 100%);'] { - background-image: linear-gradient( - to right, - var(--theme--ui_divider) 0%, - var(--theme--ui_divider) 100% - ) !important; -} - -/** dividers **/ - -.notion-body.dark - .notion-page-content - .notranslate[style*='border-bottom: 1px solid rgba(255, 255, 255, 0.14);'], -.notion-body:not(.dark) - .notion-page-content - .notranslate[style*='border-bottom: 1px solid rgba(55, 53, 47, 0.16);'] { - border-bottom: 1px solid var(--theme--ui_divider) !important; -} - -.notion-body.dark [style*='border-top: 1px solid rgb(77, 81, 83)'], -.notion-body.dark [style*='border-top: 1px solid rgb(63, 66, 69)'], -.notion-body.dark [style*='border-top: 1px solid rgba(255, 255, 255, 0.14);'], -.notion-body.dark [style*='border-top: 1px solid rgba(255, 255, 255, 0.07)'], -.notion-body:not(.dark) [style*='border-top: 1px solid rgb(223, 223, 222)'], -.notion-body:not(.dark) [style*='border-top: 1px solid rgb(237, 237, 236)'], -.notion-body:not(.dark) [style*='border-top: 1px solid rgba(55, 53, 47, 0.09)'], -.notion-body:not(.dark) [style*='border-top: 1px solid rgba(55, 53, 47, 0.16)'] { - border-top: 1px solid var(--theme--ui_divider) !important; -} -.notion-body.dark [style*='border-bottom: 1px solid rgb(77, 81, 83)'], -.notion-body.dark [style*='border-bottom: 1px solid rgb(63, 66, 69)'], -.notion-body.dark [style*='border-bottom: 1px solid rgba(255, 255, 255, 0.14);'], -.notion-body.dark [style*='border-bottom: 1px solid rgba(255, 255, 255, 0.07)'], -.notion-body:not(.dark) [style*='border-bottom: 1px solid rgb(223, 223, 222)'], -.notion-body:not(.dark) [style*='border-bottom: 1px solid rgb(237, 237, 236)'], -.notion-body:not(.dark) [style*='border-bottom: 1px solid rgba(55, 53, 47, 0.09)'], -.notion-body:not(.dark) [style*='border-bottom: 1px solid rgba(55, 53, 47, 0.16)'] { - border-bottom: 1px solid var(--theme--ui_divider) !important; -} -.notion-body.dark [style*='border-right: 1px solid rgb(77, 81, 83)'], -.notion-body.dark [style*='border-right: 1px solid rgb(63, 66, 69)'], -.notion-body.dark [style*='border-right: 1px solid rgba(255, 255, 255, 0.14);'], -.notion-body.dark [style*='border-right: 1px solid rgba(255, 255, 255, 0.07)'], -.notion-body:not(.dark) [style*='border-right: 1px solid rgb(223, 223, 222)'], -.notion-body:not(.dark) [style*='border-right: 1px solid rgb(237, 237, 236)'], -.notion-body:not(.dark) [style*='border-right: 1px solid rgba(55, 53, 47, 0.09)'], -.notion-body:not(.dark) [style*='border-right: 1px solid rgba(55, 53, 47, 0.16)'] { - border-right: 1px solid var(--theme--ui_divider) !important; -} -.notion-body.dark [style*='border-left: 1px solid rgb(77, 81, 83)'], -.notion-body.dark [style*='border-left: 1px solid rgb(63, 66, 69)'], -.notion-body.dark [style*='border-left: 1px solid rgba(255, 255, 255, 0.14);'], -.notion-body.dark [style*='border-left: 1px solid rgba(255, 255, 255, 0.07)'], -.notion-body:not(.dark) [style*='border-left: 1px solid rgb(223, 223, 222)'], -.notion-body:not(.dark) [style*='border-left: 1px solid rgb(237, 237, 236)'], -.notion-body:not(.dark) [style*='border-left: 1px solid rgba(55, 53, 47, 0.09)'], -.notion-body:not(.dark) [style*='border-left: 1px solid rgba(55, 53, 47, 0.16)'] { - border-left: 1px solid var(--theme--ui_divider) !important; -} -.notion-body.dark [style*='border: 1px solid rgb(77, 81, 83)'], -.notion-body.dark [style*='border: 1px solid rgb(63, 66, 69)'], -.notion-body.dark [style*='border: 1px solid rgba(255, 255, 255, 0.14);'], -.notion-body.dark [style*='border: 1px solid rgba(255, 255, 255, 0.07)'], -.notion-body:not(.dark) [style*='border: 1px solid rgb(223, 223, 222)'], -.notion-body:not(.dark) [style*='border: 1px solid rgb(237, 237, 236)'], -.notion-body:not(.dark) [style*='border: 1px solid rgba(55, 53, 47, 0.09)'], -.notion-body:not(.dark) [style*='border: 1px solid rgba(55, 53, 47, 0.16)'] { - border: 1px solid var(--theme--ui_divider) !important; -} -.notion-body.dark [style*='border-color: 1px solid rgb(77, 81, 83)'], -.notion-body.dark [style*='border-color: 1px solid rgb(63, 66, 69)'], -.notion-body.dark [style*='border-color: 1px solid rgba(255, 255, 255, 0.14);'], -.notion-body.dark [style*='border-color: 1px solid rgba(255, 255, 255, 0.07)'], -.notion-body:not(.dark) [style*='border-color: 1px solid rgb(223, 223, 222)'], -.notion-body:not(.dark) [style*='border-color: 1px solid rgb(237, 237, 236)'], -.notion-body:not(.dark) [style*='border-color: 1px solid rgba(55, 53, 47, 0.09)'], -.notion-body:not(.dark) [style*='border-color: 1px solid rgba(55, 53, 47, 0.16)'], -.notion-callout-block > div > :not([style*='border-color: transparent']) { - border-color: var(--theme--ui_divider) !important; -} - -.notion-body.dark [style*='box-shadow: rgb(77, 81, 83) -1px 0px 0px'], -.notion-body.dark [style*='box-shadow: rgba(255, 255, 255, 0.07) -1px 0px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgb(223, 223, 222) -1px 0px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgba(55, 53, 47, 0.09) -1px 0px 0px'], -.notion-body.dark [style*='box-shadow: rgb(63, 66, 69) -1px 0px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgb(237, 237, 236) -1px 0px 0px'] { - box-shadow: var(--theme--ui_divider) -1px 0px 0px !important; -} -.notion-body.dark [style*='box-shadow: rgb(77, 81, 83) 1px 0px 0px'], -.notion-body.dark [style*='box-shadow: rgba(255, 255, 255, 0.07) 1px 0px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgb(223, 223, 222) 1px 0px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgba(55, 53, 47, 0.09) 1px 0px 0px'], -.notion-body.dark [style*='box-shadow: rgb(63, 66, 69) 1px 0px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgb(237, 237, 236) 1px 0px 0px'] { - box-shadow: var(--theme--ui_divider) 1px 0px 0px !important; -} -.notion-body.dark [style*='box-shadow: rgb(77, 81, 83) 0px -1px 0px'], -.notion-body.dark [style*='box-shadow: rgba(255, 255, 255, 0.07) 0px -1px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgb(223, 223, 222) 0px -1px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgba(55, 53, 47, 0.09) 0px -1px 0px'], -.notion-body.dark [style*='box-shadow: rgb(63, 66, 69) 0px -1px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgb(237, 237, 236) 0px -1px 0px'] { - box-shadow: var(--theme--ui_divider) 0px -1px 0px !important; -} -.notion-body.dark [style*='box-shadow: rgb(77, 81, 83) 0px 1px 0px'], -.notion-body.dark [style*='box-shadow: rgba(255, 255, 255, 0.07) 0px 1px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgb(223, 223, 222) 0px 1px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgba(55, 53, 47, 0.09) 0px 1px 0px'], -.notion-body.dark [style*='box-shadow: rgb(63, 66, 69) 0px 1px 0px'], -.notion-body:not(.dark) [style*='box-shadow: rgb(237, 237, 236) 0px 1px 0px'] { - box-shadow: var(--theme--ui_divider) 0px 1px 0px !important; -} - -.notion-body.dark [style*='height: 1px;'][style*='background: rgba(255, 255, 255, 0.07);'], -.notion-body:not(.dark) [style*='height: 1px;'][style*='background: rgba(55, 53, 47, 0.09);'] { - background: var(--theme--ui_divider) !important; -} -.notion-body.dark - [style*='box-shadow: rgb(47, 52, 55) -3px 0px 0px, rgb(77, 81, 83) 0px 1px 0px;'], -.notion-body:not(.dark) - [style*='box-shadow: white -3px 0px 0px, rgb(223, 223, 222) 0px 1px 0px;'] { - box-shadow: var(--theme--ui_divider) 0px 1px 0px !important; -} -.notion-body.dark - .notion-collection_view_page-block - > [style*='box-shadow: rgb(47, 52, 55) -3px 0px 0px;'], -.notion-body:not(.dark) - .notion-collection_view_page-block - > [style*='box-shadow: white -3px 0px 0px;'], -.notion-body.dark - .notion-collection_view-block - > [style*='box-shadow: rgb(47, 52, 55) -3px 0px 0px;'], -.notion-body:not(.dark) - .notion-collection_view-block - > [style*='box-shadow: white -3px 0px 0px;'] { - box-shadow: transparent -3px 0px 0px !important; - margin-left: 20px; -} -.notion-focusable[role='button'][style*='box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px;'] { - box-shadow: var(--theme--ui_divider) 0px 0px 0px 1px !important; -} - -.notion-sidebar-container[style*='box-shadow:'] { - box-shadow: var(--theme--ui_divider) -2px 0px 0px 0px inset !important; -} - -/** colours **/ - -[style*='background: rgb(46, 170, 220)'] { - background: var(--theme--accent_blue) !important; -} -[style*=' color: rgb(46, 170, 220)'], -[style^='color: rgb(46, 170, 220)'] { - color: var(--theme--accent_blue) !important; -} -[style*='background-color: rgba(46, 170, 220, 0.'] { - background-color: var(--theme--accent_blue-selection) !important; -} -*::selection { - background: var(--theme--accent_blue-selection, rgba(26, 170, 220, 0.3)) !important; -} -.notion-page-mention-token::selection, -.notion-selectable-halo { - background: var(--theme--accent_blue-selection, rgba(26, 170, 220, 0.2)) !important; -} -.notion-focusable-within:focus-within, -.notion-focusable:focus-visible { - box-shadow: var(--theme--accent_blue-focus, rgba(26, 170, 220, 0.7)) 0px 0px 0px 1px inset, - var(--theme--accent_blue-focus, rgba(26, 170, 220, 0.4)) 0px 0px 0px 2px !important; -} - -@keyframes pulsing-button-border { - 0% { - border-color: var(--theme--accent_blue) !important; - } - 50% { - border-color: rgba(255, 255, 255, 0) !important; - } - 100% { - border-color: var(--theme--accent_blue) !important; - } -} - -[style*='background: rgb(6, 156, 205);'] { - background: var(--theme--accent_blue-hover) !important; -} -[style*='background: rgb(0, 141, 190);'] { - background: var(--theme--accent_blue-focus) !important; -} - -[style*='background-color: rgb(235, 87, 87); height: 28px; width: 28px;'] { - background: var(--theme--accent_red) !important; -} -[style*='background: rgb(235, 87, 87); color: white; border-radius: 3px;']:not([role='button']) { - background: var(--theme--accent_red) !important; - color: var(--theme--accent_red-text) !important; -} -[style*='color: rgb(235, 87, 87); border: 1px solid rgba(235, 87, 87, 0.5);'][role='button'] { - color: var(--theme--accent_red) !important; - border: 1px solid var(--theme--accent_red) !important; -} -.notion-focusable[style*='border-radius: 3px;'][style*='color: rgb(235, 87, 87);'][role='button'], -[style*='font-size: 12px; font-weight: 600; color: rgb(235, 87, 87);'], -[style*='flex-shrink: 0; margin-top: -1px; margin-right: 4px; fill: rgb(235, 87, 87);'], -[style*='font-size: 12px;'] > [style*='pointer-events: none; color: rgb(235, 87, 87);'] { - color: var(--theme--accent_red) !important; - fill: var(--theme--accent_red) !important; -} -.notion-focusable[style*='border-radius: 3px;'][style*='background: rgba(235, 87, 87, 0.1);'][role='button']:hover { - background: var(--theme--accent_red-hover) !important; -} - -.notion-transclusion_container-block > div > div > div[style*='border: 2px'], -.notion-transclusion_reference-block > div > div > div[style*='border: 2px'] { - border-color: var(--theme--accent_red, #e38676) !important; -} - -.notion-text-mention-token[style*='color:#2EAADC;'] { - color: var(--theme--accent_blue) !important; -} -.notion-text-mention-token[style*='color:#EB5757;'], -.notion-link:hover { - color: var(--theme--accent_red) !important; -} - -.notion-body.dark [style*='fill: rgb(202, 204, 206)'], -.notion-body:not(.dark) [style*='fill: rgba(55, 53, 47, 0.8)'] { - fill: var(--theme--icon) !important; -} -.notion-body.dark [style*='fill: rgba(202, 204, 206, 0.'], -.notion-body.dark [style*='fill: rgba(255, 255, 255, 0.'], -.notion-body:not(.dark) [style*='fill: rgba(25, 23, 17, 0.'], -.notion-body:not(.dark) [style*='fill: rgb(55, 53, 47)'], -.notion-body:not(.dark) - [style*='fill: rgba(55, 53, 47, 0.']:not([style*='fill: rgba(55, 53, 47, 0.8)']) { - fill: var(--theme--icon_secondary) !important; -} -.alarmClock { - fill: currentColor !important; -} - -.notion-app-inner, -.notion-page-content, -.notion-selectable.notion-page-block .notion-focusable > [style*=';color:'], -.notion-record-icon.notranslate.notion-focusable, -.notion-topbar-share-menu.notion-focusable, -.notion-collection-view-select.notion-focusable, -.notion-body.dark [style*=' color: rgba(255, 255, 255, 0.9);'], -.notion-body.dark [style^='color: rgba(255, 255, 255, 0.9);'], -.notion-body:not(.dark) [style*=' color: rgb(55, 53, 47)'], -.notion-body:not(.dark) [style^='color: rgb(55, 53, 47)'] { - color: var(--theme--text) !important; -} -.notion-body.dark [style*='border-bottom: 2px solid rgba(255, 255, 255, 0.9);'], -.notion-body:not(.dark) [style*='border-bottom: 2px solid rgb(55, 53, 47);'] { - border-bottom: 2px solid var(--theme--text) !important; -} -.notion-body.dark [style*='caret-color: rgba(255, 255, 255, 0.9)'], -.notion-body:not(.dark) [style*='caret-color: rgb(55, 53, 47)'] { - caret-color: var(--theme--text) !important; -} -.notion-body.dark [style*=' color: rgba(255, 255, 255, 0.6)'], -.notion-body.dark [style^='color: rgba(255, 255, 255, 0.6)'], -.notion-body.dark [style^='color:rgba(255, 255, 255, 0.6)'], -.notion-body:not(.dark) [style*=' color: rgba(55, 53, 47, 0.6)'], -.notion-body:not(.dark) [style^='color: rgba(55, 53, 47, 0.6)'], -.notion-body:not(.dark) [style^='color:rgba(55, 53, 47, 0.6)'], -.notion-sidebar-container > [style*='color'], -.notion-gallery-view - .notion-focusable[role='button'][style*='font-size: 14px; border-radius: 3px; box-shadow:']:last-child - svg - + div { - color: var(--theme--text_secondary) !important; -} -.notion-page-mention-token__title { - border-bottom: 0.05em solid var(--theme--text_secondary) !important; -} -.notion-to_do-block [placeholder='To-do'][style*='text-decoration: line-through'] { - text-decoration: line-through var(--theme--text_secondary) !important; -} -.notion-body.dark [style*=' color: rgba(255, 255, 255, 0.4)'], -.notion-body.dark [style^='color: rgba(255, 255, 255, 0.4)'], -.notion-body:not(.dark) [style*=' color: rgba(55, 53, 47, 0.4)'], -.notion-body:not(.dark) [style^='color: rgba(55, 53, 47, 0.4)'], -.notion-page-controls, -.notion-page-details-controls, -.notion-calendar-view-day { - color: var(--theme--text_secondary) !important; -} -.notion-body.dark [style*='-webkit-text-fill-color: rgba(255, 255, 255, 0.4)'], -.notion-body:not(.dark) [style*='-webkit-text-fill-color: rgba(55, 53, 47, 0.4)'] { - -webkit-text-fill-color: var(--theme--text_secondary) !important; -} -.notion-body.dark [style*='border-color:rgba(255,255,255,0.4)'], -.notion-body:not(.dark) [style*='border-color:rgba(55,53,47,0.4)'] { - border-color: var(--theme--text_secondary) !important; -} - -.notion-body.dark [style*='background: rgb(80, 85, 88)']:not([role='button']), -.notion-body.dark [style*='background-color: rgb(80, 85, 88)']:not([role='button']), -.notion-body:not(.dark) [style*='background: rgba(206, 205, 202, 0.5)']:not([role='button']), -.notion-body:not(.dark) - [style*='background-color: rgba(206, 205, 202, 0.5)']:not([role='button']) { - background: var(--theme--tag_default) !important; - color: var(--theme--tag_default-text) !important; -} - -.notion-body.dark - .notion-overlay-container.notion-default-overlay-container - > div:nth-child(3) - > div - > div - > div:nth-child(2) - > div - > div - > div - > div - > div - > div - > div:nth-child(2) - > div:nth-child(3) - > div - > div:nth-child(1) - > [style^='color: rgba(255, 255, 255, 0.6)'], -.notion-body.dark .notion-text-block > [style^='color: rgba(255, 255, 255, 0.6)'], -.notion-body.dark .notion-callout-block > div > [style*=' color: rgba(255, 255, 255, 0.6)'], -.notion-body.dark [style*='color:rgba(151,154,155,0.95)'][data-token-index], -.notion-body.dark [style*='color: rgba(151, 154, 155, 0.95)'][data-token-index], -.notion-body:not(.dark) [style*='color:rgb(155,154,151)'][data-token-index], -.notion-body:not(.dark) [style*='color: rgb(155, 154, 151)'][data-token-index], -.notion-body:not(.dark) .notion-text-block > [style^='color: rgba(55, 53, 47, 0.6)'], -.notion-body:not(.dark) - .notion-overlay-container.notion-default-overlay-container - > div:nth-child(3) - > div - > div - > div:nth-child(2) - > div - > div - > div - > div - > div - > div - > div:nth-child(2) - > div:nth-child(3) - > div - > div:nth-child(1) - > [style*=' color: rgba(55, 53, 47, 0.6)'], -.notion-body:not(.dark) - .notion-callout-block - > div - > [style*=' color: rgba(55, 53, 47, 0.6)'] { - color: var(--theme--text_grey) !important; - fill: var(--theme--text_grey) !important; -} -.notion-body.dark [style*='fill: rgba(255, 255, 255, 0.6);'], -.notion-body:not(.dark) [style*='fill: rgba(55, 53, 47, 0.6);'] { - fill: var(--theme--text_grey) !important; -} -.notion-body.dark [style*='background:rgb(69,75,78)'], -.notion-body:not(.dark) [style*='background:rgb(235,236,237)'] { - background: var(--theme--highlight_grey) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(69,75,78)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(235,236,237)'] { - color: var(--theme--highlight_grey-text) !important; -} -.notion-body.dark [style*='color:rgba(151,154,155,0.95)'] [style*='background:rgb(69,75,78)'], -.notion-body.dark - [style*='color: rgba(255, 255, 255, 0.6); fill: rgba(255, 255, 255, 0.6);'] - [style*='background:rgb(69,75,78)'], -.notion-body:not(.dark) - [style*='color:rgb(155,154,151)'] - [style*='background:rgb(235,236,237)'], -.notion-body:not(.dark) - [style*='color: rgba(55, 53, 47, 0.6); fill: rgba(55, 53, 47, 0.6);'] - [style*='background:rgb(235,236,237)'] { - background: var(--theme--highlight_grey) !important; - color: var(--theme--text_grey) !important; - fill: var(--theme--text_grey) !important; -} -.notion-body.dark [style*='background: rgb(69, 75, 78)'], -.notion-body:not(.dark) [style*='background: rgb(235, 236, 237)'] { - background: var(--theme--block_grey) !important; - color: var(--theme--block_grey-text) !important; -} -.notion-body.dark [style*='background: rgba(151, 154, 155, 0.5)'], -.notion-body.dark [style*='background-color: rgba(151, 154, 155, 0.5)'], -.notion-body:not(.dark) [style*='background: rgba(140, 46, 0, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(140, 46, 0, 0.2)'], -.notion-body:not(.dark) [style*='background: rgba(155, 154, 151, 0.4)'] { - background: var(--theme--tag_grey) !important; - color: var(--theme--tag_grey-text) !important; -} -.notion-body.dark [style*='background: rgba(69, 75, 78, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(235, 236, 237, 0.3)'] { - background: var(--theme--callout_grey) !important; - color: var(--theme--callout_grey-text) !important; -} - -.notion-body.dark [style*='color:rgb(147,114,100)'], -.notion-body.dark [style^='color: rgb(147, 114, 100)'], -.notion-body.dark [style*=' color: rgb(147, 114, 100)'], -.notion-body:not(.dark) [style*='color:rgb(100,71,58)'], -.notion-body:not(.dark) [style^='color: rgb(100, 71, 58)'], -.notion-body:not(.dark) [style*=' color: rgb(100, 71, 58)'] { - color: var(--theme--text_brown) !important; - fill: var(--theme--text_brown) !important; -} -.notion-body.dark [style*='fill: rgb(147, 114, 100);'], -.notion-body:not(.dark) [style*='fill: rgb(100, 71, 58);'] { - fill: var(--theme--text_brown) !important; -} -.notion-body.dark [style*='background:rgb(67,64,64)'], -.notion-body:not(.dark) [style*='background:rgb(233,229,227)'] { - background: var(--theme--highlight_brown) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(67,64,64)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(233,229,227)'] { - color: var(--theme--highlight_brown-text) !important; -} -.notion-body.dark [style*='color:rgb(147,114,100)'] [style*='background:rgb(67,64,64)'], -.notion-body.dark - [style*='color: rgb(147, 114, 100); fill: rgb(147, 114, 100);'] - [style*='background:rgb(67,64,64)'], -.notion-body:not(.dark) [style*='color:rgb(100,71,58)'] [style*='background:rgb(233,229,227)'], -.notion-body:not(.dark) - [style*='color: rgb(100, 71, 58); fill: rgb(100, 71, 58);'] - [style*='background:rgb(233,229,227)'] { - background: var(--theme--highlight_brown) !important; - color: var(--theme--text_brown) !important; - fill: var(--theme--text_brown) !important; -} -.notion-body.dark [style*='background: rgb(67, 64, 64)'], -.notion-body:not(.dark) [style*='background: rgb(233, 229, 227)'] { - background: var(--theme--block_brown) !important; - color: var(--theme--block_brown-text) !important; -} -.notion-body.dark [style*='background: rgba(147, 114, 100, 0.5)'], -.notion-body.dark [style*='background-color: rgba(147, 114, 100, 0.5)'], -.notion-body:not(.dark) [style*='background: rgba(140, 46, 0, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(140, 46, 0, 0.2)'] { - background: var(--theme--tag_brown) !important; - color: var(--theme--tag_brown-text) !important; -} -.notion-body.dark [style*='background: rgba(67, 64, 64, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(233, 229, 227, 0.3)'] { - background: var(--theme--callout_brown) !important; - color: var(--theme--callout_brown-text) !important; -} - -.notion-body.dark [style*='color:rgb(255,163,68)'], -.notion-body.dark [style^='color: rgb(255, 163, 68)'], -.notion-body.dark [style*=' color: rgb(255, 163, 68)'], -.notion-body:not(.dark) [style*='color:rgb(217,115,13)'], -.notion-body:not(.dark) [style^='color: rgb(217, 115, 13)'], -.notion-body:not(.dark) [style*=' color: rgb(217, 115, 13)'] { - color: var(--theme--text_orange) !important; - fill: var(--theme--text_orange) !important; -} -.notion-body.dark [style*='fill: rgb(255, 163, 68);'], -.notion-body:not(.dark) [style*='fill: rgb(217, 115, 13);'] { - fill: var(--theme--text_orange) !important; -} -.notion-body.dark [style*='background:rgb(89,74,58)'], -.notion-body:not(.dark) [style*='background:rgb(250,235,221)'] { - background: var(--theme--highlight_orange) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(89,74,58)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(250,235,221)'] { - color: var(--theme--highlight_orange-text) !important; -} -.notion-body.dark [style*='color:rgb(255,163,68)'] [style*='background:rgb(89,74,58)'], -.notion-body.dark - [style*='color: rgb(255, 163, 68); fill: rgb(255, 163, 68);'] - [style*='background:rgb(89,74,58)'], -.notion-body:not(.dark) - [style*='color:rgb(217,115,13)'] - [style*='background:rgb(250,235,221)'], -.notion-body:not(.dark) - [style*='color: rgb(217, 115, 13); fill: rgb(217, 115, 13);'] - [style*='background:rgb(250,235,221)'] { - background: var(--theme--highlight_orange) !important; - color: var(--theme--text_orange) !important; - fill: var(--theme--text_orange) !important; -} -.notion-body.dark [style*='background: rgb(89, 74, 58)'], -.notion-body:not(.dark) [style*='background: rgb(250, 235, 221)'] { - background: var(--theme--block_orange) !important; - color: var(--theme--block_orange-text) !important; -} -.notion-body.dark [style*='background: rgba(255, 163, 68, 0.5)'], -.notion-body.dark [style*='background-color: rgba(255, 163, 68, 0.5)'], -.notion-body:not(.dark) [style*='background: rgba(245, 93, 0, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(245, 93, 0, 0.2)'] { - background: var(--theme--tag_orange) !important; - color: var(--theme--tag_orange-text) !important; -} -.notion-body.dark [style*='background: rgba(89, 74, 58, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(250, 235, 221, 0.3)'] { - background: var(--theme--callout_orange) !important; - color: var(--theme--callout_orange-text) !important; -} - -.notion-body.dark [style*='color:rgb(255,220,73)'], -.notion-body.dark [style^='fill: rgb(255, 220, 73)'], -.notion-body.dark [style*=' fill: rgb(255, 220, 73)'], -.notion-body:not(.dark) [style*='color:rgb(223,171,1)'], -.notion-body:not(.dark) [style^='fill: rgb(223, 171, 1)'], -.notion-body:not(.dark) [style*=' fill: rgb(223, 171, 1)'] { - color: var(--theme--text_yellow) !important; - fill: var(--theme--text_yellow) !important; -} -.notion-body.dark [style*='color: rgb(255, 220, 73);'], -.notion-body:not(.dark) [style*='color: rgb(223, 171, 1);'] { - fill: var(--theme--text_yellow) !important; -} -.notion-body.dark [style*='background:rgb(89,86,59)'], -.notion-body:not(.dark) [style*='background:rgb(251,243,219)'] { - background: var(--theme--highlight_yellow) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(89,86,59)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(251,243,219)'] { - color: var(--theme--highlight_yellow-text) !important; -} -.notion-body.dark [style*='color:rgb(255,220,73)'] [style*='background:rgb(89,86,59)'], -.notion-body.dark - [style*='color: rgb(255, 220, 73); fill: rgb(255, 220, 73);'] - [style*='background:rgb(89,86,59)'], -.notion-body:not(.dark) [style*='color:rgb(223,171,1)'] [style*='background:rgb(251,243,219)'], -.notion-body:not(.dark) - [style*='color: rgb(223, 171, 1); fill: rgb(223, 171, 1);'] - [style*='background:rgb(251,243,219)'] { - background: var(--theme--highlight_yellow) !important; - color: var(--theme--text_yellow) !important; - fill: var(--theme--text_yellow) !important; -} -.notion-body.dark [style*='background: rgb(89, 86, 59)'], -.notion-body:not(.dark) [style*='background: rgb(251, 243, 219)'] { - background: var(--theme--block_yellow) !important; - color: var(--theme--block_yellow-text) !important; -} -.notion-body.dark [style*='background: rgba(255, 220, 73, 0.5)'], -.notion-body.dark [style*='background-color: rgba(255, 220, 73, 0.5)'], -.notion-body:not(.dark) [style*='background: rgba(233, 168, 0, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(233, 168, 0, 0.2)'] { - background: var(--theme--tag_yellow) !important; - color: var(--theme--tag_yellow-text) !important; -} -.notion-body.dark [style*='background: rgba(89, 86, 59, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(251, 243, 219, 0.3)'] { - background: var(--theme--callout_yellow) !important; - color: var(--theme--callout_yellow-text) !important; -} - -.notion-body.dark [style*='color:rgb(77,171,154)'], -.notion-body.dark [style^='color: rgb(77, 171, 154)'], -.notion-body.dark [style*=' color: rgb(77, 171, 154)'], -.notion-body:not(.dark) [style*='color:rgb(15,123,108)'], -.notion-body:not(.dark) [style^='color: rgb(15, 123, 108)'], -.notion-body:not(.dark) [style*=' color: rgb(15, 123, 108)'] { - color: var(--theme--text_green) !important; - fill: var(--theme--text_green) !important; -} -.notion-body.dark [style*='fill: rgb(77, 171, 154);'], -.notion-body:not(.dark) [style*='fill: rgb(15, 123, 108);'] { - fill: var(--theme--text_green) !important; -} -.notion-body.dark [style*='background:rgb(53,76,75)'], -.notion-body:not(.dark) [style*='background:rgb(221,237,234)'] { - background: var(--theme--highlight_green) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(53,76,75)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(221,237,234)'] { - color: var(--theme--highlight_green-text) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(89,86,59)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(251,243,219)'] { - color: var(--theme--highlight_green-text) !important; -} -.notion-body.dark [style*='color:rgb(77,171,154)'] [style*='background:rgb(53,76,75)'], -.notion-body.dark - [style*='color: rgb(77, 171, 154); fill: rgb(77, 171, 154);'] - [style*='background:rgb(53,76,75)'], -.notion-body:not(.dark) - [style*='color:rgb(15,123,108)'] - [style*='background:rgb(221,237,234)'], -.notion-body:not(.dark) - [style*='color: rgb(15, 123, 108); fill: rgb(15, 123, 108);'] - [style*='background:rgb(221,237,234)'] { - background: var(--theme--highlight_green) !important; - color: var(--theme--text_green) !important; - fill: var(--theme--text_green) !important; -} -.notion-body.dark [style*='background: rgb(53, 76, 75)'], -.notion-body:not(.dark) [style*='background: rgb(221, 237, 234)'] { - background: var(--theme--block_green) !important; - color: var(--theme--block_green-text) !important; -} -.notion-body.dark [style*='background: rgba(77, 171, 154, 0.5)'], -.notion-body.dark [style*='background-color: rgba(77, 171, 154, 0.5)'], -.notion-body:not(.dark) [style*='background: rgba(0, 135, 107, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(0, 135, 107, 0.2)'] { - background: var(--theme--tag_green) !important; - color: var(--theme--tag_green-text) !important; -} -.notion-body.dark [style*='background: rgba(53, 76, 75, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(221, 237, 234, 0.3)'] { - background: var(--theme--callout_green) !important; - color: var(--theme--callout_green-text) !important; -} - -.notion-body.dark [style*='color:rgb(82,156,202)'], -.notion-body.dark [style^='color: rgb(82, 156, 202)'], -.notion-body.dark [style*=' color: rgb(82, 156, 202)'], -.notion-body:not(.dark) [style*='color:rgb(11,110,153)'], -.notion-body:not(.dark) [style^='color: rgb(11, 110, 153)'], -.notion-body:not(.dark) [style*=' color: rgb(11, 110, 153)'] { - color: var(--theme--text_blue) !important; - fill: var(--theme--text_blue) !important; -} -.notion-body.dark [style*='fill: rgb(82, 156, 202);'], -.notion-body:not(.dark) [style*='fill: rgb(11, 110, 153);'] { - fill: var(--theme--text_blue) !important; -} -.notion-body.dark [style*='background:rgb(54,73,84)'], -.notion-body:not(.dark) [style*='background:rgb(221,235,241)'] { - background: var(--theme--highlight_blue) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(54,73,84)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(221,235,241)'] { - color: var(--theme--highlight_blue-text) !important; -} -.notion-body.dark [style*='color:rgb(82,156,202)'] [style*='background:rgb(54,73,84)'], -.notion-body.dark - [style*='color: rgb(82, 156, 202); fill: rgb(82, 156, 202);'] - [style*='background:rgb(54,73,84)'], -.notion-body:not(.dark) - [style*='color:rgb(11,110,153)'] - [style*='background:rgb(221,235,241)'], -.notion-body:not(.dark) - [style*='color: rgb(11, 110, 153); fill: rgb(11, 110, 153);'] - [style*='background:rgb(221,235,241)'] { - background: var(--theme--highlight_blue) !important; - color: var(--theme--text_blue) !important; - fill: var(--theme--text_blue) !important; -} -.notion-body.dark [style*='background: rgb(54, 73, 84)'], -.notion-body:not(.dark) [style*='background: rgb(221, 235, 241)'] { - background: var(--theme--block_blue) !important; - color: var(--theme--block_blue-text) !important; -} -.notion-body.dark [style*='background: rgba(82, 156, 202, 0.5)'], -.notion-body.dark [style*='background-color: rgba(82, 156, 202, 0.5)'], -.notion-body:not(.dark) [style*='background: rgba(0, 120, 223, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(0, 120, 223, 0.2)'] { - background: var(--theme--tag_blue) !important; - color: var(--theme--tag_blue-text) !important; -} -.notion-body.dark [style*='background: rgba(54, 73, 84, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(221, 235, 241, 0.3)'] { - background: var(--theme--callout_blue) !important; - color: var(--theme--callout_blue-text) !important; -} - -.notion-body.dark [style*='color:rgb(154,109,215)'], -.notion-body.dark [style^='color: rgb(154, 109, 215)'], -.notion-body.dark [style*=' color: rgb(154, 109, 215)'], -.notion-body:not(.dark) [style*='color:rgb(105,64,165)'], -.notion-body:not(.dark) [style^='color: rgb(105, 64, 165)'], -.notion-body:not(.dark) [style*=' color: rgb(105, 64, 165)'] { - color: var(--theme--text_purple) !important; - fill: var(--theme--text_purple) !important; -} -.notion-body.dark [style*='fill: rgb(154, 109, 215);'], -.notion-body:not(.dark) [style*='fill: rgb(105, 64, 165);'] { - fill: var(--theme--text_purple) !important; -} -.notion-body.dark [style*='background:rgb(68,63,87)'], -.notion-body:not(.dark) [style*='background:rgb(234,228,242)'] { - background: var(--theme--highlight_purple) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(68,63,87)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(234,228,242)'] { - color: var(--theme--highlight_purple-text) !important; -} -.notion-body.dark [style*='color:rgb(154,109,215)'] [style*='background:rgb(68,63,87)'], -.notion-body.dark - [style*='color: rgb(154, 109, 215); fill: rgb(154, 109, 215);'] - [style*='background:rgb(68,63,87)'], -.notion-body:not(.dark) - [style*='color:rgb(105,64,165)'] - [style*='background:rgb(234,228,242)'], -.notion-body:not(.dark) - [style*='color: rgb(105, 64, 165); fill: rgb(105, 64, 165);'] - [style*='background:rgb(234,228,242)'] { - background: var(--theme--highlight_purple) !important; - color: var(--theme--text_purple) !important; - fill: var(--theme--text_purple) !important; -} -.notion-body.dark [style*='background: rgb(68, 63, 87)'], -.notion-body:not(.dark) [style*='background: rgb(234, 228, 242)'] { - background: var(--theme--block_purple) !important; - color: var(--theme--block_purple-text) !important; -} -.notion-body.dark [style*='background: rgba(154, 109, 215, 0.5)'], -.notion-body.dark [style*='background-color: rgba(154, 109, 215, 0.5)'], -.notion-body:not(.dark) [style*='background: rgba(103, 36, 222, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(103, 36, 222, 0.2)'] { - background: var(--theme--tag_purple) !important; - color: var(--theme--tag_purple-text) !important; -} -.notion-body.dark [style*='background: rgba(68, 63, 87, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(234, 228, 242, 0.3)'] { - background: var(--theme--callout_purple) !important; - color: var(--theme--callout_purple-text) !important; -} - -.notion-body.dark [style*='color:rgb(226,85,161)'], -.notion-body.dark [style^='color: rgb(226, 85, 161)'], -.notion-body.dark [style*=' color: rgb(226, 85, 161)'], -.notion-body:not(.dark) [style*='color:rgb(173,26,114)'], -.notion-body:not(.dark) [style^='color: rgb(173, 26, 114)'], -.notion-body:not(.dark) [style*=' color: rgb(173, 26, 114)'] { - color: var(--theme--text_pink) !important; - fill: var(--theme--text_pink) !important; -} -.notion-body.dark [style*='fill: rgb(226, 85, 161);'], -.notion-body:not(.dark) [style*='fill: rgb(173, 26, 114);'] { - fill: var(--theme--text_pink) !important; -} -.notion-body.dark [style*='background:rgb(83,59,76)'], -.notion-body:not(.dark) [style*='background:rgb(244,223,235)'] { - background: var(--theme--highlight_pink) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(83,59,76)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(244,223,235)'] { - color: var(--theme--highlight_pink-text) !important; -} -.notion-body.dark [style*='color:rgb(226,85,161)'] [style*='background:rgb(83,59,76)'], -.notion-body.dark - [style*='color: rgb(226, 85, 161); fill: rgb(226, 85, 161);'] - [style*='background:rgb(83,59,76)'], -.notion-body:not(.dark) - [style*='color:rgb(173,26,114)'] - [style*='background:rgb(244,223,235)'], -.notion-body:not(.dark) - [style*='color: rgb(173, 26, 114); fill: rgb(173, 26, 114);'] - [style*='background:rgb(244,223,235)'] { - background: var(--theme--highlight_pink) !important; - color: var(--theme--text_pink) !important; - fill: var(--theme--text_pink) !important; -} -.notion-body.dark [style*='background: rgb(83, 59, 76)'], -.notion-body:not(.dark) [style*='background: rgb(244, 223, 235)'] { - background: var(--theme--block_pink) !important; - color: var(--theme--block_pink-text) !important; -} -.notion-body.dark [style*='background: rgba(226, 85, 161, 0.5)'], -.notion-body.dark [style*='background-color: rgba(226, 85, 161, 0.5)'], -.notion-body:not(.dark) [style*='background: rgba(221, 0, 129, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(221, 0, 129, 0.2)'] { - background: var(--theme--tag_pink) !important; - color: var(--theme--tag_pink-text) !important; -} -.notion-body.dark [style*='background: rgba(83, 59, 76, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(244, 223, 235, 0.3)'] { - background: var(--theme--callout_pink) !important; - color: var(--theme--callout_pink-text) !important; -} - -.notion-body.dark [style*='color:rgb(255,115,105)'], -.notion-body.dark [style^='color: rgb(255, 115, 105)'], -.notion-body.dark [style*=' color: rgb(255, 115, 105)'], -.notion-body:not(.dark) [style*='color:rgb(224,62,62)'], -.notion-body:not(.dark) [style^='color: rgb(224, 62, 62)'], -.notion-body:not(.dark) [style*=' color: rgb(224, 62, 62)'] { - color: var(--theme--text_red) !important; - fill: var(--theme--text_red) !important; -} -.notion-body.dark [style*='fill: rgb(255, 115, 105);'], -.notion-body:not(.dark) [style*='fill: rgb(224, 62, 62);'] { - color: var(--theme--text_red) !important; - fill: var(--theme--text_red) !important; -} -.notion-body.dark [style*='background:rgb(89,65,65)'], -.notion-body:not(.dark) [style*='background:rgb(251,228,228)'] { - background: var(--theme--highlight_red) !important; -} -.notion-body.dark [style*='color: inherit'] > div > div > [style*='background:rgb(89,65,65)'], -.notion-body:not(.dark) - [style*='color: inherit'] - > div - > div - > [style*='background:rgb(251,228,228)'] { - color: var(--theme--highlight_red-text) !important; -} -.notion-body.dark [style*='color:rgb(255,115,105)'] [style*='background:rgb(89,65,65)'], -.notion-body.dark - [style*='color: rgb(255, 115, 105); fill: rgb(255, 115, 105);'] - [style*='background:rgb(89,65,65)'], -.notion-body:not(.dark) [style*='color:rgb(224,62,62)'] [style*='background:rgb(251,228,228)'], -.notion-body:not(.dark) - [style*='color: rgb(224, 62, 62); fill: rgb(224, 62, 62);'] - [style*='background:rgb(251,228,228)'] { - background: var(--theme--highlight_red) !important; - color: var(--theme--text_red) !important; - fill: var(--theme--text_red) !important; -} -.notion-body.dark [style*='background: rgb(89, 65, 65)'], -.notion-body:not(.dark) [style*='background: rgb(251, 228, 228)'] { - background: var(--theme--block_red) !important; - color: var(--theme--block_red-text) !important; -} -.notion-body.dark [style*='background: rgba(255, 115, 105, 0.5);'], -.notion-body.dark [style*='background-color: rgba(255, 115, 105, 0.5);'], -.notion-body:not(.dark) [style*='background: rgba(255, 0, 26, 0.2)'], -.notion-body:not(.dark) [style*='background-color: rgba(255, 0, 26, 0.2)'] { - background: var(--theme--tag_red) !important; - color: var(--theme--tag_red-text) !important; -} -.notion-body.dark [style*='background: rgba(89, 65, 65, 0.3)'], -.notion-body:not(.dark) [style*='background: rgba(251, 228, 228, 0.3)'] { - background: var(--theme--callout_red) !important; - color: var(--theme--callout_red-text) !important; -} - -/** code **/ - -.notion-page-content [style*='color:#EB5757']:not(.notion-text-mention-token) { - color: var(--theme--code_inline-text) !important; - background: var(--theme--code_inline) !important; -} - -.notion-code-block > div > div { - background: var(--theme--code) !important; -} -.notion-code-block > div { - color: var(--theme--code_plain) !important; -} diff --git a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/variables.css b/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/variables.css deleted file mode 100644 index b7bf564..0000000 --- a/repo/theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082/variables.css +++ /dev/null @@ -1,364 +0,0 @@ -/* - * notion-enhancer core: theming - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - * - * (rgb|hsl|#)[^;]+; - */ - -:root { - --theme--page-padding: calc(96px + env(safe-area-inset-left)); - --theme--page-width: 900px; - --theme--page-width_full: 100%; - --theme--page_banner-height: 30vh; - --theme--page_preview-padding: 8rem; - --theme--page_preview-width: 977px; - --theme--page_preview_banner-height: 20vh; - - --theme--font_sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, - 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; - --theme--font_serif: Lyon-Text, Georgia, YuMincho, 'Yu Mincho', 'Hiragino Mincho ProN', - 'Hiragino Mincho Pro', 'Songti TC', 'Songti SC', SimSun, 'Nanum Myeongjo', NanumMyeongjo, - Batang, serif; - --theme--font_mono: iawriter-mono, Nitti, Menlo, Courier, monospace; - --theme--font_code: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; - --theme--font_quote: var(--theme--font_sans); - --theme--font_headings: var(--theme--font_sans); - - --theme--accent_blue: rgb(46, 170, 220); - --theme--accent_blue-selection: rgb(46, 170, 220, 0.25); - --theme--accent_blue-hover: rgb(6, 156, 205); - --theme--accent_blue-focus: rgb(0, 141, 190); - --theme--accent_blue-text: #fff; - --theme--accent_red: #eb5757; - --theme--accent_red-hover: rgba(235, 87, 87, 0.1); - --theme--accent_red-text: #fff; -} - -:root { - --theme--bg: #fff; - --theme--bg_secondary: rgb(247, 246, 243); - --theme--bg_popup: #fff; - - --theme--scrollbar_track: #edece9; - --theme--scrollbar_thumb: #d3d1cb; - --theme--scrollbar_thumb-hover: #aeaca6; - - --theme--ui_shadow: rgba(15, 15, 15, 0.15); - --theme--ui_divider: rgb(237, 237, 236); - --theme--ui_interactive-hover: rgba(55, 53, 47, 0.08); - --theme--ui_interactive-active: rgba(55, 53, 47, 0.16); - --theme--ui_toggle-on: var(--theme--accent_blue); - --theme--ui_toggle-off: rgba(135, 131, 120, 0.3); - --theme--ui_toggle-feature: #fff; - --theme--ui_input: rgba(242, 241, 238, 0.6); - --theme--ui_tooltip: rgb(15, 15, 15); - --theme--ui_tooltip-title: rgba(255, 255, 255, 0.9); - --theme--ui_tooltip-description: rgba(206, 205, 202, 0.6); - - --theme--icon: rgba(55, 53, 47, 0.8); - --theme--icon_secondary: rgba(55, 53, 47, 0.4); - - --theme--text: rgb(55, 43, 47); - --theme--text_secondary: rgba(55, 43, 47, 0.6); - --theme--text_grey: rgb(155, 154, 151); - --theme--text_brown: rgb(100, 71, 58); - --theme--text_orange: rgb(217, 115, 13); - --theme--text_yellow: rgb(223, 171, 1); - --theme--text_green: rgb(15, 123, 108); - --theme--text_blue: rgb(11, 110, 153); - --theme--text_purple: rgb(105, 64, 165); - --theme--text_pink: rgb(173, 26, 114); - --theme--text_red: rgb(224, 62, 62); - - --theme--highlight-text: var(--theme--text); - --theme--highlight_grey: rgb(235, 236, 237); - --theme--highlight_grey-text: var(--theme--highlight-text); - --theme--highlight_brown: rgb(233, 229, 227); - --theme--highlight_brown-text: var(--theme--highlight-text); - --theme--highlight_orange: rgb(250, 235, 221); - --theme--highlight_orange-text: var(--theme--highlight-text); - --theme--highlight_yellow: rgb(251, 243, 219); - --theme--highlight_yellow-text: var(--theme--highlight-text); - --theme--highlight_green: rgb(221, 237, 234); - --theme--highlight_green-text: var(--theme--highlight-text); - --theme--highlight_blue: rgb(221, 235, 241); - --theme--highlight_blue-text: var(--theme--highlight-text); - --theme--highlight_purple: rgb(234, 228, 242); - --theme--highlight_purple-text: var(--theme--highlight-text); - --theme--highlight_pink: rgb(244, 223, 235); - --theme--highlight_pink-text: var(--theme--highlight-text); - --theme--highlight_red: rgb(251, 228, 228); - --theme--highlight_red-text: var(--theme--highlight-text); - - --theme--block-text: var(--theme--text); - --theme--block_grey: rgb(235, 236, 237); - --theme--block_grey-text: var(--theme--block-text); - --theme--block_brown: rgb(233, 229, 227); - --theme--block_brown-text: var(--theme--block-text); - --theme--block_orange: rgb(250, 235, 221); - --theme--block_orange-text: var(--theme--block-text); - --theme--block_yellow: rgb(251, 243, 219); - --theme--block_yellow-text: var(--theme--block-text); - --theme--block_green: rgb(221, 237, 234); - --theme--block_green-text: var(--theme--block-text); - --theme--block_blue: rgb(221, 235, 241); - --theme--block_blue-text: var(--theme--block-text); - --theme--block_purple: rgb(234, 228, 242); - --theme--block_purple-text: var(--theme--block-text); - --theme--block_pink: rgb(244, 223, 235); - --theme--block_pink-text: var(--theme--block-text); - --theme--block_red: rgb(251, 228, 228); - --theme--block_red-text: var(--theme--block-text); - - --theme--tag-text: var(--theme--text); - --theme--tag_default: rgba(206, 205, 202, 0.5); - --theme--tag_default-text: var(--theme--tag-text); - --theme--tag_grey: rgba(140, 46, 0, 0.2); - --theme--tag_grey-text: var(--theme--tag-text); - --theme--tag_brown: rgba(140, 46, 0, 0.2); - --theme--tag_brown-text: var(--theme--tag-text); - --theme--tag_orange: rgba(245, 93, 0, 0.2); - --theme--tag_orange-text: var(--theme--tag-text); - --theme--tag_yellow: rgba(233, 168, 0, 0.2); - --theme--tag_yellow-text: var(--theme--tag-text); - --theme--tag_green: rgba(0, 135, 107, 0.2); - --theme--tag_green-text: var(--theme--tag-text); - --theme--tag_blue: rgba(0, 120, 223, 0.2); - --theme--tag_blue-text: var(--theme--tag-text); - --theme--tag_purple: rgba(103, 36, 222, 0.2); - --theme--tag_purple-text: var(--theme--tag-text); - --theme--tag_pink: rgba(221, 0, 129, 0.2); - --theme--tag_pink-text: var(--theme--tag-text); - --theme--tag_red: rgba(255, 0, 26, 0.2); - --theme--tag_red-text: var(--theme--tag-text); - - --theme--callout-text: var(--theme--text); - --theme--callout_grey: rgba(235, 236, 237, 0.3); - --theme--callout_grey-text: var(--theme--callout-text); - --theme--callout_brown: rgba(233, 229, 227, 0.3); - --theme--callout_brown-text: var(--theme--callout-text); - --theme--callout_orange: rgba(250, 235, 221, 0.3); - --theme--callout_orange-text: var(--theme--callout-text); - --theme--callout_yellow: rgba(251, 243, 219, 0.3); - --theme--callout_yellow-text: var(--theme--callout-text); - --theme--callout_green: rgba(221, 237, 234, 0.3); - --theme--callout_green-text: var(--theme--callout-text); - --theme--callout_blue: rgba(221, 235, 241, 0.3); - --theme--callout_blue-text: var(--theme--callout-text); - --theme--callout_purple: rgba(234, 228, 242, 0.3); - --theme--callout_purple-text: var(--theme--callout-text); - --theme--callout_pink: rgba(244, 223, 235, 0.3); - --theme--callout_pink-text: var(--theme--callout-text); - --theme--callout_red: rgba(251, 228, 228, 0.3); - --theme--callout_red-text: var(--theme--callout-text); - - --theme--code_inline: rgba(135, 131, 120, 0.15); - --theme--code_inline-text: #eb5757; - - --theme--code: #f7f6f3; - --theme--code_plain: var(--theme--text); - --theme--code_property: #905; - --theme--code_tag: var(--theme--code_property); - --theme--code_boolean: var(--theme--code_property); - --theme--code_number: var(--theme--code_property); - --theme--code_constant: var(--theme--code_property); - --theme--code_symbol: var(--theme--code_property); - --theme--code_deleted: var(--theme--code_property); - --theme--code_selector: #690; - --theme--code_attr-name: var(--theme--code_selector); - --theme--code_string: var(--theme--code_selector); - --theme--code_char: var(--theme--code_selector); - --theme--code_builtin: var(--theme--code_selector); - --theme--code_inserted: var(--theme--code_selector); - --theme--code_operator: #9a6e3a; - --theme--code_entity: var(--theme--code_operator); - --theme--code_url: var(--theme--code_operator); - --theme--code_variable: var(--theme--code_regex); - --theme--code_comment: slategrey; - --theme--code_cdata: var(--theme--code_comment); - --theme--code_prolog: var(--theme--code_comment); - --theme--code_doctype: var(--theme--code_comment); - --theme--code_atrule: #07a; - --theme--code_attr-value: var(--theme--code_atrule); - --theme--code_keyword: var(--theme--code_atrule); - --theme--code_regex: #e90; - --theme--code_important: var(--theme--code_regex); - --theme--code_function: #dd4a68; - --theme--code_class-name: var(--theme--code_function); - --theme--code_parameter: var(--theme--code_plain); - --theme--code_decorator: var(--theme--code_plain); - --theme--code_id: var(--theme--code_plain); - --theme--code_class: var(--theme--code_plain); - --theme--code_pseudo-element: var(--theme--code_plain); - --theme--code_pseudo-class: var(--theme--code_plain); - --theme--code_attribute: var(--theme--code_plain); - --theme--code_value: var(--theme--code_plain); - --theme--code_unit: var(--theme--code_plain); - --theme--code_punctuation: #999; - --theme--code_annotation: var(--theme--code_plain); -} - -:root.dark { - --theme--bg: rgb(47, 52, 55); - --theme--bg_secondary: rgb(55, 60, 63); - --theme--bg_popup: rgb(63, 68, 71); - - --theme--scrollbar_track: rgba(202, 204, 206, 0.04); - --theme--scrollbar_thumb: #474c50; - --theme--scrollbar_thumb-hover: rgba(202, 204, 206, 0.3); - - --theme--ui_shadow: rgba(15, 15, 15, 0.15); - --theme--ui_divider: rgb(255, 255, 255, 0.07); - --theme--ui_interactive-hover: rgb(71, 76, 80); - --theme--ui_interactive-active: rgb(63, 68, 71); - --theme--ui_toggle-on: var(--theme--accent_blue); - --theme--ui_toggle-off: rgba(202, 204, 206, 0.3); - --theme--ui_toggle-feature: #fff; - --theme--ui_input: rgba(15, 15, 15, 0.3); - --theme--ui_tooltip: rgb(202, 204, 206); - --theme--ui_tooltip-title: rgb(15, 15, 15); - --theme--ui_tooltip-description: rgba(47, 52, 55, 0.6); - - --theme--icon: rgba(202, 204, 206); - --theme--icon_secondary: rgb(202, 204, 206, 0.6); - - --theme--text: rgba(255, 255, 255, 0.9); - --theme--text_secondary: rgba(255, 255, 255, 0.6); - --theme--text_grey: rgba(151, 154, 155, 0.95); - --theme--text_brown: rgb(147, 114, 100); - --theme--text_orange: rgb(255, 163, 68); - --theme--text_yellow: rgb(255, 220, 73); - --theme--text_green: rgb(77, 171, 154); - --theme--text_blue: rgb(82, 156, 202); - --theme--text_purple: rgb(154, 109, 215); - --theme--text_pink: rgb(226, 85, 161); - --theme--text_red: rgb(255, 115, 105); - - --theme--highlight-text: var(--theme--text); - --theme--highlight_grey: rgb(69, 75, 78); - --theme--highlight_grey-text: var(--theme--highlight-text); - --theme--highlight_brown: rgb(67, 64, 64); - --theme--highlight_brown-text: var(--theme--highlight-text); - --theme--highlight_orange: rgb(89, 74, 58); - --theme--highlight_orange-text: var(--theme--highlight-text); - --theme--highlight_yellow: rgb(89, 86, 59); - --theme--highlight_yellow-text: var(--theme--highlight-text); - --theme--highlight_green: rgb(53, 76, 75); - --theme--highlight_green-text: var(--theme--highlight-text); - --theme--highlight_blue: rgb(54, 73, 84); - --theme--highlight_blue-text: var(--theme--highlight-text); - --theme--highlight_purple: rgb(68, 63, 87); - --theme--highlight_purple-text: var(--theme--highlight-text); - --theme--highlight_pink: rgb(83, 59, 76); - --theme--highlight_pink-text: var(--theme--highlight-text); - --theme--highlight_red: rgb(89, 65, 65); - --theme--highlight_red-text: var(--theme--highlight-text); - - --theme--block-text: var(--theme--text); - --theme--block_grey: rgb(69, 75, 78); - --theme--block_grey-text: var(--theme--block-text); - --theme--block_brown: rgb(67, 64, 64); - --theme--block_brown-text: var(--theme--block-text); - --theme--block_orange: rgb(89, 74, 58); - --theme--block_orange-text: var(--theme--block-text); - --theme--block_yellow: rgb(89, 86, 59); - --theme--block_yellow-text: var(--theme--block-text); - --theme--block_green: rgb(53, 76, 75); - --theme--block_green-text: var(--theme--block-text); - --theme--block_blue: rgb(54, 73, 84); - --theme--block_blue-text: var(--theme--block-text); - --theme--block_purple: rgb(68, 63, 87); - --theme--block_purple-text: var(--theme--block-text); - --theme--block_pink: rgb(83, 59, 76); - --theme--block_pink-text: var(--theme--block-text); - --theme--block_red: rgb(89, 65, 65); - --theme--block_red-text: var(--theme--block-text); - - --theme--tag-text: var(--theme--text); - --theme--tag_default: rgb(80, 85, 88); - --theme--tag_default-text: var(--theme--tag-text); - --theme--tag_grey: rgba(151, 154, 155, 0.5); - --theme--tag_grey-text: var(--theme--tag-text); - --theme--tag_brown: rgba(147, 114, 100, 0.5); - --theme--tag_brown-text: var(--theme--tag-text); - --theme--tag_orange: rgba(255, 163, 68, 0.5); - --theme--tag_orange-text: var(--theme--tag-text); - --theme--tag_yellow: rgba(255, 220, 73, 0.5); - --theme--tag_yellow-text: var(--theme--tag-text); - --theme--tag_green: rgba(77, 171, 154, 0.5); - --theme--tag_green-text: var(--theme--tag-text); - --theme--tag_blue: rgba(82, 156, 202, 0.5); - --theme--tag_blue-text: var(--theme--tag-text); - --theme--tag_purple: rgba(154, 109, 215, 0.5); - --theme--tag_purple-text: var(--theme--tag-text); - --theme--tag_pink: rgba(226, 85, 161, 0.5); - --theme--tag_pink-text: var(--theme--tag-text); - --theme--tag_red: rgba(255, 115, 105, 0.5); - --theme--tag_red-text: var(--theme--tag-text); - - --theme--callout-text: var(--theme--text); - --theme--callout_grey: rgba(69, 75, 78, 0.3); - --theme--callout_grey-text: var(--theme--callout-text); - --theme--callout_brown: rgba(67, 64, 64, 0.3); - --theme--callout_brown-text: var(--theme--callout-text); - --theme--callout_orange: rgba(89, 74, 58, 0.3); - --theme--callout_orange-text: var(--theme--callout-text); - --theme--callout_yellow: rgba(89, 86, 59, 0.3); - --theme--callout_yellow-text: var(--theme--callout-text); - --theme--callout_green: rgba(53, 76, 75, 0.3); - --theme--callout_green-text: var(--theme--callout-text); - --theme--callout_blue: rgba(54, 73, 84, 0.3); - --theme--callout_blue-text: var(--theme--callout-text); - --theme--callout_purple: rgba(68, 63, 87, 0.3); - --theme--callout_purple-text: var(--theme--callout-text); - --theme--callout_pink: rgba(83, 59, 76, 0.3); - --theme--callout_pink-text: var(--theme--callout-text); - --theme--callout_red: rgba(89, 65, 65, 0.3); - --theme--callout_red-text: var(--theme--callout-text); - - --theme--code_inline: rgba(135, 131, 120, 0.15); - --theme--code_inline-text: #eb5757; - - --theme--code: rgb(63, 68, 71); - --theme--code_plain: var(--theme--text); - --theme--code_property: hsl(350, 40%, 70%); - --theme--code_tag: var(--theme--code_property); - --theme--code_boolean: var(--theme--code_property); - --theme--code_number: var(--theme--code_property); - --theme--code_constant: var(--theme--code_property); - --theme--code_symbol: var(--theme--code_property); - --theme--code_deleted: #f00; - --theme--code_selector: hsl(75, 70%, 60%); - --theme--code_attr-name: var(--theme--code_selector); - --theme--code_string: var(--theme--code_selector); - --theme--code_char: var(--theme--code_selector); - --theme--code_builtin: var(--theme--code_selector); - --theme--code_inserted: var(--theme--code_selector); - --theme--code_operator: hsl(40, 90%, 60%); - --theme--code_entity: var(--theme--code_operator); - --theme--code_url: var(--theme--code_operator); - --theme--code_variable: var(--theme--code_operator); - --theme--code_comment: hsl(30, 20%, 50%); - --theme--code_cdata: var(--theme--code_comment); - --theme--code_prolog: var(--theme--code_comment); - --theme--code_doctype: var(--theme--code_comment); - --theme--code_atrule: hsl(350, 40%, 70%); - --theme--code_attr-value: var(--theme--code_atrule); - --theme--code_keyword: var(--theme--code_atrule); - --theme--code_regex: #e90; - --theme--code_important: var(--theme--code_regex); - --theme--code_function: var(--theme--code_plain); - --theme--code_class-name: var(--theme--code_function); - --theme--code_parameter: var(--theme--code_plain); - --theme--code_decorator: var(--theme--code_plain); - --theme--code_id: var(--theme--code_plain); - --theme--code_class: var(--theme--code_plain); - --theme--code_pseudo-element: var(--theme--code_plain); - --theme--code_pseudo-class: var(--theme--code_plain); - --theme--code_attribute: var(--theme--code_plain); - --theme--code_value: var(--theme--code_plain); - --theme--code_unit: var(--theme--code_plain); - --theme--code_punctuation: var(--theme--code_plain); - --theme--code_annotation: var(--theme--code_plain); -} diff --git a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.css b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.css deleted file mode 100644 index b0bca23..0000000 --- a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - * notion-enhancer: tweaks - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (c) 2020 arecsu - * (https://notion-enhancer.github.io/) under the MIT license - */ - -.tweak--snappy_transitions * { - animation-duration: 0s !important; - transition-duration: 0s !important; -} -.tweak--snappy_transitions .notion-selectable-halo { - opacity: 1 !important; -} - -.tweak--hide_help .notion-help-button { - display: none !important; -} - -.tweak--thicker_bold .notion-page-content span[style*='font-weight:600'] { - font-weight: 700 !important; -} - -.tweak--spaced_lines .notion-page-content .notion-selectable.notion-text-block { - line-height: 1.65 !important; - margin-top: 0.75em !important; -} - -.tweak--condensed_bullets .notion-selectable.notion-bulleted_list-block { - margin-top: -1.5px !important; - margin-bottom: -1.5px !important; -} - -.tweak--responsive_breakpoint .notion-column_list-block [style='display: flex;'] > div { - width: 100% !important; -} -.tweak--responsive_breakpoint .notion-column_list-block [style='display: flex;'] { - flex-direction: column !important; -} -.tweak--responsive_breakpoint .notion-app-inner { - --theme--page-width: 100%; - --theme--page-padding: calc(48px + env(safe-area-inset-left)); -} - -.tweak--bracketed_links .notion-link-token span { - border-bottom: none !important; -} -.tweak--bracketed_links .notion-link-token:before { - content: '[['; - opacity: 0.7; - transition: opacity 100ms ease-in; -} -.tweak--bracketed_links .notion-link-token:after { - content: ']]'; - opacity: 0.7; - transition: opacity 100ms ease-in; -} -.tweak--bracketed_links .notion-link-token:hover::before, -.tweak--bracketed_links .notion-link-token:hover::after { - opacity: 1; -} diff --git a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.mjs b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.mjs deleted file mode 100644 index 42ae21c..0000000 --- a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/client.mjs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * notion-enhancer: tweaks - * (c) 2021 dragonwocky (https://dragonwocky.me/) - * (https://notion-enhancer.github.io/) under the MIT license - */ - -'use strict'; - -const _id = '5174a483-c88d-4bf8-a95f-35cd330b76e2'; -import { env, storage, web } from '../../api/_.mjs'; - -web.whenReady().then(async () => { - const cssInsert = await storage.get(_id, '_file.insert.css'); - if (cssInsert) { - document.body.append( - web.createElement( - web.html` - ` - ) - ); - } - - if (['linux', 'win32'].includes(env.name)) { - // dragarea_height - } - - for (const tweak of [ - 'snappy_transitions', - 'thicker_bold', - 'spaced_lines', - 'hide_help', - 'condensed_bullets', - 'bracketed_links', - ]) { - if (await storage.get(_id, `tweak.${tweak}`)) { - document.body.classList.add(`tweak--${tweak}`); - } - } - - const responsiveBreakpoint = await storage.get(_id, 'tweak.responsive_breakpoint'), - addResponsiveBreakpoint = () => { - document.body.classList.remove('tweak--responsive_breakpoint'); - if (window.innerWidth <= responsiveBreakpoint) { - document.body.classList.add('tweak--responsive_breakpoint'); - } - }; - window.addEventListener('resize', addResponsiveBreakpoint); - addResponsiveBreakpoint(); -}); diff --git a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/mod.json b/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/mod.json deleted file mode 100644 index 6b5203e..0000000 --- a/repo/tweaks@5174a483-c88d-4bf8-a95f-35cd330b76e2/mod.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "tweaks", - "id": "5174a483-c88d-4bf8-a95f-35cd330b76e2", - "version": "0.2.0", - "description": "common style/layout changes and custom CSS insertion.", - "tags": ["extension", "customisation"], - "authors": [ - { - "name": "dragonwocky", - "email": "thedragonring.bod@gmail.com", - "homepage": "https://dragonwocky.me/", - "avatar": "https://dragonwocky.me/avatar.jpg" - } - ], - "css": { - "client": ["client.css"] - }, - "js": { - "client": ["client.mjs"] - }, - "options": [ - { - "type": "file", - "key": "insert.css", - "label": "css insert", - "extensions": [".css"] - }, - { - "key": "tweak.dragarea_height", - "label": "height of frameless dragarea:", - "tooltip": "the rectangle added at the top of a window in 'integrated titlebar' mode, used to drag/move the window.", - "type": "number", - "value": 15, - "environments": ["linux", "win32"] - }, - { - "key": "tweak.responsive_breakpoint", - "label": "responsive columns breakpoint (px)", - "tooltip": "the width in pixels below which in-page columns are resized to appear full-width so content isn't squished.", - "type": "number", - "value": 600 - }, - { - "key": "tweak.snappy_transitions", - "label": "snappy transitions", - "tooltip": "set animation time for all css-driven animations to 0s. may not affect element motion e.g. the sidebar popping out.", - "type": "toggle", - "value": false - }, - { - "key": "tweak.hide_help", - "label": "hide help button", - "type": "toggle", - "value": false - }, - { - "key": "tweak.thicker_bold", - "label": "thicker bold text", - "type": "toggle", - "value": true - }, - { - "key": "tweak.spaced_lines", - "label": "readable line spacing", - "tooltip": "greater line spacing between text blocks.", - "type": "toggle", - "value": false - }, - { - "key": "tweak.condensed_bullets", - "label": "condense bullet points", - "tooltip": "tighter line spacing between bullet point blocks.", - "type": "toggle", - "value": false - }, - { - "key": "tweak.bracketed_links", - "label": "bracketed links", - "tooltip": "render links surrounded with [[brackets]] instead of __underlined__.", - "type": "toggle", - "value": false - } - ] -} diff --git a/worker.js b/worker.js index 0ec184d..48f5833 100644 --- a/worker.js +++ b/worker.js @@ -6,11 +6,9 @@ 'use strict'; -async function focusMenu() { +function focusMenu() { chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT }, (tabs) => { - const url = chrome.runtime.getURL( - 'repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html' - ), + const url = chrome.runtime.getURL('repo/menu/menu.html'), menu = tabs.find((tab) => tab.url.startsWith(url)); if (menu) { chrome.tabs.highlight({ 'tabs': menu.index }); @@ -19,7 +17,7 @@ async function focusMenu() { } chrome.browserAction.onClicked.addListener(focusMenu); -async function focusNotion() { +function focusNotion() { chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT }, (tabs) => { const notion = tabs.find((tab) => { const url = new URL(tab.url), @@ -32,11 +30,9 @@ async function focusNotion() { }); } -async function reload() { +function reload() { chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT }, (tabs) => { - const menu = chrome.runtime.getURL( - 'repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html' - ); + const menu = chrome.runtime.getURL('repo/menu/menu.html'); tabs.forEach((tab) => { const url = new URL(tab.url), matches =