{"version":3,"sources":["globals/internal/storybook-cdn.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyBH;;;;GAIG;AACH,eAAO,MAAM,KAAK;;YA2BjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,cASlB,CAAC","file":"storybook-cdn.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2021, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport packageJson from '../../../package.json';\n\n/* eslint-disable import/prefer-default-export,max-len */\n\n/**\n *\n */\n/**\n * Renders the component(s) script tag content and returns back the string\n *\n * @param {Array} components array of component names\n * @param {string} tag tag folder\n * @param {boolean} isRTL flag to show rtl version\n */\nfunction _renderScript(components, tag, isRTL = false) {\n  let scripts = '';\n  const rtl = isRTL ? '.rtl' : '';\n  components.forEach(component => {\n    scripts += `<script type=\"module\" src=\"https://1.www.s81c.com/common/carbon/web-components/${tag}/${component}${rtl}.min.js\"></script>\\n`;\n  });\n  return scripts;\n}\n\n/**\n * This is the markdown block for JS via CDN\n *\n * @param {Array} components array of components to render\n */\nexport const cdnJs = ({ components }) => {\n  return `\n ### JS (via CDN)\n\n \\`\\`\\`html\n // SPECIFIC VERSION (available starting v1.6.0)\n ${_renderScript(components, `version/v${packageJson.version}`)}\n\n // LATEST tag\n ${_renderScript(components, 'tag/v1/latest')}\n \\`\\`\\`\n\n > NOTE: The latest tag is a moving version. While beneficial to\n > always stay on the most recent version, it is recommended to choose a specific\n > version and properly test your application when upgrading to a newer version.\n\n\n #### Right-to-left (RTL) versions\n\n \\`\\`\\`html\n // SPECIFIC VERSION (available starting v1.6.0)\n ${_renderScript(components, `version/v${packageJson.version}`, true)}\n\n // LATEST tag\n ${_renderScript(components, 'tag/v1/latest', true)}\n \\`\\`\\`\n   `;\n};\n\n/**\n * This is the markdown block for CSS via CDN\n */\nexport const cdnCss = () => {\n  return `\n### Carbon CDN style helpers (optional)\n\nThere are optional CDN artifacts available that can assist with global Carbon\nstyles in lieu of including into your specific application bundle.\n\n[Click here to learn more](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/main/packages/web-components/docs/carbon-cdn-style-helpers.md)\\n\\n\n  `;\n};\n"]}