/* Generated by the Nim Compiler v2.2.8 */
var framePtr = null;
var excHandler = 0;
var lastJSError = null;
var NTI2097186 = {size: 0,kind: 1,base: null,node: null,finalizer: null};
var NTI45088782 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
var NTI2097155 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
var NTI59768914 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
var NTI59768921 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
var NTI8388631 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI8388621 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI8388623 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI8388625 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097899 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097907 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
var NTI2097170 = {size: 0,kind: 29,base: null,node: null,finalizer: null};
var NTI2097906 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
var NTI2097903 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097904 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI8388629 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI2097169 = {size: 0,kind: 28,base: null,node: null,finalizer: null};
var NNI8388629 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388629.node = NNI8388629;
var NNI2097904 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI2097904.node = NNI2097904;
NTI2097906.base = NTI2097903;
NTI2097907.base = NTI2097903;
var NNI2097903 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI2097906, name: "parent", sons: null}, 
{kind: 1, offset: "name", len: 0, typ: NTI2097170, name: "name", sons: null}, 
{kind: 1, offset: "message", len: 0, typ: NTI2097169, name: "msg", sons: null}, 
{kind: 1, offset: "trace", len: 0, typ: NTI2097169, name: "trace", sons: null}, 
{kind: 1, offset: "up", len: 0, typ: NTI2097907, name: "up", sons: null}]};
NTI2097903.node = NNI2097903;
var NNI2097899 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI2097899.node = NNI2097899;
NTI2097903.base = NTI2097899;
NTI2097904.base = NTI2097903;
NTI8388629.base = NTI2097904;
var NNI8388625 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388625.node = NNI8388625;
NTI8388625.base = NTI2097904;
var NNI8388623 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388623.node = NNI8388623;
var NNI8388621 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388621.node = NNI8388621;
NTI8388621.base = NTI2097904;
NTI8388623.base = NTI8388621;
var NNI8388631 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI8388631.node = NNI8388631;
NTI8388631.base = NTI2097904;
var NNI59768921 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "a", len: 0, typ: NTI59768914, name: "a", sons: null}, 
{kind: 1, offset: "b", len: 0, typ: NTI2097155, name: "b", sons: null}]};
NTI59768921.node = NNI59768921;
var NNI45088782 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI2097155, name: "Field0", sons: null}, 
{kind: 1, offset: "Field1", len: 0, typ: NTI2097186, name: "Field1", sons: null}]};
NTI45088782.node = NNI45088782;

function setConstr() {
        var result = {};
    for (var i = 0; i < arguments.length; ++i) {
      var x = arguments[i];
      if (typeof(x) == "object") {
        for (var j = x[0]; j <= x[1]; ++j) {
          result[j] = true;
        }
      } else {
        result[x] = true;
      }
    }
    return result;
  

  
}
var ConstSet1 = setConstr(17, 16, 4, 18, 27, 19, 23, 22, 21);

function nimCopy(dest_p0, src_p1, ti_p2) {
  var result_2100080 = null;

    switch (ti_p2.kind) {
    case 21:
    case 22:
    case 23:
    case 5:
      if (!(isFatPointer__system_u2908(ti_p2))) {
      result_2100080 = src_p1;
      }
      else {
        result_2100080 = [src_p1[0], src_p1[1]];
      }
      
      break;
    case 19:
            if (dest_p0 === null || dest_p0 === undefined) {
        dest_p0 = {};
      }
      else {
        for (var key in dest_p0) { delete dest_p0[key]; }
      }
      for (var key in src_p1) { dest_p0[key] = src_p1[key]; }
      result_2100080 = dest_p0;
    
      break;
    case 18:
    case 17:
      if (!((ti_p2.base == null))) {
      result_2100080 = nimCopy(dest_p0, src_p1, ti_p2.base);
      }
      else {
      if ((ti_p2.kind == 17)) {
      result_2100080 = (dest_p0 === null || dest_p0 === undefined) ? {m_type: ti_p2} : dest_p0;
      }
      else {
        result_2100080 = (dest_p0 === null || dest_p0 === undefined) ? {} : dest_p0;
      }
      }
      nimCopyAux(result_2100080, src_p1, ti_p2.node);
      break;
    case 4:
    case 16:
            if(ArrayBuffer.isView(src_p1)) { 
        if(dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
          dest_p0 = new src_p1.constructor(src_p1);
        } else {
          dest_p0.set(src_p1, 0);
        }
        result_2100080 = dest_p0;
      } else {
        if (src_p1 === null) {
          result_2100080 = null;
        }
        else {
          if (dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
            dest_p0 = new Array(src_p1.length);
          }
          result_2100080 = dest_p0;
          for (var i = 0; i < src_p1.length; ++i) {
            result_2100080[i] = nimCopy(result_2100080[i], src_p1[i], ti_p2.base);
          }
        }
      }
    
      break;
    case 24:
    case 27:
            if (src_p1 === null) {
        result_2100080 = null;
      }
      else {
        if (dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
          dest_p0 = new Array(src_p1.length);
        }
        result_2100080 = dest_p0;
        for (var i = 0; i < src_p1.length; ++i) {
          result_2100080[i] = nimCopy(result_2100080[i], src_p1[i], ti_p2.base);
        }
      }
    
      break;
    case 28:
            if (src_p1 !== null) {
        result_2100080 = src_p1.slice(0);
      }
    
      break;
    default: 
      result_2100080 = src_p1;
      break;
    }

  return result_2100080;

}

function mnewString(len_p0) {
        var result = new Array(len_p0);
    for (var i = 0; i < len_p0; i++) {result[i] = 0;}
    return result;
  

  
}

function nimAddStrStr(x_p0, y_p1) {
      var L = y_p1.length;
  for (var i = 0; i < L; ++i) {
    x_p0.push(y_p1[i]);
  }
  

  
}

function isObj(obj_p0, subclass_p1) {
  var result_2100193 = false;

  BeforeRet: {
    var x_2100194 = obj_p0;
    if ((x_2100194 == subclass_p1)) {
    result_2100193 = true;
    break BeforeRet;
    }
    
    Label1: {
        Label2: while (true) {
        if (!!((x_2100194 == subclass_p1))) break Label2;
          if ((x_2100194 == null)) {
          result_2100193 = false;
          break BeforeRet;
          }
          
          x_2100194 = x_2100194.base;
        }
    };
    result_2100193 = true;
    break BeforeRet;
  };

  return result_2100193;

}

