UNPKG

@ljcl/storybook-addon-cssprops

Version:
1,243 lines (1,241 loc) 366 kB
import { __name, __commonJS, __require, __toESM, getControlId, getControlSetterButtonId } from './chunk-QUADPZQG.js'; import * as React20 from 'react'; import React20__default, { createContext, lazy, useState, useEffect, Component, Children, useContext, useCallback, cloneElement, useRef, useId, useMemo, Suspense } from 'react'; import { addons, types, useParameter } from 'storybook/manager-api'; import { withReset, SyntaxHighlighter, FlexBar, Form, IconButton, codeCommon, components, AddonPanel, getStoryHref, Zoom, ActionBar, nameSpaceClassNames, H2, Link, ResetWrapper, TabsState, EmptyTabContent, Code, H3, WithTooltipPure, Button, Loader, ErrorFormatter } from 'storybook/internal/components'; import { styled, ignoreSsrWarning, useTheme, themes, ThemeProvider, convert, ensure } from 'storybook/theming'; import { deprecate, once, logger } from 'storybook/internal/client-logger'; import { includeConditionalArg } from 'storybook/internal/csf'; import { ChevronSmallUpIcon, ChevronSmallDownIcon, ChevronDownIcon as ChevronDownIcon$1, ChevronRightIcon, ZoomIcon, ZoomOutIcon, ZoomResetIcon, ShareAltIcon, LinkIcon, DocumentIcon, UndoIcon, EyeCloseIcon, EyeIcon, SubtractIcon, AddIcon } from '@storybook/icons'; import { NAVIGATE_URL, GLOBALS_UPDATED, STORY_ARGS_UPDATED, UPDATE_STORY_ARGS, RESET_STORY_ARGS } from 'storybook/internal/core-events'; import { DocsContext as DocsContext$1, Preview as Preview$1, composeConfigs, filterArgTypes } from 'storybook/preview-api'; import { SNIPPET_RENDERED, SourceType } from 'storybook/internal/docs-tools'; import { Channel } from 'storybook/internal/channels'; function _extends() { return _extends = Object.assign ? Object.assign.bind() : function(n2) { for (var e2 = 1; e2 < arguments.length; e2++) { var t = arguments[e2]; for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n2[r2] = t[r2]); } return n2; }, _extends.apply(null, arguments); } __name(_extends, "_extends"); function _assertThisInitialized(e2) { if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e2; } __name(_assertThisInitialized, "_assertThisInitialized"); function _setPrototypeOf(t, e2) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e22) { return t2.__proto__ = e22, t2; }, _setPrototypeOf(t, e2); } __name(_setPrototypeOf, "_setPrototypeOf"); function _inheritsLoose(t, o2) { t.prototype = Object.create(o2.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o2); } __name(_inheritsLoose, "_inheritsLoose"); function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t2) { return t2.__proto__ || Object.getPrototypeOf(t2); }, _getPrototypeOf(t); } __name(_getPrototypeOf, "_getPrototypeOf"); function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n2) { return "function" == typeof t; } } __name(_isNativeFunction, "_isNativeFunction"); function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch (t2) { } return (_isNativeReflectConstruct = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() { return !!t; }, "_isNativeReflectConstruct"))(); } __name(_isNativeReflectConstruct, "_isNativeReflectConstruct"); function _construct(t, e2, r2) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o2 = [null]; o2.push.apply(o2, e2); var p2 = new (t.bind.apply(t, o2))(); return r2 && _setPrototypeOf(p2, r2.prototype), p2; } __name(_construct, "_construct"); function _wrapNativeSuper(t) { var r2 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; return _wrapNativeSuper = /* @__PURE__ */ __name(function _wrapNativeSuper2(t2) { if (null === t2 || !_isNativeFunction(t2)) return t2; if ("function" != typeof t2) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r2) { if (r2.has(t2)) return r2.get(t2); r2.set(t2, Wrapper23); } function Wrapper23() { return _construct(t2, arguments, _getPrototypeOf(this).constructor); } __name(Wrapper23, "Wrapper"); return Wrapper23.prototype = Object.create(t2.prototype, { constructor: { value: Wrapper23, enumerable: false, writable: true, configurable: true } }), _setPrototypeOf(Wrapper23, t2); }, "_wrapNativeSuper"), _wrapNativeSuper(t); } __name(_wrapNativeSuper, "_wrapNativeSuper"); var ERRORS = { "1": "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n", "2": "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n", "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n", "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n", "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n", "6": "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n", "7": "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n", "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n", "9": "Please provide a number of steps to the modularScale helper.\n\n", "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n", "11": 'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n', "12": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n', "13": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n', "14": 'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n', "15": 'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n', "16": "You must provide a template to this method.\n\n", "17": "You passed an unsupported selector state to this method.\n\n", "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n", "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n", "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n", "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n", "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n", "23": "fontFace expects a name of a font-family.\n\n", "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n", "25": "fontFace expects localFonts to be an array.\n\n", "26": "fontFace expects fileFormats to be an array.\n\n", "27": "radialGradient requries at least 2 color-stops to properly render.\n\n", "28": "Please supply a filename to retinaImage() as the first argument.\n\n", "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n", "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n", "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n", "32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n", "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n", "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n", "35": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n', "36": "Property must be a string value.\n\n", "37": "Syntax Error at %s.\n\n", "38": "Formula contains a function that needs parentheses at %s.\n\n", "39": "Formula is missing closing parenthesis at %s.\n\n", "40": "Formula has too many closing parentheses at %s.\n\n", "41": "All values in a formula must have the same unit or be unitless.\n\n", "42": "Please provide a number of steps to the modularScale helper.\n\n", "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n", "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n", "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n", "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n", "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n", "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n", "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n", "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n", "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n", "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n", "53": "fontFace expects localFonts to be an array.\n\n", "54": "fontFace expects fileFormats to be an array.\n\n", "55": "fontFace expects a name of a font-family.\n\n", "56": "linearGradient requries at least 2 color-stops to properly render.\n\n", "57": "radialGradient requries at least 2 color-stops to properly render.\n\n", "58": "Please supply a filename to retinaImage() as the first argument.\n\n", "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n", "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n", "61": "Property must be a string value.\n\n", "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n", "63": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n', "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n", "65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n", "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n", "67": "You must provide a template to this method.\n\n", "68": "You passed an unsupported selector state to this method.\n\n", "69": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n', "70": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n', "71": 'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n', "72": 'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n', "73": "Please provide a valid CSS variable.\n\n", "74": "CSS variable not found and no default was provided.\n\n", "75": "important requires a valid style object, got a %s instead.\n\n", "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n", "77": 'remToPx expects a value in "rem" but you provided it in "%s".\n\n', "78": 'base must be set in "px" or "%" but you set it in "%s".\n' }; function format() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var a2 = args[0]; var b2 = []; var c2; for (c2 = 1; c2 < args.length; c2 += 1) { b2.push(args[c2]); } b2.forEach(function(d2) { a2 = a2.replace(/%[a-z]/, d2); }); return a2; } __name(format, "format"); var PolishedError = (function(_Error) { _inheritsLoose(PolishedError2, _Error); function PolishedError2(code) { var _this; { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } _this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this; } return _assertThisInitialized(_this); } __name(PolishedError2, "PolishedError"); return PolishedError2; })(_wrapNativeSuper(Error)); function endsWith(string, suffix) { return string.substr(-suffix.length) === suffix; } __name(endsWith, "endsWith"); var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/; function stripUnit(value2) { if (typeof value2 !== "string") return value2; var matchedValue = value2.match(cssRegex$1); return matchedValue ? parseFloat(value2) : value2; } __name(stripUnit, "stripUnit"); var pxtoFactory = /* @__PURE__ */ __name(function pxtoFactory2(to) { return function(pxval, base) { if (base === void 0) { base = "16px"; } var newPxval = pxval; var newBase = base; if (typeof pxval === "string") { if (!endsWith(pxval, "px")) { throw new PolishedError(69, to, pxval); } newPxval = stripUnit(pxval); } if (typeof base === "string") { if (!endsWith(base, "px")) { throw new PolishedError(70, to, base); } newBase = stripUnit(base); } if (typeof newPxval === "string") { throw new PolishedError(71, pxval, to); } if (typeof newBase === "string") { throw new PolishedError(72, base, to); } return "" + newPxval / newBase + to; }; }, "pxtoFactory"); var pixelsto = pxtoFactory; pixelsto("em"); pixelsto("rem"); function colorToInt(color) { return Math.round(color * 255); } __name(colorToInt, "colorToInt"); function convertToInt(red, green, blue) { return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue); } __name(convertToInt, "convertToInt"); function hslToRgb(hue, saturation, lightness, convert2) { if (convert2 === void 0) { convert2 = convertToInt; } if (saturation === 0) { return convert2(lightness, lightness, lightness); } var huePrime = (hue % 360 + 360) % 360 / 60; var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation; var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)); var red = 0; var green = 0; var blue = 0; if (huePrime >= 0 && huePrime < 1) { red = chroma; green = secondComponent; } else if (huePrime >= 1 && huePrime < 2) { red = secondComponent; green = chroma; } else if (huePrime >= 2 && huePrime < 3) { green = chroma; blue = secondComponent; } else if (huePrime >= 3 && huePrime < 4) { green = secondComponent; blue = chroma; } else if (huePrime >= 4 && huePrime < 5) { red = secondComponent; blue = chroma; } else if (huePrime >= 5 && huePrime < 6) { red = chroma; blue = secondComponent; } var lightnessModification = lightness - chroma / 2; var finalRed = red + lightnessModification; var finalGreen = green + lightnessModification; var finalBlue = blue + lightnessModification; return convert2(finalRed, finalGreen, finalBlue); } __name(hslToRgb, "hslToRgb"); var namedColorMap = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "639", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }; function nameToHex(color) { if (typeof color !== "string") return color; var normalizedColorName = color.toLowerCase(); return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color; } __name(nameToHex, "nameToHex"); var hexRegex = /^#[a-fA-F0-9]{6}$/; var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/; var reducedHexRegex = /^#[a-fA-F0-9]{3}$/; var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/; var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i; var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i; var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i; var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i; function parseToRgb(color) { if (typeof color !== "string") { throw new PolishedError(3); } var normalizedColor = nameToHex(color); if (normalizedColor.match(hexRegex)) { return { red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16), green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16), blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16) }; } if (normalizedColor.match(hexRgbaRegex)) { var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2)); return { red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16), green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16), blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16), alpha }; } if (normalizedColor.match(reducedHexRegex)) { return { red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16), green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16), blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16) }; } if (normalizedColor.match(reducedRgbaHexRegex)) { var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2)); return { red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16), green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16), blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16), alpha: _alpha }; } var rgbMatched = rgbRegex.exec(normalizedColor); if (rgbMatched) { return { red: parseInt("" + rgbMatched[1], 10), green: parseInt("" + rgbMatched[2], 10), blue: parseInt("" + rgbMatched[3], 10) }; } var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50)); if (rgbaMatched) { return { red: parseInt("" + rgbaMatched[1], 10), green: parseInt("" + rgbaMatched[2], 10), blue: parseInt("" + rgbaMatched[3], 10), alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4]) }; } var hslMatched = hslRegex.exec(normalizedColor); if (hslMatched) { var hue = parseInt("" + hslMatched[1], 10); var saturation = parseInt("" + hslMatched[2], 10) / 100; var lightness = parseInt("" + hslMatched[3], 10) / 100; var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")"; var hslRgbMatched = rgbRegex.exec(rgbColorString); if (!hslRgbMatched) { throw new PolishedError(4, normalizedColor, rgbColorString); } return { red: parseInt("" + hslRgbMatched[1], 10), green: parseInt("" + hslRgbMatched[2], 10), blue: parseInt("" + hslRgbMatched[3], 10) }; } var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50)); if (hslaMatched) { var _hue = parseInt("" + hslaMatched[1], 10); var _saturation = parseInt("" + hslaMatched[2], 10) / 100; var _lightness = parseInt("" + hslaMatched[3], 10) / 100; var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")"; var _hslRgbMatched = rgbRegex.exec(_rgbColorString); if (!_hslRgbMatched) { throw new PolishedError(4, normalizedColor, _rgbColorString); } return { red: parseInt("" + _hslRgbMatched[1], 10), green: parseInt("" + _hslRgbMatched[2], 10), blue: parseInt("" + _hslRgbMatched[3], 10), alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4]) }; } throw new PolishedError(5); } __name(parseToRgb, "parseToRgb"); function rgbToHsl(color) { var red = color.red / 255; var green = color.green / 255; var blue = color.blue / 255; var max = Math.max(red, green, blue); var min = Math.min(red, green, blue); var lightness = (max + min) / 2; if (max === min) { if (color.alpha !== void 0) { return { hue: 0, saturation: 0, lightness, alpha: color.alpha }; } else { return { hue: 0, saturation: 0, lightness }; } } var hue; var delta = max - min; var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min); switch (max) { case red: hue = (green - blue) / delta + (green < blue ? 6 : 0); break; case green: hue = (blue - red) / delta + 2; break; default: hue = (red - green) / delta + 4; break; } hue *= 60; if (color.alpha !== void 0) { return { hue, saturation, lightness, alpha: color.alpha }; } return { hue, saturation, lightness }; } __name(rgbToHsl, "rgbToHsl"); function parseToHsl(color) { return rgbToHsl(parseToRgb(color)); } __name(parseToHsl, "parseToHsl"); var reduceHexValue = /* @__PURE__ */ __name(function reduceHexValue2(value2) { if (value2.length === 7 && value2[1] === value2[2] && value2[3] === value2[4] && value2[5] === value2[6]) { return "#" + value2[1] + value2[3] + value2[5]; } return value2; }, "reduceHexValue"); var reduceHexValue$1 = reduceHexValue; function numberToHex(value2) { var hex = value2.toString(16); return hex.length === 1 ? "0" + hex : hex; } __name(numberToHex, "numberToHex"); function colorToHex(color) { return numberToHex(Math.round(color * 255)); } __name(colorToHex, "colorToHex"); function convertToHex(red, green, blue) { return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue)); } __name(convertToHex, "convertToHex"); function hslToHex(hue, saturation, lightness) { return hslToRgb(hue, saturation, lightness, convertToHex); } __name(hslToHex, "hslToHex"); function hsl(value2, saturation, lightness) { if (typeof value2 === "number" && typeof saturation === "number" && typeof lightness === "number") { return hslToHex(value2, saturation, lightness); } else if (typeof value2 === "object" && saturation === void 0 && lightness === void 0) { return hslToHex(value2.hue, value2.saturation, value2.lightness); } throw new PolishedError(1); } __name(hsl, "hsl"); function hsla(value2, saturation, lightness, alpha) { if (typeof value2 === "number" && typeof saturation === "number" && typeof lightness === "number" && typeof alpha === "number") { return alpha >= 1 ? hslToHex(value2, saturation, lightness) : "rgba(" + hslToRgb(value2, saturation, lightness) + "," + alpha + ")"; } else if (typeof value2 === "object" && saturation === void 0 && lightness === void 0 && alpha === void 0) { return value2.alpha >= 1 ? hslToHex(value2.hue, value2.saturation, value2.lightness) : "rgba(" + hslToRgb(value2.hue, value2.saturation, value2.lightness) + "," + value2.alpha + ")"; } throw new PolishedError(2); } __name(hsla, "hsla"); function rgb(value2, green, blue) { if (typeof value2 === "number" && typeof green === "number" && typeof blue === "number") { return reduceHexValue$1("#" + numberToHex(value2) + numberToHex(green) + numberToHex(blue)); } else if (typeof value2 === "object" && green === void 0 && blue === void 0) { return reduceHexValue$1("#" + numberToHex(value2.red) + numberToHex(value2.green) + numberToHex(value2.blue)); } throw new PolishedError(6); } __name(rgb, "rgb"); function rgba(firstValue, secondValue, thirdValue, fourthValue) { if (typeof firstValue === "string" && typeof secondValue === "number") { var rgbValue = parseToRgb(firstValue); return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")"; } else if (typeof firstValue === "number" && typeof secondValue === "number" && typeof thirdValue === "number" && typeof fourthValue === "number") { return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")"; } else if (typeof firstValue === "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0) { return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")"; } throw new PolishedError(7); } __name(rgba, "rgba"); var isRgb = /* @__PURE__ */ __name(function isRgb2(color) { return typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number" && (typeof color.alpha !== "number" || typeof color.alpha === "undefined"); }, "isRgb"); var isRgba = /* @__PURE__ */ __name(function isRgba2(color) { return typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number" && typeof color.alpha === "number"; }, "isRgba"); var isHsl = /* @__PURE__ */ __name(function isHsl2(color) { return typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number" && (typeof color.alpha !== "number" || typeof color.alpha === "undefined"); }, "isHsl"); var isHsla = /* @__PURE__ */ __name(function isHsla2(color) { return typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number" && typeof color.alpha === "number"; }, "isHsla"); function toColorString(color) { if (typeof color !== "object") throw new PolishedError(8); if (isRgba(color)) return rgba(color); if (isRgb(color)) return rgb(color); if (isHsla(color)) return hsla(color); if (isHsl(color)) return hsl(color); throw new PolishedError(8); } __name(toColorString, "toColorString"); function curried(f2, length, acc) { return /* @__PURE__ */ __name(function fn() { var combined = acc.concat(Array.prototype.slice.call(arguments)); return combined.length >= length ? f2.apply(this, combined) : curried(f2, length, combined); }, "fn"); } __name(curried, "curried"); function curry(f2) { return curried(f2, f2.length, []); } __name(curry, "curry"); function adjustHue(degree, color) { if (color === "transparent") return color; var hslColor = parseToHsl(color); return toColorString(_extends({}, hslColor, { hue: hslColor.hue + parseFloat(degree) })); } __name(adjustHue, "adjustHue"); curry(adjustHue); function guard(lowerBoundary, upperBoundary, value2) { return Math.max(lowerBoundary, Math.min(upperBoundary, value2)); } __name(guard, "guard"); function darken(amount, color) { if (color === "transparent") return color; var hslColor = parseToHsl(color); return toColorString(_extends({}, hslColor, { lightness: guard(0, 1, hslColor.lightness - parseFloat(amount)) })); } __name(darken, "darken"); var curriedDarken = curry(darken); var curriedDarken$1 = curriedDarken; function desaturate(amount, color) { if (color === "transparent") return color; var hslColor = parseToHsl(color); return toColorString(_extends({}, hslColor, { saturation: guard(0, 1, hslColor.saturation - parseFloat(amount)) })); } __name(desaturate, "desaturate"); curry(desaturate); function lighten(amount, color) { if (color === "transparent") return color; var hslColor = parseToHsl(color); return toColorString(_extends({}, hslColor, { lightness: guard(0, 1, hslColor.lightness + parseFloat(amount)) })); } __name(lighten, "lighten"); var curriedLighten = curry(lighten); var curriedLighten$1 = curriedLighten; function mix(weight, color, otherColor) { if (color === "transparent") return otherColor; if (otherColor === "transparent") return color; if (weight === 0) return otherColor; var parsedColor1 = parseToRgb(color); var color1 = _extends({}, parsedColor1, { alpha: typeof parsedColor1.alpha === "number" ? parsedColor1.alpha : 1 }); var parsedColor2 = parseToRgb(otherColor); var color2 = _extends({}, parsedColor2, { alpha: typeof parsedColor2.alpha === "number" ? parsedColor2.alpha : 1 }); var alphaDelta = color1.alpha - color2.alpha; var x2 = parseFloat(weight) * 2 - 1; var y2 = x2 * alphaDelta === -1 ? x2 : x2 + alphaDelta; var z2 = 1 + x2 * alphaDelta; var weight1 = (y2 / z2 + 1) / 2; var weight2 = 1 - weight1; var mixedColor = { red: Math.floor(color1.red * weight1 + color2.red * weight2), green: Math.floor(color1.green * weight1 + color2.green * weight2), blue: Math.floor(color1.blue * weight1 + color2.blue * weight2), alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight)) }; return rgba(mixedColor); } __name(mix, "mix"); var curriedMix = curry(mix); var mix$1 = curriedMix; function opacify(amount, color) { if (color === "transparent") return color; var parsedColor = parseToRgb(color); var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1; var colorWithAlpha = _extends({}, parsedColor, { alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100) }); return rgba(colorWithAlpha); } __name(opacify, "opacify"); var curriedOpacify = curry(opacify); var curriedOpacify$1 = curriedOpacify; function saturate(amount, color) { if (color === "transparent") return color; var hslColor = parseToHsl(color); return toColorString(_extends({}, hslColor, { saturation: guard(0, 1, hslColor.saturation + parseFloat(amount)) })); } __name(saturate, "saturate"); curry(saturate); function setHue(hue, color) { if (color === "transparent") return color; return toColorString(_extends({}, parseToHsl(color), { hue: parseFloat(hue) })); } __name(setHue, "setHue"); curry(setHue); function setLightness(lightness, color) { if (color === "transparent") return color; return toColorString(_extends({}, parseToHsl(color), { lightness: parseFloat(lightness) })); } __name(setLightness, "setLightness"); curry(setLightness); function setSaturation(saturation, color) { if (color === "transparent") return color; return toColorString(_extends({}, parseToHsl(color), { saturation: parseFloat(saturation) })); } __name(setSaturation, "setSaturation"); curry(setSaturation); function shade(percentage, color) { if (color === "transparent") return color; return mix$1(parseFloat(percentage), "rgb(0, 0, 0)", color); } __name(shade, "shade"); curry(shade); function tint(percentage, color) { if (color === "transparent") return color; return mix$1(parseFloat(percentage), "rgb(255, 255, 255)", color); } __name(tint, "tint"); curry(tint); function transparentize(amount, color) { if (color === "transparent") return color; var parsedColor = parseToRgb(color); var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1; var colorWithAlpha = _extends({}, parsedColor, { alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100) }); return rgba(colorWithAlpha); } __name(transparentize, "transparentize"); var curriedTransparentize = curry(transparentize); var curriedTransparentize$1 = curriedTransparentize; var Wrapper = styled.div(withReset, ({ theme }) => ({ backgroundColor: theme.base === "light" ? "rgba(0,0,0,.01)" : "rgba(255,255,255,.01)", borderRadius: theme.appBorderRadius, border: `1px dashed ${theme.appBorderColor}`, display: "flex", alignItems: "center", justifyContent: "center", padding: 20, margin: "25px 0 40px", color: curriedTransparentize$1(0.3, theme.color.defaultText), fontSize: theme.typography.size.s2 })); var EmptyBlock = /* @__PURE__ */ __name((props) => React20__default.createElement(Wrapper, { ...props, className: "docblock-emptyblock sb-unstyled" }), "EmptyBlock"); var StyledSyntaxHighlighter = styled( SyntaxHighlighter )(({ theme }) => ({ // DocBlocks-specific styling and overrides fontSize: `${theme.typography.size.s2 - 1}px`, lineHeight: "19px", margin: "25px 0 40px", borderRadius: theme.appBorderRadius, boxShadow: theme.base === "light" ? "rgba(0, 0, 0, 0.10) 0 1px 3px 0" : "rgba(0, 0, 0, 0.20) 0 2px 5px 0", "pre.prismjs": { padding: 20, background: "inherit" } })); var SourceSkeletonWrapper = styled.div(({ theme }) => ({ background: theme.background.content, borderRadius: theme.appBorderRadius, border: `1px solid ${theme.appBorderColor}`, boxShadow: theme.base === "light" ? "rgba(0, 0, 0, 0.10) 0 1px 3px 0" : "rgba(0, 0, 0, 0.20) 0 2px 5px 0", margin: "25px 0 40px", padding: "20px 20px 20px 22px" })); var SourceSkeletonPlaceholder = styled.div(({ theme }) => ({ animation: `${theme.animation.glow} 1.5s ease-in-out infinite`, background: theme.appBorderColor, height: 17, marginTop: 1, width: "60%", [`&:first-child${ignoreSsrWarning}`]: { margin: 0 } })); var SourceSkeleton = /* @__PURE__ */ __name(() => React20__default.createElement(SourceSkeletonWrapper, null, React20__default.createElement(SourceSkeletonPlaceholder, null), React20__default.createElement(SourceSkeletonPlaceholder, { style: { width: "80%" } }), React20__default.createElement(SourceSkeletonPlaceholder, { style: { width: "30%" } }), React20__default.createElement(SourceSkeletonPlaceholder, { style: { width: "80%" } })), "SourceSkeleton"); var Source = /* @__PURE__ */ __name(({ isLoading, error, language, code, dark, format: format2 = true, ...rest }) => { const { typography } = useTheme(); if (isLoading) { return React20__default.createElement(SourceSkeleton, null); } if (error) { return React20__default.createElement(EmptyBlock, null, error); } const syntaxHighlighter = React20__default.createElement( StyledSyntaxHighlighter, { bordered: true, copyable: true, format: format2, language: language ?? "jsx", className: "docblock-source sb-unstyled", ...rest }, code ); if (typeof dark === "undefined") { return syntaxHighlighter; } const overrideTheme = dark ? themes.dark : themes.light; return React20__default.createElement( ThemeProvider, { theme: convert({ ...overrideTheme, fontCode: typography.fonts.mono, fontBase: typography.fonts.base }) }, syntaxHighlighter ); }, "Source"); // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js function dedent(templ) { var values = []; for (var _i = 1; _i < arguments.length; _i++) { values[_i - 1] = arguments[_i]; } var strings = Array.from(typeof templ === "string" ? [templ] : templ); strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, ""); var indentLengths = strings.reduce(function(arr, str) { var matches = str.match(/\n([\t ]+|(?!\s).)/g); if (matches) { return arr.concat(matches.map(function(match) { var _a, _b; return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; })); } return arr; }, []); if (indentLengths.length) { var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g"); strings = strings.map(function(str) { return str.replace(pattern_1, "\n"); }); } strings[0] = strings[0].replace(/^\r?\n/, ""); var string = strings[0]; values.forEach(function(value2, i2) { var endentations = string.match(/(?:^|\n)( *)$/); var endentation = endentations ? endentations[1] : ""; var indentedValue = value2; if (typeof value2 === "string" && value2.includes("\n")) { indentedValue = String(value2).split("\n").map(function(str, i3) { return i3 === 0 ? str : "" + endentation + str; }).join("\n"); } string += indentedValue + strings[i2 + 1]; }); return string; } var require_memoizerific = __commonJS({ "../../node_modules/memoizerific/memoizerific.js"(exports, module) { (function(f2) { if (typeof exports === "object" && typeof module !== "undefined") { module.exports = f2(); } else if (typeof define === "function" && define.amd) { define([], f2); } else { var g2; if (typeof window !== "undefined") { g2 = window; } else if (typeof global !== "undefined") { g2 = global; } else if (typeof self !== "undefined") { g2 = self; } else { g2 = this; } g2.memoizerific = f2(); } })(function() { return (/* @__PURE__ */ __name(function e2(t, n2, r2) { function s2(o3, u2) { if (!n2[o3]) { if (!t[o3]) { var a2 = typeof __require == "function" && __require; if (!u2 && a2) return a2(o3, true); if (i2) return i2(o3, true); var f2 = new Error("Cannot find module '" + o3 + "'"); throw f2.code = "MODULE_NOT_FOUND", f2; } var l2 = n2[o3] = { exports: {} }; t[o3][0].call(l2.exports, function(e3) { var n3 = t[o3][1][e3]; return s2(n3 ? n3 : e3); }, l2, l2.exports, e2, t, n2, r2); } return n2[o3].exports; } __name(s2, "s"); var i2 = typeof __require == "function" && __require; for (var o2 = 0; o2 < r2.length; o2++) s2(r2[o2]); return s2; }, "e"))({ 1: [function(_dereq_, module3, exports3) { module3.exports = function(forceSimilar) { if (typeof Map !== "function" || forceSimilar) { var Similar = _dereq_("./similar"); return new Similar(); } else { return /* @__PURE__ */ new Map(); } }; }, { "./similar": 2 }], 2: [function(_dereq_, module3, exports3) { function Similar() { this.list = []; this.lastItem = void 0; this.size = 0; return this; } __name(Similar, "Similar"); Similar.prototype.get = function(key) { var index; if (this.lastItem && this.isEqual(this.lastItem.key, key)) { return this.lastItem.val; } index = this.indexOf(key); if (index >= 0) { this.lastItem = this.list[index]; return this.list[index].val; } return void 0; }; Similar.prototype.set = function(key, val) { var index; if (this.lastItem && this.isEqual(this.lastItem.key, key)) { this.lastItem.val = val; return this; } index = this.indexOf(key); if (index >= 0) { this.lastItem = this.list[index]; this.list[index].val = val; return this; } this.lastItem = { key, val }; this.list.push(this.lastItem); this.size++; return this; }; Similar.prototype.delete = function(key) { var index; if (this.lastItem && this.isEqual(this.lastItem.key, key)) { this.lastItem = void 0; } index = this.indexOf(key); if (index >= 0) { this.size--; return this.list.splice(index, 1)[0]; } return void 0; }; Similar.prototype.has = function(key) { var index; if (this.lastItem && this.isEqual(this.lastItem.key, key)) { return true; } index = this.indexOf(key); if (index >= 0) { this.lastItem = this.list[index]; return true; } return false; }; Similar.prototype.forEach = function(callback, thisArg) { var i2; for (i2 = 0; i2 < this.size; i2++) { callback.call(thisArg || this, this.list[i2].val, this.list[i2].key, this); } }; Similar.prototype.indexOf = function(key) { var i2; for (i2 = 0; i2 < this.size; i2++) { if (this.isEqual(this.list[i2].key, key)) { return i2; } } return -1; }; Similar.prototype.isEqual = function(val1, val2) { return val1 === val2 || val1 !== val1 && val2 !== val2; }; module3.exports = Similar; }, {}], 3: [function(_dereq_, module3, exports3) { var MapOrSimilar = _dereq_("map-or-similar"); module3.exports = function(limit) { var cache = new MapOrSimilar(false), lru = []; return function(fn) { var memoizerific = /* @__PURE__ */ __name(function() { var currentCache = cache, newMap, fnResult, argsLengthMinusOne = arguments.length - 1, lruPath = Array(argsLengthMinusOne + 1), isMemoized = true, i2; if ((memoizerific.numArgs || memoizerific.numArgs === 0) && memoizerific.numArgs !== argsLengthMinusOne + 1) { throw new Error("Memoizerific functions should always be called with the same number of arguments"); } for (i2 = 0; i2 < argsLengthMinusOne; i2++) { lruPath[i2] = { cacheItem: currentCache, arg: arguments[i2] }; if (currentCache.has(arguments[i2])) { currentCache = currentCache.get(arguments[i2]); continue; } isMemoized = false; newMap = new MapOrSimilar(false); currentCache.set(arguments[i2], newMap); currentCache = newMap; } if (isMemoized) { if (currentCache.has(arguments[argsLengthMinusOne])) { fnResult = currentCache.get(arguments[argsLengthMinusOne]); } else { isMemoized = false; } } if (!isMemoized) { fnResult = fn.apply(null, arguments); currentCache.set(arguments[argsLengthMinusOne], fnResult); } if (limit > 0) { lruPath[argsLengthMinusOne] = { cacheItem: currentCache, arg: arguments[argsLengthMinusOne] }; if (isMemoized) { moveToMostRecentLru(lru, lruPath); } else { lru.push(lruPath); } if (lru.length > limit) { removeCachedResult(lru.shift()); } } memoizerific.wasMemoized = isMemoized; memoizerific.numArgs = argsLengthMinusOne + 1; return fnResult; }, "memoizerific"); memoizerific.limit = limit; memoizerific.wasMemoized = false; memoizerific.cache = cache; memoizerific.lru = lru; return memoizerific; }; }; function moveToMostRecentLru(lru, lruPath) { var lruLen = lru.length, lruPathLen = lruPath.length, isMatch, i2, ii; for (i2 = 0; i2 < lruLen; i2++) { isMatch = true; for (ii = 0; ii < lruPathLen; ii++) { if (!isEqual(lru[i2][ii].arg, lruPath[ii].arg)) { isMatch = false; break; } } if (isMatch) { break; } } lru.push(lru.splice(i2, 1)[0]); } __name(moveToMostRecentLru, "moveToMostRecentLru"); function removeCachedResult(removedLru) { var removedLruLen = removedLru.length, currentLru = removedLru[removedLruLen - 1], tmp, i2; currentLru.cacheItem.delete(currentLru.arg); for (i2 = removedLruLen - 2; i2 >= 0; i2--) { currentLru = removedLru[i2]; tmp = currentLru.cacheItem.get(currentLru.arg); if (!tmp || !tmp.size) { currentLru.cacheItem.delete(currentLru.arg); } else { break; } } } __name(removeCachedResult, "removeCachedResult"); function isEqual(val1, val2) { return val1 === val2 || val1 !== val1 && val2 !== val2; } __name(isEqual, "isEqual"); }, { "map-or-similar": 1 }] }, {}, [3])(3); }); } }); function isPrimitive(value2) { return value2 == null || typeof value2 !== "object" && typeof value2 !== "function"; } __name(isPrimitive, "isPrimitive"); function isTypedArray(x2) { return ArrayBuffer.isView(x2) && !(x2 instanceof DataView); } __name(isTypedArray, "isTypedArray"); function getSymbols(object2) { return Object.getOwnPropertySymbols(object2).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object2, symbol)); } __name(getSymbols, "getSymbols"); function getTag(value2) { if (value2 == null) { return value2 === void 0 ? "[object Undefined]" : "[object Null]"; } return Object.prototype.toString.call(value2); } __name(getTag, "getTag"); var regexpTag = "[object RegExp]"; var stringTag = "[object String]"; var numberTag = "[object Number]"; var booleanTag = "[object Boolean]"; var argumentsTag = "[object Arguments]"; var symbolTag = "[object Symbol]"; var dateTag = "[object Date]"; var mapTag = "[object Map]"; var setTag = "[object Set]"; var arrayTag = "[object Array]"; var arrayBufferTag = "[object ArrayBuffer]"; var objectTag = "[object Object]"; var dataViewTag = "[object DataView]"; var uint8ArrayTag = "[object Uint8Array]"; var uint8ClampedArrayTag = "[object Uint8ClampedArray]"; var uint16ArrayTag = "[object Uint16Array]"; var uint32ArrayTag = "[object Uint32Array]"; var int8ArrayTag = "[object Int8Array]"; var int16ArrayTag = "[object Int16Array]"; var int32ArrayTag = "[object Int32Array]"; var float32ArrayTag = "[object Float