text: // Generated by BUCKLESCRIPT VERSION 4.0.5, PLEASE EDIT WITH CARE
  'use strict';
  
  var List = require("bs-platform/lib/js/list.js");
  var Vdom = require("bucklescript-tea/src-ocaml/vdom.js");
  var $$String = require("bs-platform/lib/js/string.js");
  var Tea_html = require("bucklescript-tea/src-ocaml/tea_html.js");
  var Pervasives = require("bs-platform/lib/js/pervasives.js");
  
  function innerHTML(html) {
    return Vdom.prop("innerHTML", html);
  }
  
  function element_header_content(module_name, category, name, content, is_poly) {
    var trimmed_category = $$String.trim(category);
    var exit = 0;
    switch (trimmed_category) {
      case "module" : 
      case "module type" : 
          exit = 2;
          break;
      case "type" : 
          if (is_poly) {
            return /* :: */[
                    Tea_html.text(content + (" " + name)),
                    /* [] */0
                  ];
          } else {
            exit = 1;
          }
          break;
      case "val" : 
          return /* :: */[
                  Tea_html.span(undefined, undefined, /* [] */0, /* :: */[
                        Tea_html.text(name + " "),
                        /* [] */0
                      ]),
                  /* :: */[
                    Tea_html.span(undefined, undefined, /* :: */[
                          Vdom.prop("innerHTML", content),
                          /* [] */0
                        ], /* [] */0),
                    /* [] */0
                  ]
                ];
      default:
        exit = 1;
    }
    switch (exit) {
      case 1 : 
          return /* :: */[
                  Tea_html.text(name + (" " + content)),
                  /* [] */0
                ];
      case 2 : 
          return /* :: */[
                  Tea_html.span(undefined, undefined, /* [] */0, /* :: */[
                        Tea_html.a(undefined, undefined, /* :: */[
                              Tea_html.href("#" + (module_name + ("." + name))),
                              /* :: */[
                                Tea_html.class$prime("name"),
                                /* [] */0
                              ]
                            ], /* :: */[
                              Tea_html.text(name),
                              /* [] */0
                            ]),
                        /* :: */[
                          Tea_html.text(content),
                          /* [] */0
                        ]
                      ]),
                  /* [] */0
                ];
      
    }
  }
  
  function view_element_header(module_name, category, name, content, is_poly, element_html) {
    return /* :: */[
            Tea_html.h5(undefined, undefined, /* :: */[
                  Tea_html.id(name),
                  /* :: */[
                    Tea_html.class$prime("element-item"),
                    /* [] */0
                  ]
                ], /* :: */[
                  Tea_html.span(undefined, undefined, /* :: */[
                        Tea_html.class$prime("category"),
                        /* [] */0
                      ], /* :: */[
                        Tea_html.text(category),
                        /* [] */0
                      ]),
                  element_header_content(module_name, category, name, content, is_poly)
                ]),
            element_html
          ];
  }
  
  function view_element_info(info, element_html) {
    if (info !== undefined) {
      return /* :: */[
              Tea_html.div(undefined, undefined, /* :: */[
                    Tea_html.class$prime("info"),
                    /* :: */[
                      Vdom.prop("innerHTML", info),
                      /* [] */0
                    ]
                  ], /* [] */0),
              element_html
            ];
    } else {
      return element_html;
    }
  }
  
  function view_element_type_table(type_table, element_html) {
    if (type_table !== undefined) {
      return /* :: */[
              Tea_html.table(undefined, undefined, /* :: */[
                    Vdom.prop("innerHTML", type_table),
                    /* [] */0
                  ], /* [] */0),
              element_html
            ];
    } else {
      return element_html;
    }
  }
  
  function parse_exception(exec_parameter) {
    if (exec_parameter !== undefined) {
      return "of " + exec_parameter;
    } else {
      return "";
    }
  }
  
  function parse_type_extra(type_extra) {
    if (type_extra !== undefined) {
      return type_extra;
    } else {
      return "";
    }
  }
  
  function view_element(module_name, element_html, element) {
    switch (element.tag | 0) {
      case 0 : 
          return view_element_header(module_name, "type ", element[0], element[1], true, view_element_info(element[2], element_html));
      case 1 : 
          return view_element_header(module_name, "type ", element[0], parse_type_extra(element[1]), false, view_element_type_table(element[2], view_element_info(element[3], element_html)));
      case 2 : 
          return view_element_header(module_name, "val ", element[0], ": " + element[1], false, view_element_info(element[2], element_html));
      case 3 : 
          return view_element_header(module_name, "exception ", element[0], parse_exception(element[1]), false, view_element_info(element[2], element_html));
      case 4 : 
          return view_element_header(module_name, "module ", element[0], ": sig .. end", false, view_element_info(element[1], element_html));
      case 5 : 
          return view_element_header(module_name, "module type ", element[0], ": sig .. end", false, view_element_info(element[1], element_html));
      case 6 : 
          return view_element_header(module_name, "include ", element[0], "", false, element_html);
      
    }
  }
  
  function view_elements(module_name, elements) {
    return List.map((function (e) {
                  return Tea_html.li(undefined, undefined, /* :: */[
                              Tea_html.class$prime("element"),
                              /* [] */0
                            ], view_element(module_name, /* [] */0, e));
                }), elements);
  }
  
  function view_section_name(section_name) {
    if (section_name !== undefined) {
      return Tea_html.h2(undefined, undefined, /* :: */[
                  Tea_html.class$prime("subtitle"),
                  /* [] */0
                ], /* :: */[
                  Tea_html.text(section_name),
                  /* [] */0
                ]);
    } else {
      return Tea_html.span(undefined, undefined, /* [] */0, /* [] */0);
    }
  }
  
  function view_section_info(section_info) {
    if (section_info !== undefined) {
      return Tea_html.div(undefined, undefined, /* :: */[
                  Tea_html.class$prime("info"),
                  /* :: */[
                    Vdom.prop("innerHTML", section_info),
                    /* [] */0
                  ]
                ], /* [] */0);
    } else {
      return Tea_html.span(undefined, undefined, /* [] */0, /* [] */0);
    }
  }
  
  function view_section(module_name, section) {
    return Tea_html.li(undefined, undefined, /* :: */[
                Tea_html.class$prime("section"),
                /* [] */0
              ], /* :: */[
                view_section_name(section[/* section_name */0]),
                /* :: */[
                  view_section_info(section[/* section_info */1]),
                  /* :: */[
                    Tea_html.ul(undefined, undefined, /* [] */0, view_elements(module_name, section[/* elements */2])),
                    /* :: */[
                      Tea_html.ul(undefined, undefined, /* :: */[
                            Tea_html.class$prime("sub-section"),
                            /* [] */0
                          ], List.map((function (ss) {
                                  return view_section(module_name, ss);
                                }), section[/* sub_sections */3])),
                      /* [] */0
                    ]
                  ]
                ]
              ]);
  }
  
  function view_sections(module_item) {
    return List.map((function (s) {
                  return view_section(module_item[/* module_name */0], s);
                }), module_item[/* sections */2]);
  }
  
  function view_functor_table(functor_info, top_html) {
    if (functor_info[/* table */3].length !== 0) {
      return Pervasives.$at(top_html, /* :: */[
                  Tea_html.table(undefined, undefined, /* :: */[
                        Vdom.prop("innerHTML", functor_info[/* table */3]),
                        /* [] */0
                      ], /* [] */0),
                  /* [] */0
                ]);
    } else {
      return top_html;
    }
  }
  
  function view_module_info(module_info, top_html) {
    if (module_info.length !== 0) {
      return Pervasives.$at(top_html, /* :: */[
                  Tea_html.div(undefined, undefined, /* :: */[
                        Tea_html.class$prime("info"),
                        /* :: */[
                          Vdom.prop("innerHTML", module_info),
                          /* [] */0
                        ]
                      ], /* [] */0),
                  /* [] */0
                ]);
    } else {
      return top_html;
    }
  }
  
  function view_functor_sig(module_name, functor_info, top_html) {
    return Pervasives.$at(/* :: */[
                Tea_html.div(undefined, undefined, /* :: */[
                      Tea_html.id("functor-begin-sig"),
                      /* :: */[
                        Vdom.prop("innerHTML", functor_info[/* begin_sig */0]),
                        /* [] */0
                      ]
                    ], /* [] */0),
                /* :: */[
                  Tea_html.ul(undefined, undefined, /* :: */[
                        Tea_html.id("functor-elements"),
                        /* [] */0
                      ], view_elements(module_name, functor_info[/* functor_elements */1])),
                  /* :: */[
                    Tea_html.div(undefined, undefined, /* :: */[
                          Tea_html.id("functor-begin-sig"),
                          /* :: */[
                            Vdom.prop("innerHTML", functor_info[/* end_sig */2]),
                            /* [] */0
                          ]
                        ], /* [] */0),
                    /* [] */0
                  ]
                ]
              ], top_html);
  }
  
  function view_module_top(module_item) {
    var module_info = module_item[/* module_info */1];
    var match = module_item[/* functor_info */5];
    if (match !== undefined) {
      var functor_info = match;
      return view_functor_table(functor_info, view_module_info(module_info, view_functor_sig(module_item[/* module_name */0], functor_info, /* [] */0)));
    } else {
      return view_module_info(module_info, /* [] */0);
    }
  }
  
  function parse_module_name(module_item) {
    var match = module_item[/* functor_info */5];
    var is_functor = match !== undefined;
    var module_identifier = module_item[/* is_module_type */4] ? "Module Type: " : (
        is_functor ? "Functor: " : ""
      );
    return module_identifier + module_item[/* module_name */0];
  }
  
  function view_content(module_item) {
    return /* :: */[
            Tea_html.main(undefined, undefined, /* :: */[
                  Tea_html.id("module-content"),
                  /* :: */[
                    Tea_html.class$prime("content"),
                    /* [] */0
                  ]
                ], /* :: */[
                  Tea_html.h1(undefined, undefined, /* :: */[
                        Tea_html.class$prime("title"),
                        /* [] */0
                      ], /* :: */[
                        Tea_html.text(parse_module_name(module_item)),
                        /* [] */0
                      ]),
                  /* :: */[
                    Tea_html.div(undefined, undefined, /* :: */[
                          Tea_html.id("module-top"),
                          /* [] */0
                        ], view_module_top(module_item)),
                    /* :: */[
                      Tea_html.hr(undefined, undefined, /* [] */0, /* [] */0),
                      /* :: */[
                        Tea_html.section(undefined, undefined, /* :: */[
                              Tea_html.id("elements"),
                              /* [] */0
                            ], /* :: */[
                              Tea_html.ul(undefined, undefined, /* [] */0, view_sections(module_item)),
                              /* [] */0
                            ]),
                        /* [] */0
                      ]
                    ]
                  ]
                ]),
            /* [] */0
          ];
  }
  
  exports.innerHTML = innerHTML;
  exports.element_header_content = element_header_content;
  exports.view_element_header = view_element_header;
  exports.view_element_info = view_element_info;
  exports.view_element_type_table = view_element_type_table;
  exports.parse_exception = parse_exception;
  exports.parse_type_extra = parse_type_extra;
  exports.view_element = view_element;
  exports.view_elements = view_elements;
  exports.view_section_name = view_section_name;
  exports.view_section_info = view_section_info;
  exports.view_section = view_section;
  exports.view_sections = view_sections;
  exports.view_functor_table = view_functor_table;
  exports.view_module_info = view_module_info;
  exports.view_functor_sig = view_functor_sig;
  exports.view_module_top = view_module_top;
  exports.parse_module_name = parse_module_name;
  exports.view_content = view_content;
  /* Tea_html Not a pure module */
  