function toJSStr(s_p0) {
  var result_2099669 = null;

    var res_2099723 = newSeq__system_u2546((s_p0).length);
    var i_2099724 = 0;
    var j_2099725 = 0;
    Label1: {
        Label2: while (true) {
        if (!(i_2099724 < (s_p0).length)) break Label2;
          var c_2099726 = s_p0[i_2099724];
          if ((c_2099726 < 128)) {
          res_2099723[j_2099725] = String.fromCharCode(c_2099726);
          i_2099724 += 1;
          }
          else {
            var helper_2099752 = newSeq__system_u2546(0);
            Label3: {
                Label4: while (true) {
                if (!true) break Label4;
                  var code_2099753 = c_2099726.toString(16);
                  if ((((code_2099753) == null ? 0 : (code_2099753).length) == 1)) {
                  helper_2099752.push("%0");;
                  }
                  else {
                  helper_2099752.push("%");;
                  }
                  
                  helper_2099752.push(code_2099753);;
                  i_2099724 += 1;
                  if ((((s_p0).length <= i_2099724) || (s_p0[i_2099724] < 128))) {
                  break Label3;
                  }
                  
                  c_2099726 = s_p0[i_2099724];
                }
            };
++excHandler;
            try {
            res_2099723[j_2099725] = decodeURIComponent(helper_2099752.join(""));
--excHandler;
} catch (EXCEPTION) {
 var prevJSError = lastJSError;
 lastJSError = EXCEPTION;
 --excHandler;
            raiseDefect();
            res_2099723[j_2099725] = helper_2099752.join("");
            lastJSError = prevJSError;
            } finally {
            }
          }
          
          j_2099725 += 1;
        }
    };
    if (res_2099723.length < j_2099725) { for (var i = res_2099723.length ; i < j_2099725 ; ++i) res_2099723.push(null); }
               else { res_2099723.length = j_2099725; };
    result_2099669 = res_2099723.join("");

  return result_2099669;

}

function raiseException(e_p0, ename_p1) {
    e_p0.name = ename_p1;
    if ((excHandler == 0)) {
    unhandledException(e_p0);
    }
    
    throw e_p0;

  
}

function chckIndx(i_p0, a_p1, b_p2) {
  var result_2100115 = 0;

  BeforeRet: {
    if (((a_p1 <= i_p0) && (i_p0 <= b_p2))) {
    result_2100115 = i_p0;
    break BeforeRet;
    }
    else {
    raiseIndexError(i_p0, a_p1, b_p2);
    }
    
  };

  return result_2100115;

}

function makeNimstrLit(c_p0) {
      var result = [];
  for (var i = 0; i < c_p0.length; ++i) {
    result[i] = c_p0.charCodeAt(i);
  }
  return result;
  

  
}

function addInt(a_p0, b_p1) {
        var result = a_p0 + b_p1;
    checkOverflowInt(result);
    return result;
  

  
}

function subInt(a_p0, b_p1) {
        var result = a_p0 - b_p1;
    checkOverflowInt(result);
    return result;
  

  
}

function chckRange(i_p0, a_p1, b_p2) {
  var result_2100120 = 0;

  BeforeRet: {
    if (((a_p1 <= i_p0) && (i_p0 <= b_p2))) {
    result_2100120 = i_p0;
    break BeforeRet;
    }
    else {
    raiseRangeError();
    }
    
  };

  return result_2100120;

}

function cstrToNimstr(c_p0) {
      var ln = c_p0.length;
  var result = new Array(ln);
  var r = 0;
  for (var i = 0; i < ln; ++i) {
    var ch = c_p0.charCodeAt(i);

    if (ch < 128) {
      result[r] = ch;
    }
    else {
      if (ch < 2048) {
        result[r] = (ch >> 6) | 192;
      }
      else {
        if (ch < 55296 || ch >= 57344) {
          result[r] = (ch >> 12) | 224;
        }
        else {
            ++i;
            ch = 65536 + (((ch & 1023) << 10) | (c_p0.charCodeAt(i) & 1023));
            result[r] = (ch >> 18) | 240;
            ++r;
            result[r] = ((ch >> 12) & 63) | 128;
        }
        ++r;
        result[r] = ((ch >> 6) & 63) | 128;
      }
      ++r;
      result[r] = (ch & 63) | 128;
    }
    ++r;
  }
  return result;
  

  
}
var ConstSet2 = setConstr([65, 90]);
var ConstSet3 = setConstr(95, 32, 46);
var ConstSet4 = setConstr(95, 32, 46);

function mulInt(a_p0, b_p1) {
        var result = a_p0 * b_p1;
    checkOverflowInt(result);
    return result;
  

  
}
var ConstSet5 = setConstr([97, 122]);
var ConstSet6 = setConstr([65, 90], [97, 122]);
var ConstSet7 = setConstr([97, 122]);
var ConstSet8 = setConstr([65, 90]);
var ConstSet9 = setConstr([65, 90], [97, 122]);

function nimMax(a_p0, b_p1) {
    var Temporary1;

  var result_2099907 = 0;

  BeforeRet: {
    if ((b_p1 <= a_p0)) {
    Temporary1 = a_p0;
    }
    else {
    Temporary1 = b_p1;
    }
    
    result_2099907 = Temporary1;
    break BeforeRet;
  };

  return result_2099907;

}

function nimMin(a_p0, b_p1) {
    var Temporary1;

  var result_2099903 = 0;

  BeforeRet: {
    if ((a_p0 <= b_p1)) {
    Temporary1 = a_p0;
    }
    else {
    Temporary1 = b_p1;
    }
    
    result_2099903 = Temporary1;
    break BeforeRet;
  };

  return result_2099903;

}

function addChar(x_p0, c_p1) {
    x_p0.push(c_p1);

  
}
var objectID_73400498 = [0];

function setTheme(theme_p0) {
    document.documentElement.setAttribute("data-theme", theme_p0);
    window.localStorage.setItem("theme", theme_p0);

  
}

function isFatPointer__system_u2908(ti_p0) {
  var result_2100062 = false;

  BeforeRet: {
    result_2100062 = !((ConstSet1[ti_p0.base.kind] != undefined));
    break BeforeRet;
  };

  return result_2100062;

}

function nimCopyAux(dest_p0, src_p1, n_p2) {
    switch (n_p2.kind) {
    case 0:
      break;
    case 1:
            dest_p0[n_p2.offset] = nimCopy(dest_p0[n_p2.offset], src_p1[n_p2.offset], n_p2.typ);
    
      break;
    case 2:
          for (var i = 0; i < n_p2.sons.length; i++) {
      nimCopyAux(dest_p0, src_p1, n_p2.sons[i]);
    }
    
      break;
    case 3:
            dest_p0[n_p2.offset] = nimCopy(dest_p0[n_p2.offset], src_p1[n_p2.offset], n_p2.typ);
      for (var i = 0; i < n_p2.sons.length; ++i) {
        nimCopyAux(dest_p0, src_p1, n_p2.sons[i][1]);
      }
    
      break;
    }

  
}

function addChars__stdZprivateZdigitsutils_u202(result_p0, result_p0_Idx, x_p1, start_p2, n_p3) {
    var Temporary1;

    var old_20971728 = (result_p0[result_p0_Idx]).length;
    if (result_p0[result_p0_Idx].length < (Temporary1 = (old_20971728 + n_p3), Temporary1)) { for (var i = result_p0[result_p0_Idx].length; i < Temporary1; ++i) result_p0[result_p0_Idx].push(0); }
         else {result_p0[result_p0_Idx].length = Temporary1; };
    Label2: {
      var iHEX60gensym4_20971742 = 0;
      var i_35652823 = 0;
      Label3: {
          Label4: while (true) {
          if (!(i_35652823 < n_p3)) break Label4;
            iHEX60gensym4_20971742 = i_35652823;
            result_p0[result_p0_Idx][(old_20971728 + iHEX60gensym4_20971742)] = x_p1.charCodeAt((start_p2 + iHEX60gensym4_20971742));
            i_35652823 += 1;
          }
      };
    };

  
}

