{"version":3,"sources":["jsdelivr-header.js","/npm/@rtsao/scc@1.1.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAMA,SAAS,OAAO,GACd,MAAM,EAAU,IAAI,IACd,EAAW,IAAI,IACf,EAAU,IAAI,IACd,EAAQ,GACR,EAAM,GACZ,IAAI,EAAM,EAEV,SAAS,EAAc,GACrB,EAAQ,IAAI,EAAG,GACf,EAAS,IAAI,EAAG,GAChB,IACA,EAAM,KAAK,GACX,EAAQ,IAAI,GAEZ,MAAM,EAAO,EAAM,IAAI,GACvB,IAAK,MAAM,KAAO,EACX,EAAQ,IAAI,GAGN,EAAQ,IAAI,IACrB,EAAS,IAAI,EAAG,KAAK,IAAI,EAAS,IAAI,GAAI,EAAQ,IAAI,MAHtD,EAAc,GACd,EAAS,IAAI,EAAG,KAAK,IAAI,EAAS,IAAI,GAAI,EAAS,IAAI,MAM3D,GAAI,EAAS,IAAI,KAAO,EAAQ,IAAI,GAAI,CACtC,MAAM,EAAW,IAAI,IACrB,IAAI,EAAI,KACR,KAAO,IAAM,GACX,EAAI,EAAM,MACV,EAAQ,OAAO,GACf,EAAS,IAAI,GAEf,EAAI,KAAK,EACX,CACF,CAEA,IAAK,MAAM,KAAK,EAAM,OACf,EAAQ,IAAI,IACf,EAAc,GAIlB,OAAO,CACT,CAhDA,OAAO,QAAU","file":"/npm/@rtsao/scc@1.1.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/@rtsao/scc@1.1.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nmodule.exports = tarjan;\n\n// Adapted from https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm#The_algorithm_in_pseudocode\n\nfunction tarjan(graph) {\n  const indices = new Map();\n  const lowlinks = new Map();\n  const onStack = new Set();\n  const stack = [];\n  const scc = [];\n  let idx = 0;\n\n  function strongConnect(v) {\n    indices.set(v, idx);\n    lowlinks.set(v, idx);\n    idx++;\n    stack.push(v);\n    onStack.add(v);\n\n    const deps = graph.get(v);\n    for (const dep of deps) {\n      if (!indices.has(dep)) {\n        strongConnect(dep);\n        lowlinks.set(v, Math.min(lowlinks.get(v), lowlinks.get(dep)));\n      } else if (onStack.has(dep)) {\n        lowlinks.set(v, Math.min(lowlinks.get(v), indices.get(dep)));\n      }\n    }\n\n    if (lowlinks.get(v) === indices.get(v)) {\n      const vertices = new Set();\n      let w = null;\n      while (v !== w) {\n        w = stack.pop();\n        onStack.delete(w);\n        vertices.add(w);\n      }\n      scc.push(vertices);\n    }\n  }\n\n  for (const v of graph.keys()) {\n    if (!indices.has(v)) {\n      strongConnect(v);\n    }\n  }\n\n  return scc;\n}\n"]}