import { __exports as n } from "../../../../../../_virtual/encode.js";
import { __require as q } from "./generated/encode-html.js";
import { __require as L } from "./escape.js";
var v;
function A() {
  if (v) return n;
  v = 1;
  var m = n && n.__importDefault || function(e) {
    return e && e.__esModule ? e : { default: e };
  };
  Object.defineProperty(n, "__esModule", { value: !0 }), n.encodeNonAsciiHTML = n.encodeHTML = void 0;
  var p = m(/* @__PURE__ */ q()), a = /* @__PURE__ */ L(), M = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;
  function H(e) {
    return c(M, e);
  }
  n.encodeHTML = H;
  function T(e) {
    return c(a.xmlReplacer, e);
  }
  n.encodeNonAsciiHTML = T;
  function c(e, o) {
    for (var t = "", u = 0, d; (d = e.exec(o)) !== null; ) {
      var i = d.index;
      t += o.substring(u, i);
      var f = o.charCodeAt(i), r = p.default.get(f);
      if (typeof r == "object") {
        if (i + 1 < o.length) {
          var _ = o.charCodeAt(i + 1), l = typeof r.n == "number" ? r.n === _ ? r.o : void 0 : r.n.get(_);
          if (l !== void 0) {
            t += l, u = e.lastIndex += 1;
            continue;
          }
        }
        r = r.v;
      }
      if (r !== void 0)
        t += r, u = i + 1;
      else {
        var s = (0, a.getCodePoint)(o, i);
        t += "&#x".concat(s.toString(16), ";"), u = e.lastIndex += +(s !== f);
      }
    }
    return t + o.substr(u);
  }
  return n;
}
export {
  A as __require
};
//# sourceMappingURL=encode.js.map
