{"version":3,"sources":["jsdelivr-header.js","/npm/@gerhobbelt/markdown-it-inline-text-color@1.0.1-1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA,aAIA,IAAI,iBAAa,kBACb,kBAAJ,U,wBAEA,OAAS,UAC2B,SAAA,SAAA,GAAc,IAAA,KAAA,OAAA,E,wCAI9C,IAAI,EAAG,EAAQ,GAEX,GAAA,GAAO,EAAI,OAAX,GACD,UAAA,EAAA,GACF,OAAA,EAAA,EAGH,C,WAGF,CACE,SAEI,MAFJ,EAAA,GAAA,IAGI,EACA,EACA,EACA,EACA,EACA,EAAM,EACN,GAAQ,E,WAER,EAAM,EAAI,IAAd,OAAiD,MAAA,EAAA,IAAA,WAAA,MAZrB,IAiB5B,EAAS,EAAG,a,2BACZ,EAAK,kBAAL,KAAgC,MAAiB,IAAA,KAI7C,GAAS,EADX,EAEO,MAAA,EAAA,MACL,EAAO,GAER,GAAA,EANH,EAOW,GAEJ,EACL,EAAS,GAEV,EAAA,E,MAKD,EAA2B,IAAX,EAAM,OACtB,EAAM,OAAU,EAAhB,EAAA,GAAA,O,8BAEA,EAAI,OAAQ,OAEX,G,2BAID,EAAA,IAAA,EAAA,OACD,EAAA,OAAA,G,IAED,CAGE,SAAI,cAAJ,EAAA,EAAA,EAAA,EAAA,G,WAEI,EAAM,M,IAET,IAAA,EAAA,S,YAID,EAAI,KAAM,Q,eAGR,IAAI,EAAO,SAAA,EAAA,OAEV,GACF,EAAA,KAAA,iBAAA,EAAA,KACD,C,OAGD,EAAA,KAAA,K,UAED,CAGE,OAAG,QAAH,SAAkC,EAAA,EAAQ,GAE1C,EAAG,GAAe,GALpB,EAAA,OAAA,MAAA,MAAA,kBAAA,O","file":"/npm/@gerhobbelt/markdown-it-inline-text-color@1.0.1-1/dist/markdownItAbbr.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@gerhobbelt/markdown-it-inline-text-color@1.0.1-1/dist/markdownItAbbr.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Process ~subscript~\n\nlet COLOR_OPEN_REGEX = /{color:(#?\\w+)}/;\nlet COLOR_CLOSE_REGEX = /{color}/;\nlet TOKEN_TYPE = 'color_text';\nlet MARKUP = '{color}';\n\nfunction getColor(attrs) {\n  if (!attrs || attrs.length < 1) { return null; }\n\n  for (let ii = 0; ii < attrs.length; ii++) {\n    let att = attrs[ii];\n    if (att && att.length > 1) {\n      if (att[0] === 'color') {\n        return att[1];\n      }\n    }\n  }\n\n  return null;\n}\n\nfunction color(state, silent) {\n  let found,\n      content,\n      token,\n      startResult,\n      endResult,\n      result,\n      nesting = 1,\n      isOpen = true,\n      max = state.posMax,\n      start = state.pos;\n\n  if (state.src.charCodeAt(start) !== 0x7B/* ~ */) { return false; }\n  if (silent) { return false; } // don't run any pairs in validation mode\n\n  content = state.src.slice(start);\n  startResult = COLOR_OPEN_REGEX.exec(content);\n  endResult = COLOR_CLOSE_REGEX.exec(content);\n  if (!startResult && !endResult) { return false; }\n\n  if (startResult && endResult) {\n    if (startResult.index < endResult.index) {\n      result = startResult;\n    } else {\n      nesting = -1;\n      result = endResult;\n    }\n  } else if (startResult) {\n    result = startResult;\n  } else {\n    result = endResult;\n    nesting = -1;\n  }\n\n  isOpen = result.length === 2;\n  state.posMax = start + result[0].length;\n\n  token         = state.push(TOKEN_TYPE, 'span', nesting);\n  token.markup  = MARKUP;\n\n  if (isOpen) {\n    token.attrPush([ 'color', result[1] ]);\n  }\n\n  state.pos = state.posMax;\n  state.posMax = max;\n  return true;\n}\n\nfunction renderDefault(tokens, idx, _options, env, self) {\n  let token = tokens[idx];\n\n  let result = [ '<' ];\n\n  if (token.nesting === -1) {\n    result.push('/');\n  }\n\n  result.push('span');\n\n  if (token.nesting === 1) {\n    let color = getColor(token.attrs);\n\n    if (color) {\n      result.push(' style=\"color:', color, ';\"');\n    }\n  }\n  result.push('>');\n\n  return result.join('');\n}\n\nmodule.exports = function sub_plugin(md, name, options) {\n  options = options || {};\n\n  md.inline.ruler.after('emphasis', 'span', color);\n\n  md.renderer.rules[TOKEN_TYPE] = options.render || renderDefault;\n};\n"]}