function addChars__stdZprivateZdigitsutils_u198(result_p0, result_p0_Idx, x_p1) {
    addChars__stdZprivateZdigitsutils_u202(result_p0, result_p0_Idx, x_p1, 0, ((x_p1) == null ? 0 : (x_p1).length));

  
}

function addInt__stdZprivateZdigitsutils_u223(result_p0, result_p0_Idx, x_p1) {
    addChars__stdZprivateZdigitsutils_u198(result_p0, result_p0_Idx, ((x_p1) + ""));

  
}

function addInt__stdZprivateZdigitsutils_u241(result_p0, result_p0_Idx, x_p1) {
    addInt__stdZprivateZdigitsutils_u223(result_p0, result_p0_Idx, BigInt(x_p1));

  
}

function HEX24__systemZdollars_u14(xHEX60gensym0_p0) {
  var result_25165840 = [[]];

    result_25165840[0] = nimCopy(null, [], NTI2097169);
    addInt__stdZprivateZdigitsutils_u241(result_25165840, 0, xHEX60gensym0_p0);

  return result_25165840[0];

}

function add__system_u1972(x_p0, x_p0_Idx, y_p1) {
          if (x_p0[x_p0_Idx] === null) { x_p0[x_p0_Idx] = []; }
      var off = x_p0[x_p0_Idx].length;
      x_p0[x_p0_Idx].length += y_p1.length;
      for (var i = 0; i < y_p1.length; ++i) {
        x_p0[x_p0_Idx][off+i] = y_p1.charCodeAt(i);
      }
    

  
}

function newSeq__system_u2546(len_p0) {
  var result_2099702 = [];

    result_2099702 = new Array(len_p0); for (var i = 0 ; i < len_p0 ; ++i) { result_2099702[i] = null; }
  return result_2099702;

}

function isNimException__system_u2043() {
    return lastJSError && lastJSError.m_type;

  
}

function getCurrentException() {
  var result_2099198 = null;

    if (isNimException__system_u2043()) {
    result_2099198 = lastJSError;
    }
    

  return result_2099198;

}

function raiseDefect() {
    if (isNimException__system_u2043()) {
    var e_2099414 = getCurrentException();
    if (isObj(e_2099414.m_type, NTI2097904)) {
    if ((excHandler == 0)) {
    unhandledException(e_2099414);
    }
    
    throw e_2099414;
    }
    
    }
    

  
}

function unhandledException(e_p0) {
    var buf_2099408 = [[]];
    if (!(((e_p0.message).length == 0))) {
    nimAddStrStr(buf_2099408[0], [69,114,114,111,114,58,32,117,110,104,97,110,100,108,101,100,32,101,120,99,101,112,116,105,111,110,58,32]);;
    nimAddStrStr(buf_2099408[0], e_p0.message);;
    }
    else {
    nimAddStrStr(buf_2099408[0], [69,114,114,111,114,58,32,117,110,104,97,110,100,108,101,100,32,101,120,99,101,112,116,105,111,110]);;
    }
    
    nimAddStrStr(buf_2099408[0], [32,91]);;
    add__system_u1972(buf_2099408, 0, e_p0.name);
    nimAddStrStr(buf_2099408[0], [93,10]);;
    var cbuf_2099409 = toJSStr(buf_2099408[0]);
      if (typeof(Error) !== "undefined") {
    throw new Error(cbuf_2099409);
  }
  else {
    throw cbuf_2099409;
  }
  

  
}

function raiseIndexError(i_p0, a_p1, b_p2) {
    var Temporary1;

    if ((b_p2 < a_p1)) {
    Temporary1 = [105,110,100,101,120,32,111,117,116,32,111,102,32,98,111,117,110,100,115,44,32,116,104,101,32,99,111,110,116,97,105,110,101,114,32,105,115,32,101,109,112,116,121];
    }
    else {
    Temporary1 = ([105,110,100,101,120,32]).concat(HEX24__systemZdollars_u14(i_p0),[32,110,111,116,32,105,110,32],HEX24__systemZdollars_u14(a_p1),[32,46,46,32],HEX24__systemZdollars_u14(b_p2));
    }
    
    raiseException({message: nimCopy(null, Temporary1, NTI2097169), parent: null, m_type: NTI8388629, name: null, trace: [], up: null}, "IndexDefect");

  
}

function sysFatal__stdZassertions_u46(message_p1) {
    raiseException({message: nimCopy(null, message_p1, NTI2097169), m_type: NTI8388625, parent: null, name: null, trace: [], up: null}, "AssertionDefect");

  
}

function raiseAssert__stdZassertions_u44(msg_p0) {
    sysFatal__stdZassertions_u46(msg_p0);

  
}

function failedAssertImpl__stdZassertions_u86(msg_p0) {
    raiseAssert__stdZassertions_u44(msg_p0);

  
}

