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AE,EAAQ,EAAE,CAAC,YAAY,CAAC,CAAC,gBAAgB,EAAiB,AAAA,CAAA,EAAA,EAAA,OAAO,AAAP,EAAQ,IAAqE;AACjvD,MAAA,EAAE,EAAS;AACG,oBAAA,EAAE,EAAwB;AACtC,QAAA,EAAE,IAAwB,GAHyqD;A;AAKvsD,IAAA,CAAC,CAAE,CAAC,EAAwB,EAAS,EAAE,MAAO,AAAA,CAAA,EAAA,EAAA,SAAQ,AAAR,EAAU,KAAK,IAAI,EAAW,AAAmB,SAAnB,EAAQ,QAAQ,CAAU,CAAC,uBAAuB,EAAE,EAAQ,EAAE,CAAA,CAAE,CAAC,0BAA0B,GAAG,CAAC,EAAS,CAAC,EAAY,GAAY,MAAM,CAAC,EAAmB,EAAW,EAAiB,AAAmB,SAAnB,EAAQ,QAAQ,CAAU,EAAQ,EAAE,CAAC,KAAM,EAAE,CAAC,EAAS,EAAiB,EAAQ,EAAE,GAAS,EAUtC,CAAC,EAAW,CAAC,CAAC,EAAU,CAAC,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,QAAQ,MAAM,SAAS,EAAE,CAAC,KAAK,OAAO,MAAM,SAAS,EAAE,AAAA,CAAC,EAAE,EAAQ,CAAC,CAAC,EAAU,CAAC,IAAI,C,E,C,yB,Q,oB,Q,Y,Q,2B,Q,iD,O,E,E,E,C,E","sources":["<anon>","node_modules/@storybook/addon-essentials/dist/backgrounds/preview.js","node_modules/@storybook/addon-backgrounds/preview.js","node_modules/@storybook/addon-backgrounds/dist/preview.js"],"sourcesContent":["// modules are defined as an array\n// [ module function, map of requires ]\n//\n// map of requires is short require name -> numeric require\n//\n// anything defined in a previous bundle is accessed via the\n// orig method which is the require for previous bundles\n\n(function (modules, entry, mainEntry, parcelRequireName, globalName) {\n  /* eslint-disable no-undef */\n  var globalObject =\n    typeof globalThis !== 'undefined'\n      ? globalThis\n      : typeof self !== 'undefined'\n      ? self\n      : typeof window !== 'undefined'\n      ? window\n      : typeof global !== 'undefined'\n      ? global\n      : {};\n  /* eslint-enable no-undef */\n\n  // Save the require from previous bundle to this closure if any\n  var previousRequire =\n    typeof globalObject[parcelRequireName] === 'function' &&\n    globalObject[parcelRequireName];\n\n  var cache = previousRequire.cache || {};\n  // Do not use `require` to prevent Webpack from trying to bundle this call\n  var nodeRequire =\n    typeof module !== 'undefined' &&\n    typeof module.require === 'function' &&\n    module.require.bind(module);\n\n  function newRequire(name, jumped) {\n    if (!cache[name]) {\n      if (!modules[name]) {\n        // if we cannot find the module within our internal map or\n        // cache jump to the current global require ie. the last bundle\n        // that was added to the page.\n        var currentRequire =\n          typeof globalObject[parcelRequireName] === 'function' &&\n          globalObject[parcelRequireName];\n        if (!jumped && currentRequire) {\n          return currentRequire(name, true);\n        }\n\n        // If there are other bundles on this page the require from the\n        // previous one is saved to 'previousRequire'. Repeat this as\n        // many times as there are bundles until the module is found or\n        // we exhaust the require chain.\n        if (previousRequire) {\n          return previousRequire(name, true);\n        }\n\n        // Try the node require function if it exists.\n        if (nodeRequire && typeof name === 'string') {\n          return nodeRequire(name);\n        }\n\n        var err = new Error(\"Cannot find module '\" + name + \"'\");\n        err.code = 'MODULE_NOT_FOUND';\n        throw err;\n      }\n\n      localRequire.resolve = resolve;\n      localRequire.cache = {};\n\n      var module = (cache[name] = new newRequire.Module(name));\n\n      modules[name][0].call(\n        module.exports,\n        localRequire,\n        module,\n        module.exports,\n        globalObject\n      );\n    }\n\n    return cache[name].exports;\n\n    function localRequire(x) {\n      var res = localRequire.resolve(x);\n      return res === false ? {} : newRequire(res);\n    }\n\n    function resolve(x) {\n      var id = modules[name][1][x];\n      return id != null ? id : x;\n    }\n  }\n\n  function Module(moduleName) {\n    this.id = moduleName;\n    this.bundle = newRequire;\n    this.exports = {};\n  }\n\n  newRequire.isParcelRequire = true;\n  newRequire.Module = Module;\n  newRequire.modules = modules;\n  newRequire.cache = cache;\n  newRequire.parent = previousRequire;\n  newRequire.register = function (id, exports) {\n    modules[id] = [\n      function (require, module) {\n        module.exports = exports;\n      },\n      {},\n    ];\n  };\n\n  Object.defineProperty(newRequire, 'root', {\n    get: function () {\n      return globalObject[parcelRequireName];\n    },\n  });\n\n  globalObject[parcelRequireName] = newRequire;\n\n  for (var i = 0; i < entry.length; i++) {\n    newRequire(entry[i]);\n  }\n\n  if (mainEntry) {\n    // Expose entry point to Node, AMD or browser globals\n    // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js\n    var mainExports = newRequire(mainEntry);\n\n    // CommonJS\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n      module.exports = mainExports;\n\n      // RequireJS\n    } else if (typeof define === 'function' && define.amd) {\n      define(function () {\n        return mainExports;\n      });\n\n      // <script>\n    } else if (globalName) {\n      this[globalName] = mainExports;\n    }\n  }\n})({\"37nVf\":[function(require,module,exports,__globalThis) {\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nvar _preview = require(\"@storybook/addon-backgrounds/preview\");\nparcelHelpers.exportAll(_preview, exports);\n\n},{\"@storybook/addon-backgrounds/preview\":\"gqLCP\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"gqLCP\":[function(require,module,exports,__globalThis) {\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nvar _preview = require(\"./dist/preview\");\nparcelHelpers.exportAll(_preview, exports);\n\n},{\"./dist/preview\":\"9RaOE\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}],\"9RaOE\":[function(require,module,exports,__globalThis) {\nvar parcelHelpers = require(\"@parcel/transformer-js/src/esmodule-helpers.js\");\nparcelHelpers.defineInteropFlag(exports);\nparcelHelpers.export(exports, \"decorators\", ()=>decorators);\nparcelHelpers.export(exports, \"globals\", ()=>globals);\nparcelHelpers.export(exports, \"parameters\", ()=>parameters);\nvar _previewApi = require(\"@storybook/preview-api\");\nvar _global = require(\"@storybook/global\");\nvar _tsDedent = require(\"ts-dedent\");\nvar _clientLogger = require(\"@storybook/client-logger\");\nvar PARAM_KEY = \"backgrounds\";\nvar { document, window } = (0, _global.global), isReduceMotionEnabled = ()=>window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches, getBackgroundColorByName = (currentSelectedValue, backgrounds = [], defaultName)=>{\n    if (currentSelectedValue === \"transparent\") return \"transparent\";\n    if (backgrounds.find((background)=>background.value === currentSelectedValue)) return currentSelectedValue;\n    let defaultBackground = backgrounds.find((background)=>background.name === defaultName);\n    if (defaultBackground) return defaultBackground.value;\n    if (defaultName) {\n        let availableColors = backgrounds.map((background)=>background.name).join(\", \");\n        (0, _clientLogger.logger).warn((0, _tsDedent.dedent)`\n        Backgrounds Addon: could not find the default color \"${defaultName}\".\n        These are the available colors for your story based on your configuration:\n        ${availableColors}.\n      `);\n    }\n    return \"transparent\";\n}, clearStyles = (selector)=>{\n    (Array.isArray(selector) ? selector : [\n        selector\n    ]).forEach(clearStyle);\n}, clearStyle = (selector)=>{\n    let element = document.getElementById(selector);\n    element && element.parentElement?.removeChild(element);\n}, addGridStyle = (selector, css)=>{\n    let existingStyle = document.getElementById(selector);\n    if (existingStyle) existingStyle.innerHTML !== css && (existingStyle.innerHTML = css);\n    else {\n        let style = document.createElement(\"style\");\n        style.setAttribute(\"id\", selector), style.innerHTML = css, document.head.appendChild(style);\n    }\n}, addBackgroundStyle = (selector, css, storyId)=>{\n    let existingStyle = document.getElementById(selector);\n    if (existingStyle) existingStyle.innerHTML !== css && (existingStyle.innerHTML = css);\n    else {\n        let style = document.createElement(\"style\");\n        style.setAttribute(\"id\", selector), style.innerHTML = css;\n        let gridStyleSelector = `addon-backgrounds-grid${storyId ? `-docs-${storyId}` : \"\"}`, existingGridStyle = document.getElementById(gridStyleSelector);\n        existingGridStyle ? existingGridStyle.parentElement?.insertBefore(style, existingGridStyle) : document.head.appendChild(style);\n    }\n};\nvar withBackground = (StoryFn, context)=>{\n    let { globals: globals2, parameters: parameters2 } = context, globalsBackgroundColor = globals2[PARAM_KEY]?.value, backgroundsConfig = parameters2[PARAM_KEY], selectedBackgroundColor = (0, _previewApi.useMemo)(()=>backgroundsConfig.disable ? \"transparent\" : getBackgroundColorByName(globalsBackgroundColor, backgroundsConfig.values, backgroundsConfig.default), [\n        backgroundsConfig,\n        globalsBackgroundColor\n    ]), isActive = (0, _previewApi.useMemo)(()=>selectedBackgroundColor && selectedBackgroundColor !== \"transparent\", [\n        selectedBackgroundColor\n    ]), selector = context.viewMode === \"docs\" ? `#anchor--${context.id} .docs-story` : \".sb-show-main\", backgroundStyles = (0, _previewApi.useMemo)(()=>{\n        let transitionStyle = \"transition: background-color 0.3s;\";\n        return `\n      ${selector} {\n        background: ${selectedBackgroundColor} !important;\n        ${isReduceMotionEnabled() ? \"\" : transitionStyle}\n      }\n    `;\n    }, [\n        selectedBackgroundColor,\n        selector\n    ]);\n    return (0, _previewApi.useEffect)(()=>{\n        let selectorId = context.viewMode === \"docs\" ? `addon-backgrounds-docs-${context.id}` : \"addon-backgrounds-color\";\n        if (!isActive) {\n            clearStyles(selectorId);\n            return;\n        }\n        addBackgroundStyle(selectorId, backgroundStyles, context.viewMode === \"docs\" ? context.id : null);\n    }, [\n        isActive,\n        backgroundStyles,\n        context\n    ]), StoryFn();\n};\nvar withGrid = (StoryFn, context)=>{\n    let { globals: globals2, parameters: parameters2 } = context, gridParameters = parameters2[PARAM_KEY].grid, isActive = globals2[PARAM_KEY]?.grid === !0 && gridParameters.disable !== !0, { cellAmount, cellSize, opacity } = gridParameters, isInDocs = context.viewMode === \"docs\", defaultOffset = parameters2.layout === void 0 || parameters2.layout === \"padded\" ? 16 : 0, offsetX = gridParameters.offsetX ?? (isInDocs ? 20 : defaultOffset), offsetY = gridParameters.offsetY ?? (isInDocs ? 20 : defaultOffset), gridStyles = (0, _previewApi.useMemo)(()=>{\n        let selector = context.viewMode === \"docs\" ? `#anchor--${context.id} .docs-story` : \".sb-show-main\", backgroundSize = [\n            `${cellSize * cellAmount}px ${cellSize * cellAmount}px`,\n            `${cellSize * cellAmount}px ${cellSize * cellAmount}px`,\n            `${cellSize}px ${cellSize}px`,\n            `${cellSize}px ${cellSize}px`\n        ].join(\", \");\n        return `\n      ${selector} {\n        background-size: ${backgroundSize} !important;\n        background-position: ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px !important;\n        background-blend-mode: difference !important;\n        background-image: linear-gradient(rgba(130, 130, 130, ${opacity}) 1px, transparent 1px),\n         linear-gradient(90deg, rgba(130, 130, 130, ${opacity}) 1px, transparent 1px),\n         linear-gradient(rgba(130, 130, 130, ${opacity / 2}) 1px, transparent 1px),\n         linear-gradient(90deg, rgba(130, 130, 130, ${opacity / 2}) 1px, transparent 1px) !important;\n      }\n    `;\n    }, [\n        cellSize\n    ]);\n    return (0, _previewApi.useEffect)(()=>{\n        let selectorId = context.viewMode === \"docs\" ? `addon-backgrounds-grid-docs-${context.id}` : \"addon-backgrounds-grid\";\n        if (!isActive) {\n            clearStyles(selectorId);\n            return;\n        }\n        addGridStyle(selectorId, gridStyles);\n    }, [\n        isActive,\n        gridStyles,\n        context\n    ]), StoryFn();\n};\nvar decorators = [\n    withGrid,\n    withBackground\n], parameters = {\n    [PARAM_KEY]: {\n        grid: {\n            cellSize: 20,\n            opacity: .5,\n            cellAmount: 5\n        },\n        values: [\n            {\n                name: \"light\",\n                value: \"#F8F8F8\"\n            },\n            {\n                name: \"dark\",\n                value: \"#333333\"\n            }\n        ]\n    }\n}, globals = {\n    [PARAM_KEY]: null\n};\n\n},{\"@storybook/preview-api\":\"uDWyg\",\"@storybook/global\":\"4g4co\",\"ts-dedent\":\"lKwH2\",\"@storybook/client-logger\":\"7OFBO\",\"@parcel/transformer-js/src/esmodule-helpers.js\":\"diccK\"}]},[], null, \"parcelRequire94c2\")\n\n//# sourceMappingURL=preview.9a817d36.js.map\n","export * from '@storybook/addon-backgrounds/preview';\n","export * from './dist/preview';\n","import { useMemo, useEffect } from '@storybook/preview-api';\nimport { global } from '@storybook/global';\nimport { dedent } from 'ts-dedent';\nimport { logger } from '@storybook/client-logger';\n\nvar PARAM_KEY=\"backgrounds\";var{document,window}=global,isReduceMotionEnabled=()=>window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches,getBackgroundColorByName=(currentSelectedValue,backgrounds=[],defaultName)=>{if(currentSelectedValue===\"transparent\")return \"transparent\";if(backgrounds.find(background=>background.value===currentSelectedValue))return currentSelectedValue;let defaultBackground=backgrounds.find(background=>background.name===defaultName);if(defaultBackground)return defaultBackground.value;if(defaultName){let availableColors=backgrounds.map(background=>background.name).join(\", \");logger.warn(dedent`\n        Backgrounds Addon: could not find the default color \"${defaultName}\".\n        These are the available colors for your story based on your configuration:\n        ${availableColors}.\n      `);}return \"transparent\"},clearStyles=selector=>{(Array.isArray(selector)?selector:[selector]).forEach(clearStyle);},clearStyle=selector=>{let element=document.getElementById(selector);element&&element.parentElement?.removeChild(element);},addGridStyle=(selector,css)=>{let existingStyle=document.getElementById(selector);if(existingStyle)existingStyle.innerHTML!==css&&(existingStyle.innerHTML=css);else {let style=document.createElement(\"style\");style.setAttribute(\"id\",selector),style.innerHTML=css,document.head.appendChild(style);}},addBackgroundStyle=(selector,css,storyId)=>{let existingStyle=document.getElementById(selector);if(existingStyle)existingStyle.innerHTML!==css&&(existingStyle.innerHTML=css);else {let style=document.createElement(\"style\");style.setAttribute(\"id\",selector),style.innerHTML=css;let gridStyleSelector=`addon-backgrounds-grid${storyId?`-docs-${storyId}`:\"\"}`,existingGridStyle=document.getElementById(gridStyleSelector);existingGridStyle?existingGridStyle.parentElement?.insertBefore(style,existingGridStyle):document.head.appendChild(style);}};var withBackground=(StoryFn,context)=>{let{globals:globals2,parameters:parameters2}=context,globalsBackgroundColor=globals2[PARAM_KEY]?.value,backgroundsConfig=parameters2[PARAM_KEY],selectedBackgroundColor=useMemo(()=>backgroundsConfig.disable?\"transparent\":getBackgroundColorByName(globalsBackgroundColor,backgroundsConfig.values,backgroundsConfig.default),[backgroundsConfig,globalsBackgroundColor]),isActive=useMemo(()=>selectedBackgroundColor&&selectedBackgroundColor!==\"transparent\",[selectedBackgroundColor]),selector=context.viewMode===\"docs\"?`#anchor--${context.id} .docs-story`:\".sb-show-main\",backgroundStyles=useMemo(()=>{let transitionStyle=\"transition: background-color 0.3s;\";return `\n      ${selector} {\n        background: ${selectedBackgroundColor} !important;\n        ${isReduceMotionEnabled()?\"\":transitionStyle}\n      }\n    `},[selectedBackgroundColor,selector]);return useEffect(()=>{let selectorId=context.viewMode===\"docs\"?`addon-backgrounds-docs-${context.id}`:\"addon-backgrounds-color\";if(!isActive){clearStyles(selectorId);return}addBackgroundStyle(selectorId,backgroundStyles,context.viewMode===\"docs\"?context.id:null);},[isActive,backgroundStyles,context]),StoryFn()};var withGrid=(StoryFn,context)=>{let{globals:globals2,parameters:parameters2}=context,gridParameters=parameters2[PARAM_KEY].grid,isActive=globals2[PARAM_KEY]?.grid===!0&&gridParameters.disable!==!0,{cellAmount,cellSize,opacity}=gridParameters,isInDocs=context.viewMode===\"docs\",defaultOffset=parameters2.layout===void 0||parameters2.layout===\"padded\"?16:0,offsetX=gridParameters.offsetX??(isInDocs?20:defaultOffset),offsetY=gridParameters.offsetY??(isInDocs?20:defaultOffset),gridStyles=useMemo(()=>{let selector=context.viewMode===\"docs\"?`#anchor--${context.id} .docs-story`:\".sb-show-main\",backgroundSize=[`${cellSize*cellAmount}px ${cellSize*cellAmount}px`,`${cellSize*cellAmount}px ${cellSize*cellAmount}px`,`${cellSize}px ${cellSize}px`,`${cellSize}px ${cellSize}px`].join(\", \");return `\n      ${selector} {\n        background-size: ${backgroundSize} !important;\n        background-position: ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px, ${offsetX}px ${offsetY}px !important;\n        background-blend-mode: difference !important;\n        background-image: linear-gradient(rgba(130, 130, 130, ${opacity}) 1px, transparent 1px),\n         linear-gradient(90deg, rgba(130, 130, 130, ${opacity}) 1px, transparent 1px),\n         linear-gradient(rgba(130, 130, 130, ${opacity/2}) 1px, transparent 1px),\n         linear-gradient(90deg, rgba(130, 130, 130, ${opacity/2}) 1px, transparent 1px) !important;\n      }\n    `},[cellSize]);return useEffect(()=>{let selectorId=context.viewMode===\"docs\"?`addon-backgrounds-grid-docs-${context.id}`:\"addon-backgrounds-grid\";if(!isActive){clearStyles(selectorId);return}addGridStyle(selectorId,gridStyles);},[isActive,gridStyles,context]),StoryFn()};var decorators=[withGrid,withBackground],parameters={[PARAM_KEY]:{grid:{cellSize:20,opacity:.5,cellAmount:5},values:[{name:\"light\",value:\"#F8F8F8\"},{name:\"dark\",value:\"#333333\"}]}},globals={[PARAM_KEY]:null};\n\nexport { decorators, globals, parameters };\n"],"names":["modules","entry","mainEntry","parcelRequireName","globalName","globalObject","globalThis","self","window","global","previousRequire","cache","nodeRequire","module","require","bind","newRequire","name","jumped","currentRequire","err","Error","code","localRequire","resolve","x","id","Module","call","exports","res","isParcelRequire","moduleName","bundle","parent","register","Object","defineProperty","get","i","length","__globalThis","parcelHelpers","defineInteropFlag","_preview","exportAll","export","decorators","globals","parameters","_previewApi","_global","_tsDedent","_clientLogger","PARAM_KEY","document","isReduceMotionEnabled","matchMedia","matches","getBackgroundColorByName","currentSelectedValue","backgrounds","defaultName","find","background","value","defaultBackground","availableColors","map","join","logger","warn","dedent","clearStyles","selector","Array","isArray","forEach","clearStyle","element","getElementById","parentElement","removeChild","addGridStyle","css","existingStyle","innerHTML","style","createElement","setAttribute","head","appendChild","addBackgroundStyle","storyId","gridStyleSelector","existingGridStyle","insertBefore","StoryFn","context","globals2","parameters2","gridParameters","grid","isActive","disable","cellAmount","cellSize","opacity","isInDocs","viewMode","defaultOffset","layout","offsetX","offsetY","gridStyles","useMemo","backgroundSize","useEffect","selectorId","globalsBackgroundColor","backgroundsConfig","selectedBackgroundColor","values","default","backgroundStyles"],"version":3,"file":"preview.9a817d36.js.map"}