function onDOMLoaded(e_p0) {
            var Temporary4;

function HEX3Aanonymous__dochack_u65(event_p0) {
    event_p0.target.parentNode.style.display = "none";
    event_p0.target.parentNode.nextSibling.style.display = "inline";

  
}

    document.getElementById("theme-select").value = window.localStorage.getItem("theme");
    Label1: {
      var pragmaDots_35651648 = null;
      var colontmp__35652814 = [];
      colontmp__35652814 = document.getElementsByClassName("pragmadots");
      var i_35652816 = 0;
      var L_35652817 = (colontmp__35652814).length;
      Label2: {
          Label3: while (true) {
          if (!(i_35652816 < L_35652817)) break Label3;
            pragmaDots_35651648 = colontmp__35652814[chckIndx(i_35652816, 0, (colontmp__35652814).length - 1)];
            Temporary4 = HEX3Aanonymous__dochack_u65.bind(null); Temporary4.ClP_0 = HEX3Aanonymous__dochack_u65; Temporary4.ClE_0 = null;
            pragmaDots_35651648.onclick = Temporary4;
            i_35652816 += 1;
            if (!(((colontmp__35652814).length == L_35652817))) {
            failedAssertImpl__stdZassertions_u86(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
            }
            
          }
      };
    };

  
}

function raiseOverflow() {
    raiseException({message: [111,118,101,114,45,32,111,114,32,117,110,100,101,114,102,108,111,119], parent: null, m_type: NTI8388623, name: null, trace: [], up: null}, "OverflowDefect");

  
}

function checkOverflowInt(a_p0) {
        if (a_p0 > 2147483647 || a_p0 < -2147483648) raiseOverflow();
  

  
}

function isWhitespace__dochack_u408(x_p0) {
  var result_35651994 = false;

    result_35651994 = (((x_p0.nodeName == "#text") && !/\S/.test(x_p0.textContent)) || (x_p0.nodeName == "#comment"));

  return result_35651994;

}

function toToc__dochack_u411(x_p0, father_p1) {
                var Temporary5;
            var Temporary6;
            var Temporary7;
            var Temporary8;
      var Temporary15;

    if ((x_p0.nodeName == "UL")) {
    var f_35652005 = {heading: null, kids: [], sortId: (father_p1.kids).length, doSort: false};
    var i_35652006 = 0;
    Label1: {
        Label2: while (true) {
        if (!(i_35652006 < x_p0.childNodes.length)) break Label2;
          var nxt_35652007 = addInt(i_35652006, 1);
          Label3: {
              Label4: while (true) {
                if (!(nxt_35652007 < x_p0.childNodes.length)) Temporary5 = false; else {                  Temporary5 = isWhitespace__dochack_u408(x_p0.childNodes[nxt_35652007]);                }              if (!Temporary5) break Label4;
                nxt_35652007 = addInt(nxt_35652007, 1);
              }
          };
            if (!(nxt_35652007 < x_p0.childNodes.length)) Temporary8 = false; else {              Temporary8 = (x_p0.childNodes[i_35652006].nodeName == "LI");            }            if (!Temporary8) Temporary7 = false; else {              Temporary7 = (x_p0.childNodes[i_35652006].childNodes.length == 1);            }            if (!Temporary7) Temporary6 = false; else {              Temporary6 = (x_p0.childNodes[nxt_35652007].nodeName == "UL");            }          if (Temporary6) {
          var e_35652020 = {heading: x_p0.childNodes[i_35652006].childNodes[0], kids: [], sortId: (f_35652005.kids).length, doSort: false};
          var it_35652021 = x_p0.childNodes[nxt_35652007];
          Label9: {
            var j_35652026 = 0;
            var colontmp__35652831 = 0;
            colontmp__35652831 = it_35652021.childNodes.length;
            var i_35652832 = 0;
            Label10: {
                Label11: while (true) {
                if (!(i_35652832 < colontmp__35652831)) break Label11;
                  j_35652026 = i_35652832;
                  toToc__dochack_u411(it_35652021.childNodes[j_35652026], e_35652020);
                  i_35652832 = addInt(i_35652832, 1);
                }
            };
          };
          f_35652005.kids.push(e_35652020);;
          i_35652006 = addInt(nxt_35652007, 1);
          }
          else {
            toToc__dochack_u411(x_p0.childNodes[i_35652006], f_35652005);
            i_35652006 = addInt(i_35652006, 1);
          }
          
        }
    };
    father_p1.kids.push(f_35652005);;
    }
    else {
    if (isWhitespace__dochack_u408(x_p0)) {
    }
    else {
    if ((x_p0.nodeName == "LI")) {
    var idx_35652044 = [];
    Label12: {
      var i_35652049 = 0;
      var colontmp__35652835 = 0;
      colontmp__35652835 = x_p0.childNodes.length;
      var i_35652836 = 0;
      Label13: {
          Label14: while (true) {
          if (!(i_35652836 < colontmp__35652835)) break Label14;
            i_35652049 = i_35652836;
            if (!(isWhitespace__dochack_u408(x_p0.childNodes[i_35652049]))) {
            idx_35652044.push(i_35652049);;
            }
            
            i_35652836 = addInt(i_35652836, 1);
          }
      };
    };
      if (!((idx_35652044).length == 2)) Temporary15 = false; else {        Temporary15 = (x_p0.childNodes[idx_35652044[chckIndx(1, 0, (idx_35652044).length - 1)]].nodeName == "UL");      }    if (Temporary15) {
    var e_35652065 = {heading: x_p0.childNodes[idx_35652044[chckIndx(0, 0, (idx_35652044).length - 1)]], kids: [], sortId: (father_p1.kids).length, doSort: false};
    var it_35652066 = x_p0.childNodes[idx_35652044[chckIndx(1, 0, (idx_35652044).length - 1)]];
    Label16: {
      var j_35652071 = 0;
      var colontmp__35652839 = 0;
      colontmp__35652839 = it_35652066.childNodes.length;
      var i_35652840 = 0;
      Label17: {
          Label18: while (true) {
          if (!(i_35652840 < colontmp__35652839)) break Label18;
            j_35652071 = i_35652840;
            toToc__dochack_u411(it_35652066.childNodes[j_35652071], e_35652065);
            i_35652840 = addInt(i_35652840, 1);
          }
      };
    };
    father_p1.kids.push(e_35652065);;
    }
    else {
      Label19: {
        var i_35652080 = 0;
        var colontmp__35652843 = 0;
        colontmp__35652843 = x_p0.childNodes.length;
        var i_35652844 = 0;
        Label20: {
            Label21: while (true) {
            if (!(i_35652844 < colontmp__35652843)) break Label21;
              i_35652080 = i_35652844;
              toToc__dochack_u411(x_p0.childNodes[i_35652080], father_p1);
              i_35652844 = addInt(i_35652844, 1);
            }
        };
      };
    }
    
    }
    else {
    father_p1.kids.push({heading: x_p0, kids: [], sortId: (father_p1.kids).length, doSort: false});;
    }
    }}

  
}

function extractItems__dochack_u199(x_p0, heading_p1, items_p2, items_p2_Idx) {
  BeforeRet: {
    if ((x_p0 == null)) {
    break BeforeRet;
    }
    
    if ((!((x_p0.heading == null)) && (x_p0.heading.textContent == heading_p1))) {
    Label1: {
      var i_35651803 = 0;
      var colontmp__35652847 = 0;
      colontmp__35652847 = (x_p0.kids).length;
      var i_35652848 = 0;
      Label2: {
          Label3: while (true) {
          if (!(i_35652848 < colontmp__35652847)) break Label3;
            i_35651803 = i_35652848;
            items_p2[items_p2_Idx].push(x_p0.kids[chckIndx(i_35651803, 0, (x_p0.kids).length - 1)].heading);;
            i_35652848 = addInt(i_35652848, 1);
          }
      };
    };
    }
    else {
      Label4: {
        var k_35651829 = null;
        var i_35652852 = 0;
        var L_35652853 = (x_p0.kids).length;
        Label5: {
            Label6: while (true) {
            if (!(i_35652852 < L_35652853)) break Label6;
              k_35651829 = x_p0.kids[chckIndx(i_35652852, 0, (x_p0.kids).length - 1)];
              extractItems__dochack_u199(k_35651829, heading_p1, items_p2, items_p2_Idx);
              i_35652852 += 1;
              if (!(((x_p0.kids).length == L_35652853))) {
              failedAssertImpl__stdZassertions_u86(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
              }
              
            }
        };
      };
    }
    
  };

  
}

function tree__dochack_u130(tag_p0, kids_p1) {
  var result_35651717 = null;

    result_35651717 = document.createElement(tag_p0);
    Label1: {
      var k_35651731 = null;
      var i_35652865 = 0;
      Label2: {
          Label3: while (true) {
          if (!(i_35652865 < (kids_p1).length)) break Label3;
            k_35651731 = kids_p1[chckIndx(i_35652865, 0, (kids_p1).length - 1)];
            result_35651717.appendChild(k_35651731);
            i_35652865 += 1;
          }
      };
    };

  return result_35651717;

}

function text__dochack_u155(s_p0) {
  var result_35651741 = null;

    result_35651741 = document.createTextNode(s_p0);

  return result_35651741;

}

function uncovered__dochack_u600(x_p0) {
    var Temporary1;

  var result_35652186 = null;

  BeforeRet: {
    if ((((x_p0.kids).length == 0) && !((x_p0.heading == null)))) {
    if (!(x_p0.heading.hasOwnProperty('__karaxMarker__'))) {
    Temporary1 = x_p0;
    }
    else {
    Temporary1 = null;
    }
    
    result_35652186 = Temporary1;
    break BeforeRet;
    }
    
    result_35652186 = {heading: x_p0.heading, kids: [], sortId: x_p0.sortId, doSort: x_p0.doSort};
    Label2: {
      var k_35652201 = null;
      var i_35652872 = 0;
      var L_35652873 = (x_p0.kids).length;
      Label3: {
          Label4: while (true) {
          if (!(i_35652872 < L_35652873)) break Label4;
            k_35652201 = x_p0.kids[chckIndx(i_35652872, 0, (x_p0.kids).length - 1)];
            var y_35652202 = uncovered__dochack_u600(k_35652201);
            if (!((y_35652202 == null))) {
            result_35652186.kids.push(y_35652202);;
            }
            
            i_35652872 += 1;
            if (!(((x_p0.kids).length == L_35652873))) {
            failedAssertImpl__stdZassertions_u86(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
            }
            
          }
      };
    };
    if (((result_35652186.kids).length == 0)) {
    result_35652186 = null;
    }
    
  };

  return result_35652186;

}

function mergeTocs__dochack_u630(orig_p0, news_p1) {
  var result_35652217 = null;

    result_35652217 = uncovered__dochack_u600(orig_p0);
    if ((result_35652217 == null)) {
    result_35652217 = news_p1;
    }
    else {
      Label1: {
        var i_35652229 = 0;
        var colontmp__35652868 = 0;
        colontmp__35652868 = (news_p1.kids).length;
        var i_35652869 = 0;
        Label2: {
            Label3: while (true) {
            if (!(i_35652869 < colontmp__35652868)) break Label3;
              i_35652229 = i_35652869;
              result_35652217.kids.push(news_p1.kids[chckIndx(i_35652229, 0, (news_p1.kids).length - 1)]);;
              i_35652869 = addInt(i_35652869, 1);
            }
        };
      };
    }
    

  return result_35652217;

}

function buildToc__dochack_u650(orig_p0, types_p1, procs_p2) {
  var result_35652238 = null;

    var newStuff_35652243 = {heading: null, kids: [], doSort: true, sortId: 0};
    Label1: {
      var t_35652247 = null;
      var i_35652860 = 0;
      var L_35652861 = (types_p1).length;
      Label2: {
          Label3: while (true) {
          if (!(i_35652860 < L_35652861)) break Label3;
            t_35652247 = types_p1[chckIndx(i_35652860, 0, (types_p1).length - 1)];
            var c_35652252 = {heading: t_35652247.cloneNode(true), kids: [], doSort: true, sortId: 0};
            t_35652247.__karaxMarker__ = true;
            Label4: {
              var p_35652256 = null;
              var i_35652857 = 0;
              var L_35652858 = (procs_p2).length;
              Label5: {
                  Label6: while (true) {
                  if (!(i_35652857 < L_35652858)) break Label6;
                    p_35652256 = procs_p2[chckIndx(i_35652857, 0, (procs_p2).length - 1)];
                    if (!(p_35652256.hasOwnProperty('__karaxMarker__'))) {
                    var xx_35652257 = p_35652256.parentNode.getElementsByClassName("attachedType");
                    if ((((xx_35652257).length == 1) && (xx_35652257[chckIndx(0, 0, (xx_35652257).length - 1)].textContent == t_35652247.textContent))) {
                    var q_35652262 = tree__dochack_u130("A", [text__dochack_u155(p_35652256.title)]);
                    q_35652262.setAttribute("href", p_35652256.getAttribute("href"));
                    c_35652252.kids.push({heading: q_35652262, kids: [], sortId: 0, doSort: false});;
                    p_35652256.__karaxMarker__ = true;
                    }
                    
                    }
                    
                    i_35652857 += 1;
                    if (!(((procs_p2).length == L_35652858))) {
                    failedAssertImpl__stdZassertions_u86(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
                    }
                    
                  }
              };
            };
            newStuff_35652243.kids.push(c_35652252);;
            i_35652860 += 1;
            if (!(((types_p1).length == L_35652861))) {
            failedAssertImpl__stdZassertions_u86(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
            }
            
          }
      };
    };
    result_35652238 = mergeTocs__dochack_u630(orig_p0, newStuff_35652243);

  return result_35652238;

}

function add__dochack_u148(parent_p0, kid_p1) {
    if (((parent_p0.nodeName == "TR") && ((kid_p1.nodeName == "TD") || (kid_p1.nodeName == "TH")))) {
    var k_35651735 = document.createElement("TD");
    k_35651735.appendChild(kid_p1);
    parent_p0.appendChild(k_35651735);
    }
    else {
    parent_p0.appendChild(kid_p1);
    }
    

  
}

function setClass__dochack_u152(e_p0, value_p1) {
    e_p0.setAttribute("class", value_p1);

  
}

function toHtml__dochack_u278(x_p0, isRoot_p1) {
    var Temporary1;

function HEX3Aanonymous__dochack_u298(a_p0, b_p1) {
  var result_35651885 = 0;

  BeforeRet: {
    if ((!((a_p0.heading == null)) && !((b_p1.heading == null)))) {
    var x_35651894 = a_p0.heading.textContent;
    var y_35651895 = b_p1.heading.textContent;
    if ((x_35651894 < y_35651895)) {
    result_35651885 = (-1);
    break BeforeRet;
    }
    
    if ((y_35651895 < x_35651894)) {
    result_35651885 = 1;
    break BeforeRet;
    }
    
    result_35651885 = 0;
    break BeforeRet;
    }
    else {
      result_35651885 = subInt(a_p0.sortId, b_p1.sortId);
      break BeforeRet;
    }
    
  };

  return result_35651885;

}

  var result_35651865 = null;

  BeforeRet: {
    if ((x_p0 == null)) {
    result_35651865 = null;
    break BeforeRet;
    }
    
    if (((x_p0.kids).length == 0)) {
    if ((x_p0.heading == null)) {
    result_35651865 = null;
    break BeforeRet;
    }
    
    result_35651865 = x_p0.heading.cloneNode(true);
    break BeforeRet;
    }
    
    result_35651865 = tree__dochack_u130("DIV", []);
    if ((!((x_p0.heading == null)) && !(x_p0.heading.hasOwnProperty('__karaxMarker__')))) {
    add__dochack_u148(result_35651865, x_p0.heading.cloneNode(true));
    }
    
    var ul_35651881 = tree__dochack_u130("UL", []);
    if (isRoot_p1) {
    setClass__dochack_u152(ul_35651881, "simple simple-toc");
    }
    else {
    setClass__dochack_u152(ul_35651881, "simple");
    }
    
    if (x_p0.doSort) {
    Temporary1 = HEX3Aanonymous__dochack_u298.bind(null); Temporary1.ClP_0 = HEX3Aanonymous__dochack_u298; Temporary1.ClE_0 = null;
    x_p0.kids.sort(Temporary1);
    }
    
    Label2: {
      var k_35651907 = null;
      var i_35652876 = 0;
      var L_35652877 = (x_p0.kids).length;
      Label3: {
          Label4: while (true) {
          if (!(i_35652876 < L_35652877)) break Label4;
            k_35651907 = x_p0.kids[chckIndx(i_35652876, 0, (x_p0.kids).length - 1)];
            var y_35651908 = toHtml__dochack_u278(k_35651907, false);
            if (!((y_35651908 == null))) {
            add__dochack_u148(ul_35651881, tree__dochack_u130("LI", [y_35651908]));
            }
            
            i_35652876 += 1;
            if (!(((x_p0.kids).length == L_35652877))) {
            failedAssertImpl__stdZassertions_u86(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
            }
            
          }
      };
    };
    if (!((ul_35651881.childNodes.length == 0))) {
    add__dochack_u148(result_35651865, ul_35651881);
    }
    
    if ((result_35651865.childNodes.length == 0)) {
    result_35651865 = null;
    }
    
  };

  return result_35651865;

}

function replaceById__dochack_u158(id_p0, newTree_p1) {
    var x_35651745 = document.getElementById(id_p0);
    x_35651745.parentNode.replaceChild(newTree_p1, x_35651745);
    newTree_p1.id = id_p0;

  
}

function togglevis__dochack_u708(d_p0) {
    if ((d_p0.style.display == "none")) {
    d_p0.style.display = "inline";
    }
    else {
      d_p0.style.display = "none";
    }
    

  
}

function groupBy(value_p0) {
    var toc_35652296 = document.getElementById("toc-list");
    if ((alternative_35652291[0] == null)) {
    var tt_35652304 = {heading: null, kids: [], sortId: 0, doSort: false};
    toToc__dochack_u411(toc_35652296, tt_35652304);
    tt_35652304 = tt_35652304.kids[chckIndx(0, 0, (tt_35652304.kids).length - 1)];
    var types_35652309 = [[]];
    var procs_35652314 = [[]];
    extractItems__dochack_u199(tt_35652304, "Types", types_35652309, 0);
    extractItems__dochack_u199(tt_35652304, "Procs", procs_35652314, 0);
    extractItems__dochack_u199(tt_35652304, "Converters", procs_35652314, 0);
    extractItems__dochack_u199(tt_35652304, "Methods", procs_35652314, 0);
    extractItems__dochack_u199(tt_35652304, "Templates", procs_35652314, 0);
    extractItems__dochack_u199(tt_35652304, "Macros", procs_35652314, 0);
    extractItems__dochack_u199(tt_35652304, "Iterators", procs_35652314, 0);
    var ntoc_35652315 = buildToc__dochack_u650(tt_35652304, types_35652309[0], procs_35652314[0]);
    var x_35652316 = toHtml__dochack_u278(ntoc_35652315, true);
    alternative_35652291[0] = tree__dochack_u130("DIV", [x_35652316]);
    }
    
    if ((value_p0 == "type")) {
    replaceById__dochack_u158("tocRoot", alternative_35652291[0]);
    }
    else {
    replaceById__dochack_u158("tocRoot", tree__dochack_u130("DIV", []));
    }
    
    togglevis__dochack_u708(document.getElementById("toc-list"));

  
}

function raiseRangeError() {
    raiseException({message: [118,97,108,117,101,32,111,117,116,32,111,102,32,114,97,110,103,101], parent: null, m_type: NTI8388631, name: null, trace: [], up: null}, "RangeDefect");

  
}

function HEX5BHEX5D__pureZstrutils_u1308(s_p0, x_p1) {
  var result_46138657 = [];

    var a_46138659 = x_p1.a;
    var L_46138661 = addInt(subInt(subInt((s_p0).length, x_p1.b), a_46138659), 1);
    result_46138657 = nimCopy(null, mnewString(chckRange(L_46138661, 0, 2147483647)), NTI2097169);
    Label1: {
      var i_46138666 = 0;
      var i_35652886 = 0;
      Label2: {
          Label3: while (true) {
          if (!(i_35652886 < L_46138661)) break Label3;
            i_46138666 = i_35652886;
            result_46138657[chckIndx(i_46138666, 0, (result_46138657).length - 1)] = s_p0[chckIndx(addInt(i_46138666, a_46138659), 0, (s_p0).length - 1)];
            i_35652886 = addInt(i_35652886, 1);
          }
      };
    };

  return result_46138657;

}

function HEX2EHEX2E__stdZenumutils_u105(a_p0, b_p1) {
  var result_59768944 = ({a: 0, b: 0});

    result_59768944 = nimCopy(result_59768944, {a: a_p0, b: b_p1}, NTI59768921);

  return result_59768944;

}
async function loadIndex__dochack_u928() {
  var result_35652514 = null;

  BeforeRet: {
    var indexURL_35652520 = document.getElementById("indexLink").getAttribute("href");
    var rootURL_35652546 = HEX5BHEX5D__pureZstrutils_u1308(cstrToNimstr(indexURL_35652520), HEX2EHEX2E__stdZenumutils_u105(0, 14));
    var resp_35652558 = (await (await fetch(indexURL_35652520)).text());
    var indexElem_35652559 = document.createElement("div");
    indexElem_35652559.innerHTML = resp_35652558;
    Label1: {
      var href_35652581 = null;
      var colontmp__35652880 = [];
      colontmp__35652880 = indexElem_35652559.getElementsByClassName("reference");
      var i_35652882 = 0;
      var L_35652883 = (colontmp__35652880).length;
      Label2: {
          Label3: while (true) {
          if (!(i_35652882 < L_35652883)) break Label3;
            href_35652581 = colontmp__35652880[chckIndx(i_35652882, 0, (colontmp__35652880).length - 1)];
            href_35652581.setAttribute("href", toJSStr((rootURL_35652546).concat(cstrToNimstr(href_35652581.getAttribute("href")))));
            db_35652333[0].push(href_35652581);;
            contents_35652334[0].push(href_35652581.getAttribute("data-doc-search-tag"));;
            i_35652882 += 1;
            if (!(((colontmp__35652880).length == L_35652883))) {
            failedAssertImpl__stdZassertions_u86(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
            }
            
          }
      };
    };
    result_35652514 = undefined;
    break BeforeRet;
  };

  return result_35652514;

}

function then__dochack_u1107(future_p0, onSuccess_p1, onReject_p2) {
  var result_35652697 = null;

  BeforeRet: {
    var ret_35652707 = null;
    ret_35652707 = future_p0.then(onSuccess_p1, onReject_p2);
    result_35652697 = ret_35652707;
    break BeforeRet;
  };

  return result_35652697;

}

function nsuToLowerAsciiChar(c_p0) {
  var result_46137431 = 0;

    if ((ConstSet2[c_p0] != undefined)) {
    result_46137431 = (c_p0 ^ 32);
    }
    else {
      result_46137431 = c_p0;
    }
    

  return result_46137431;

}

function fuzzyMatch__fuzzysearch_u16(pattern_p0, str_p1) {
              var Temporary4;
              var Temporary5;
                var Temporary6;
      var Temporary7;
        var Temporary8;

  var result_45088789 = {Field0: 0, Field1: false};

    var scoreState_45088790 = (-100);
    var headerMatched_45088791 = false;
    var unmatchedLeadingCharCount_45088792 = 0;
    var consecutiveMatchCount_45088793 = 0;
    var strIndex_45088794 = 0;
    var patIndex_45088795 = 0;
    var score_45088796 = 0;
    Label1: {
        Label2: while (true) {
        if (!((strIndex_45088794 < ((str_p1) == null ? 0 : (str_p1).length)) && (patIndex_45088795 < ((pattern_p0) == null ? 0 : (pattern_p0).length)))) break Label2;
          Label3: {
            var patternChar_45088799 = nsuToLowerAsciiChar(pattern_p0.charCodeAt(chckIndx(patIndex_45088795, 0, (pattern_p0).length - 1)));
            var strChar_45088800 = nsuToLowerAsciiChar(str_p1.charCodeAt(chckIndx(strIndex_45088794, 0, (str_p1).length - 1)));
            if ((ConstSet3[patternChar_45088799] != undefined)) {
            patIndex_45088795 = addInt(patIndex_45088795, 1);
            break Label3;
            }
            
            if ((ConstSet4[strChar_45088800] != undefined)) {
            strIndex_45088794 = addInt(strIndex_45088794, 1);
            break Label3;
            }
            
            if ((!(headerMatched_45088791) && (strChar_45088800 == 58))) {
            headerMatched_45088791 = true;
            scoreState_45088790 = (-100);
            score_45088796 = chckRange(Number(BigInt(Math.trunc(Math.floor((0.5 * score_45088796))))), (-2147483648), 2147483647);
            patIndex_45088795 = 0;
            strIndex_45088794 = addInt(strIndex_45088794, 1);
            break Label3;
            }
            
            if ((strChar_45088800 == patternChar_45088799)) {
            switch (scoreState_45088790) {
            case (-100):
            case 20:
              scoreState_45088790 = 10;
              break;
            case 0:
              scoreState_45088790 = 5;
              score_45088796 = addInt(score_45088796, scoreState_45088790);
              break;
            case 10:
            case 5:
              consecutiveMatchCount_45088793 = addInt(consecutiveMatchCount_45088793, 1);
              scoreState_45088790 = 5;
              score_45088796 = addInt(score_45088796, mulInt(5, consecutiveMatchCount_45088793));
              if ((scoreState_45088790 == 10)) {
              score_45088796 = addInt(score_45088796, 10);
              }
              
              var onBoundary_45088852 = (patIndex_45088795 == ((pattern_p0) == null ? -1 : (pattern_p0).length - 1));
              if ((!(onBoundary_45088852) && (strIndex_45088794 < ((str_p1) == null ? -1 : (str_p1).length - 1)))) {
              var nextPatternChar_45088853 = nsuToLowerAsciiChar(pattern_p0.charCodeAt(chckIndx(addInt(patIndex_45088795, 1), 0, (pattern_p0).length - 1)));
              var nextStrChar_45088854 = nsuToLowerAsciiChar(str_p1.charCodeAt(chckIndx(addInt(strIndex_45088794, 1), 0, (str_p1).length - 1)));
              if (!!((ConstSet5[nextStrChar_45088854] != undefined))) Temporary4 = false; else {                Temporary4 = !((nextStrChar_45088854 == nextPatternChar_45088853));              }              onBoundary_45088852 = Temporary4;
              }
              
              if (onBoundary_45088852) {
              scoreState_45088790 = 20;
              score_45088796 = addInt(score_45088796, scoreState_45088790);
              }
              
              break;
            case (-1):
            case (-3):
              if (!((ConstSet6[str_p1.charCodeAt(chckIndx(subInt(strIndex_45088794, 1), 0, (str_p1).length - 1))] != undefined))) Temporary5 = true; else {                if (!(ConstSet7[str_p1.charCodeAt(chckIndx(subInt(strIndex_45088794, 1), 0, (str_p1).length - 1))] != undefined)) Temporary6 = false; else {                  Temporary6 = (ConstSet8[str_p1.charCodeAt(chckIndx(strIndex_45088794, 0, (str_p1).length - 1))] != undefined);                }                Temporary5 = Temporary6;              }              var isLeadingChar_45088878 = Temporary5;
              if (isLeadingChar_45088878) {
              scoreState_45088790 = 10;
              }
              else {
                scoreState_45088790 = 0;
                score_45088796 = addInt(score_45088796, scoreState_45088790);
              }
              
              break;
            }
            patIndex_45088795 = addInt(patIndex_45088795, 1);
            }
            else {
              switch (scoreState_45088790) {
              case (-100):
                scoreState_45088790 = (-3);
                score_45088796 = addInt(score_45088796, scoreState_45088790);
                break;
              case 5:
                scoreState_45088790 = (-1);
                score_45088796 = addInt(score_45088796, scoreState_45088790);
                consecutiveMatchCount_45088793 = 0;
                break;
              case (-3):
                if ((unmatchedLeadingCharCount_45088792 < 3)) {
                scoreState_45088790 = (-3);
                score_45088796 = addInt(score_45088796, scoreState_45088790);
                }
                
                unmatchedLeadingCharCount_45088792 = addInt(unmatchedLeadingCharCount_45088792, 1);
                break;
              default: 
                scoreState_45088790 = (-1);
                score_45088796 = addInt(score_45088796, scoreState_45088790);
                break;
              }
            }
            
            strIndex_45088794 = addInt(strIndex_45088794, 1);
          };
        }
    };
      if (!(patIndex_45088795 == ((pattern_p0) == null ? 0 : (pattern_p0).length))) Temporary7 = false; else {        if ((strIndex_45088794 == ((str_p1) == null ? 0 : (str_p1).length))) Temporary8 = true; else {          Temporary8 = !((ConstSet9[str_p1.charCodeAt(chckIndx(strIndex_45088794, 0, (str_p1).length - 1))] != undefined));        }        Temporary7 = Temporary8;      }    if (Temporary7) {
    score_45088796 = addInt(score_45088796, 10);
    }
    
    var colontmp__35652899 = nimMax(0, score_45088796);
    var colontmp__35652900 = (0 < score_45088796);
    result_45088789 = nimCopy(result_45088789, {Field0: colontmp__35652899, Field1: colontmp__35652900}, NTI45088782);

  return result_45088789;

}

function escapeCString__dochack_u751(x_p0, x_p0_Idx) {
    var s_35652337 = [];
    Label1: {
      var c_35652338 = 0;
      var iHEX60gensym13_35652903 = 0;
      var nHEX60gensym13_35652904 = ((x_p0[x_p0_Idx]) == null ? 0 : (x_p0[x_p0_Idx]).length);
      Label2: {
          Label3: while (true) {
          if (!(iHEX60gensym13_35652903 < nHEX60gensym13_35652904)) break Label3;
            c_35652338 = x_p0[x_p0_Idx].charCodeAt(chckIndx(iHEX60gensym13_35652903, 0, (x_p0[x_p0_Idx]).length - 1));
            switch (c_35652338) {
            case 60:
              nimAddStrStr(s_35652337, [38,108,116,59]);;
              break;
            case 62:
              nimAddStrStr(s_35652337, [38,103,116,59]);;
              break;
            default: 
              addChar(s_35652337, c_35652338);;
              break;
            }
            iHEX60gensym13_35652903 += 1;
          }
      };
    };
    x_p0[x_p0_Idx] = toJSStr(s_35652337);

  
}

function dosearch__dochack_u755(value_p0) {
    var Temporary5;

function HEX3Aanonymous__dochack_u783(a_p0, b_p1) {
  var result_35652380 = 0;

    result_35652380 = subInt(b_p1["Field1"], a_p0["Field1"]);

  return result_35652380;

}

  var result_35652341 = null;

  BeforeRet: {
    if (((db_35652333[0]).length == 0)) {
    break BeforeRet;
    }
    
    var ul_35652345 = tree__dochack_u130("UL", []);
    result_35652341 = tree__dochack_u130("DIV", []);
    setClass__dochack_u152(result_35652341, "search_results");
    var matches_35652350 = [];
    Label1: {
      var i_35652358 = 0;
      var colontmp__35652890 = 0;
      colontmp__35652890 = (db_35652333[0]).length;
      var i_35652891 = 0;
      Label2: {
          Label3: while (true) {
          if (!(i_35652891 < colontmp__35652890)) break Label3;
            i_35652358 = i_35652891;
            Label4: {
              var c_35652359 = contents_35652334[0][chckIndx(i_35652358, 0, (contents_35652334[0]).length - 1)];
              if (((c_35652359 == "Examples") || (c_35652359 == "PEG construction"))) {
              break Label4;
              }
              
              var tmpTuple_35652360 = fuzzyMatch__fuzzysearch_u16(value_p0, c_35652359);
              var score_35652361 = tmpTuple_35652360["Field0"];
              var matched_35652362 = tmpTuple_35652360["Field1"];
              if (matched_35652362) {
              matches_35652350.push({Field0: db_35652333[0][chckIndx(i_35652358, 0, (db_35652333[0]).length - 1)], Field1: score_35652361});;
              }
              
            };
            i_35652891 = addInt(i_35652891, 1);
          }
      };
    };
    Temporary5 = HEX3Aanonymous__dochack_u783.bind(null); Temporary5.ClP_0 = HEX3Aanonymous__dochack_u783; Temporary5.ClE_0 = null;
    matches_35652350.sort(Temporary5);
    Label6: {
      var i_35652397 = 0;
      var colontmp__35652894 = 0;
      colontmp__35652894 = nimMin((matches_35652350).length, 29);
      var i_35652895 = 0;
      Label7: {
          Label8: while (true) {
          if (!(i_35652895 < colontmp__35652894)) break Label8;
            i_35652397 = i_35652895;
            matches_35652350[chckIndx(i_35652397, 0, (matches_35652350).length - 1)]["Field0"].innerHTML = matches_35652350[chckIndx(i_35652397, 0, (matches_35652350).length - 1)]["Field0"].getAttribute("data-doc-search-tag");
            escapeCString__dochack_u751(matches_35652350[chckIndx(i_35652397, 0, (matches_35652350).length - 1)]["Field0"], "innerHTML");
            add__dochack_u148(ul_35652345, tree__dochack_u130("LI", [matches_35652350[chckIndx(i_35652397, 0, (matches_35652350).length - 1)]["Field0"]]));
            i_35652895 = addInt(i_35652895, 1);
          }
      };
    };
    if ((ul_35652345.childNodes.length == 0)) {
    add__dochack_u148(result_35652341, tree__dochack_u130("B", [text__dochack_u155("no search results")]));
    }
    else {
      add__dochack_u148(result_35652341, tree__dochack_u130("B", [text__dochack_u155("search results")]));
      add__dochack_u148(result_35652341, ul_35652345);
    }
    
  };

  return result_35652341;

}

function hideSearch__dochack_u1090() {
    if (!((oldtoc_35652670[0] == null))) {
    replaceById__dochack_u158("tocRoot", oldtoc_35652670[0]);
    }
    

  
}

function runSearch__dochack_u1094() {
    var elem_35652679 = document.getElementById("searchInput");
    var value_35652680 = elem_35652679.value;
    if (!((value_35652680 == ""))) {
    if ((oldtoc_35652670[0] == null)) {
    oldtoc_35652670[0] = document.getElementById("tocRoot");
    }
    
    var results_35652684 = dosearch__dochack_u755(value_35652680);
    replaceById__dochack_u158("tocRoot", results_35652684);
    }
    else {
    hideSearch__dochack_u1090();
    }
    

  
}

function search() {
    var Temporary1;

    if ((loadIndexFut_35652673[0] == null)) {
    loadIndexFut_35652673[0] = loadIndex__dochack_u928();
    (then__dochack_u1107(loadIndexFut_35652673[0], runSearch__dochack_u1094, null));
    }
    
    if (!((timer_35652671[0] == null))) {
    clearTimeout(timer_35652671[0]);
    }
    
    Temporary1 = runSearch__dochack_u1094.bind(null); Temporary1.ClP_0 = runSearch__dochack_u1094; Temporary1.ClE_0 = null;
    timer_35652671[0] = setTimeout(Temporary1, 400);

  
}

function copyToClipboard() {
    
    function updatePreTags() {

      const allPreTags = document.querySelectorAll("pre:not(.line-nums)")

      allPreTags.forEach((e) => {

          const div = document.createElement("div")
          div.classList.add("copyToClipBoard")

          const preTag = document.createElement("pre")
          preTag.innerHTML = e.innerHTML

          const button = document.createElement("button")
          button.value = e.textContent.replace('...', '')
          button.classList.add("copyToClipBoardBtn")
          button.style.cursor = "pointer"

          div.appendChild(preTag)
          div.appendChild(button)

          e.outerHTML = div.outerHTML

      })
    }


    function copyTextToClipboard(e) {
        const clipBoardContent = e.target.value
        navigator.clipboard.writeText(clipBoardContent).then(function() {
            e.target.style.setProperty("--clipboard-image", "var(--clipboard-image-selected)")
        }, function(err) {
            console.error("Could not copy text: ", err);
        });
    }

    window.addEventListener("click", (e) => {
        if (e.target.classList.contains("copyToClipBoardBtn")) {
            copyTextToClipboard(e)
          }
    })

    window.addEventListener("mouseover", (e) => {
        if (e.target.nodeName === "PRE") {
            e.target.nextElementSibling.style.setProperty("--clipboard-image", "var(--clipboard-image-normal)")
        }
    })

    window.addEventListener("DOMContentLoaded", updatePreTags)

    

  
}
var Temporary1;
var Temporary2;

function HEX3Aanonymous__dochack_u1175(e_p0) {
    if ((e_p0.key == "/")) {
    e_p0.preventDefault();
    var searchElem_35652761 = document.getElementById("searchInput");
    searchElem_35652761.focus();
    searchElem_35652761.parentElement.scrollIntoView();
    runSearch__dochack_u1094();
    }
    

  
}
var Temporary3;

function HEX3Aanonymous__dochack_u1210(e_p0) {
    hideSearch__dochack_u1090();

  
}
var Temporary4;
var t_35651623 = window.localStorage.getItem("theme");
if ((t_35651623 == null)) {
Temporary1 = "auto";
}
else {
Temporary1 = t_35651623;
}

setTheme(Temporary1);
var alternative_35652291 = [null];
var db_35652333 = [[]];
var contents_35652334 = [[]];
var oldtoc_35652670 = [null];
var timer_35652671 = [null];
var loadIndexFut_35652673 = [null];
Temporary2 = HEX3Aanonymous__dochack_u1175.bind(null); Temporary2.ClP_0 = HEX3Aanonymous__dochack_u1175; Temporary2.ClE_0 = null;
window.addEventListener("keypress", Temporary2, false);
Temporary3 = HEX3Aanonymous__dochack_u1210.bind(null); Temporary3.ClP_0 = HEX3Aanonymous__dochack_u1210; Temporary3.ClE_0 = null;
window.addEventListener("hashchange", Temporary3, false);
copyToClipboard();
Temporary4 = onDOMLoaded.bind(null); Temporary4.ClP_0 = onDOMLoaded; Temporary4.ClE_0 = null;
window.addEventListener("DOMContentLoaded", Temporary4, false);
