diff --git a/bsconfig.json b/bsconfig.json index 1c93e1b..5f2872f 100644 --- a/bsconfig.json +++ b/bsconfig.json @@ -1,6 +1,6 @@ { "name": "bucklescript-tea", - "version": "0.15.0", + "version": "0.15.0-schutm.4", "bsc-flags": ["-bs-cross-module-opt"], "package-specs": ["commonjs"], "sources": [ diff --git a/lib/js/src-ocaml/tea.js b/lib/js/src-ocaml/tea.js deleted file mode 100644 index 33adc84..0000000 --- a/lib/js/src-ocaml/tea.js +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -var Result = /* alias */0; - -var Cmd = /* alias */0; - -var Sub = /* alias */0; - -var App = /* alias */0; - -var Debug = /* alias */0; - -var Html = /* alias */0; - -var Html2 = /* alias */0; - -var Svg = /* alias */0; - -var Task = /* alias */0; - -var Program = /* alias */0; - -var Time = /* alias */0; - -var Json = /* alias */0; - -var Navigation = /* alias */0; - -var Random = /* alias */0; - -var AnimationFrame = /* alias */0; - -var Mouse = /* alias */0; - -var Http = /* alias */0; - -var Ex = /* alias */0; - -exports.Result = Result; -exports.Cmd = Cmd; -exports.Sub = Sub; -exports.App = App; -exports.Debug = Debug; -exports.Html = Html; -exports.Html2 = Html2; -exports.Svg = Svg; -exports.Task = Task; -exports.Program = Program; -exports.Time = Time; -exports.Json = Json; -exports.Navigation = Navigation; -exports.Random = Random; -exports.AnimationFrame = AnimationFrame; -exports.Mouse = Mouse; -exports.Http = Http; -exports.Ex = Ex; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_animationframe.js b/lib/js/src-ocaml/tea_animationframe.js deleted file mode 100644 index 2355e7f..0000000 --- a/lib/js/src-ocaml/tea_animationframe.js +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_sub = require("./tea_sub.js"); - -function every($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var enableCall = function (callbacks) { - var lastTime = { - contents: Date.now() - }; - var id = { - contents: undefined - }; - var onFrame = function (_time) { - var time = Date.now(); - var match = id.contents; - if (match !== undefined) { - var ret_delta = time < lastTime.contents ? 0.0 : time - lastTime.contents; - var ret = { - time: time, - delta: ret_delta - }; - lastTime.contents = time; - Curry._1(callbacks.enqueue, Curry._1(tagger, ret)); - var match$1 = id.contents; - if (match$1 !== undefined) { - id.contents = window.requestAnimationFrame(onFrame); - return /* () */0; - } else { - return /* () */0; - } - } else { - return /* () */0; - } - }; - id.contents = window.requestAnimationFrame(onFrame); - return (function (param) { - var match = id.contents; - if (match !== undefined) { - window.cancelAnimationFrame(match); - id.contents = undefined; - return /* () */0; - } else { - return /* () */0; - } - }); - }; - return Tea_sub.registration(key, enableCall); -} - -function times($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return every(undefined, (function (ev) { - return Curry._2(tagger, key, ev.time); - })); -} - -function diffs($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return every(undefined, (function (ev) { - return Curry._2(tagger, key, ev.delta); - })); -} - -exports.every = every; -exports.times = times; -exports.diffs = diffs; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_app.js b/lib/js/src-ocaml/tea_app.js deleted file mode 100644 index 3e21bb8..0000000 --- a/lib/js/src-ocaml/tea_app.js +++ /dev/null @@ -1,294 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Web = require("./web.js"); -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_cmd = require("./tea_cmd.js"); -var Tea_sub = require("./tea_sub.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function programStateWrapper(initModel, pump, shutdown) { - var model = { - contents: initModel - }; - var callbacks = { - contents: { - enqueue: (function (_msg) { - console.log("INVALID enqueue CALL!"); - return /* () */0; - }), - on: (function (param) { - return /* () */0; - }) - } - }; - var pumperInterface = Curry._1(pump, callbacks); - var pending = { - contents: undefined - }; - var handler = function (msg) { - var match = pending.contents; - if (match !== undefined) { - pending.contents = /* :: */[ - msg, - match - ]; - return /* () */0; - } else { - pending.contents = /* [] */0; - var newModel = Curry._2(pumperInterface.handleMsg, model.contents, msg); - model.contents = newModel; - var match$1 = pending.contents; - if (match$1 !== undefined) { - var msgs = match$1; - if (msgs) { - pending.contents = undefined; - return List.iter(handler, List.rev(msgs)); - } else { - pending.contents = undefined; - return /* () */0; - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "INVALID message queue state, should never be None during message processing!" - ]; - } - } - }; - var render_events = { - contents: /* [] */0 - }; - var finalizedCBs_enqueue = handler; - var finalizedCBs_on = function (param) { - if (typeof param === "number") { - return List.iter(handler, render_events.contents); - } else if (param.tag) { - var msg = param[0]; - render_events.contents = List.filter((function (mg) { - return msg !== mg; - }))(render_events.contents); - return /* () */0; - } else { - render_events.contents = List.append(render_events.contents, /* :: */[ - param[0], - /* [] */0 - ]); - return /* () */0; - } - }; - var finalizedCBs = { - enqueue: finalizedCBs_enqueue, - on: finalizedCBs_on - }; - callbacks.contents = finalizedCBs; - var pi_requestShutdown = function (param) { - callbacks.contents = { - enqueue: (function (_msg) { - console.log("INVALID message enqueued when shut down"); - return /* () */0; - }), - on: (function (param) { - return /* () */0; - }) - }; - var cmd = Curry._1(shutdown, model.contents); - Curry._1(pumperInterface.shutdown, cmd); - return /* () */0; - }; - var render_string = function (param) { - return Curry._1(pumperInterface.render_string, model.contents); - }; - Curry._1(pumperInterface.startup, /* () */0); - return { - pushMsg: handler, - shutdown: pi_requestShutdown, - getHtmlString: render_string - }; -} - -function programLoop(update, view, subscriptions, initModel, initCmd, param) { - if (param !== undefined) { - var parentNode = Caml_option.valFromOption(param); - return (function (callbacks) { - var priorRenderedVdom = { - contents: /* [] */0 - }; - var latestModel = { - contents: initModel - }; - var nextFrameID = { - contents: undefined - }; - var doRender = function (_delta) { - var match = nextFrameID.contents; - if (match !== undefined) { - var newVdom_000 = Curry._1(view, latestModel.contents); - var newVdom = /* :: */[ - newVdom_000, - /* [] */0 - ]; - var justRenderedVdom = Vdom.patchVNodesIntoElement(callbacks, parentNode, priorRenderedVdom.contents, newVdom); - priorRenderedVdom.contents = justRenderedVdom; - Curry._1(callbacks.contents.on, /* Render */0); - nextFrameID.contents = undefined; - return /* () */0; - } else { - return /* () */0; - } - }; - var scheduleRender = function (param) { - var match = nextFrameID.contents; - if (match !== undefined) { - return /* () */0; - } else { - var id = window.requestAnimationFrame(doRender); - nextFrameID.contents = id; - return /* () */0; - } - }; - var clearPnode = function (param) { - while(parentNode.childNodes.length > 0) { - var match = parentNode.firstChild; - if (match !== null) { - parentNode.removeChild(match); - } - - }; - return /* () */0; - }; - var oldSub = { - contents: /* NoSub */0 - }; - var handleSubscriptionChange = function (model) { - var newSub = Curry._1(subscriptions, model); - oldSub.contents = Tea_sub.run(callbacks, callbacks, oldSub.contents, newSub); - return /* () */0; - }; - var handlerStartup = function (param) { - clearPnode(/* () */0); - Tea_cmd.run(callbacks, initCmd); - handleSubscriptionChange(latestModel.contents); - nextFrameID.contents = -1; - doRender(16); - return /* () */0; - }; - var render_string = function (model) { - return Vdom.renderToHtmlString(Curry._1(view, model)); - }; - var handler = function (model, msg) { - var match = Curry._2(update, model, msg); - var newModel = match[0]; - latestModel.contents = newModel; - Tea_cmd.run(callbacks, match[1]); - scheduleRender(/* () */0); - handleSubscriptionChange(newModel); - return newModel; - }; - var handlerShutdown = function (cmd) { - nextFrameID.contents = undefined; - Tea_cmd.run(callbacks, cmd); - oldSub.contents = Tea_sub.run(callbacks, callbacks, oldSub.contents, /* NoSub */0); - priorRenderedVdom.contents = /* [] */0; - clearPnode(/* () */0); - return /* () */0; - }; - return { - startup: handlerStartup, - render_string: render_string, - handleMsg: handler, - shutdown: handlerShutdown - }; - }); - } else { - return (function (callbacks) { - var oldSub = { - contents: /* NoSub */0 - }; - var handleSubscriptionChange = function (model) { - var newSub = Curry._1(subscriptions, model); - oldSub.contents = Tea_sub.run(callbacks, callbacks, oldSub.contents, newSub); - return /* () */0; - }; - return { - startup: (function (param) { - Tea_cmd.run(callbacks, initCmd); - handleSubscriptionChange(initModel); - return /* () */0; - }), - render_string: (function (model) { - return Vdom.renderToHtmlString(Curry._1(view, model)); - }), - handleMsg: (function (model, msg) { - var match = Curry._2(update, model, msg); - var newModel = match[0]; - Tea_cmd.run(callbacks, match[1]); - handleSubscriptionChange(newModel); - return newModel; - }), - shutdown: (function (cmd) { - Tea_cmd.run(callbacks, cmd); - oldSub.contents = Tea_sub.run(callbacks, callbacks, oldSub.contents, /* NoSub */0); - return /* () */0; - }) - }; - }); - } -} - -function program(param, pnode, flags) { - Web.polyfills(/* () */0); - var match = Curry._1(param.init, flags); - var initModel = match[0]; - var opnode = (pnode == null) ? undefined : Caml_option.some(pnode); - var pumpInterface = programLoop(param.update, param.view, param.subscriptions, initModel, match[1], opnode); - return programStateWrapper(initModel, pumpInterface, param.shutdown); -} - -function standardProgram(param, pnode, args) { - return program({ - init: param.init, - update: param.update, - view: param.view, - subscriptions: param.subscriptions, - shutdown: (function (_model) { - return /* NoCmd */0; - }) - }, pnode, args); -} - -function beginnerProgram(param, pnode, param$1) { - var update = param.update; - var model = param.model; - return standardProgram({ - init: (function (param) { - return /* tuple */[ - model, - /* NoCmd */0 - ]; - }), - update: (function (model, msg) { - return /* tuple */[ - Curry._2(update, model, msg), - /* NoCmd */0 - ]; - }), - view: param.view, - subscriptions: (function (_model) { - return /* NoSub */0; - }) - }, pnode, /* () */0); -} - -var map = Vdom.map; - -exports.programStateWrapper = programStateWrapper; -exports.programLoop = programLoop; -exports.program = program; -exports.standardProgram = standardProgram; -exports.beginnerProgram = beginnerProgram; -exports.map = map; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_cmd.js b/lib/js/src-ocaml/tea_cmd.js deleted file mode 100644 index 32da92f..0000000 --- a/lib/js/src-ocaml/tea_cmd.js +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); - -function batch(cmds) { - return /* Batch */Block.__(1, [cmds]); -} - -function call(call$1) { - return /* EnqueueCall */Block.__(2, [call$1]); -} - -function fnMsg(fnMsg$1) { - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - return Curry._1(callbacks.contents.enqueue, Curry._1(fnMsg$1, /* () */0)); - })]); -} - -function msg(msg$1) { - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - return Curry._1(callbacks.contents.enqueue, msg$1); - })]); -} - -function run(_callbacks, _param) { - while(true) { - var param = _param; - var callbacks = _callbacks; - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* Mapper */0 : - var subCallbacks = Curry._1(param[0], callbacks); - _param = param[1]; - _callbacks = subCallbacks; - continue ; - case /* Batch */1 : - return List.fold_left((function(callbacks){ - return function (param, cmd) { - return run(callbacks, cmd); - } - }(callbacks)), /* () */0, param[0]); - case /* EnqueueCall */2 : - return Curry._1(param[0], callbacks); - - } - } - }; -} - -function map(func, cmd) { - var mapper = function (param) { - return Vdom.wrapCallbacks(func, param); - }; - return /* Mapper */Block.__(0, [ - mapper, - cmd - ]); -} - -var none = /* NoCmd */0; - -exports.none = none; -exports.batch = batch; -exports.call = call; -exports.fnMsg = fnMsg; -exports.msg = msg; -exports.run = run; -exports.map = map; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_debug.js b/lib/js/src-ocaml/tea_debug.js deleted file mode 100644 index 03e2221..0000000 --- a/lib/js/src-ocaml/tea_debug.js +++ /dev/null @@ -1,1005 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Printf = require("bs-platform/lib/js/printf.js"); -var $$String = require("bs-platform/lib/js/string.js"); -var Tea_app = require("./tea_app.js"); -var Tea_cmd = require("./tea_cmd.js"); -var Tea_sub = require("./tea_sub.js"); -var Tea_html2 = require("./tea_html2.js"); -var Tea_navigation = require("./tea_navigation.js"); - -function client_msg(msg) { - return /* ClientMsg */Block.__(0, [msg]); -} - -function debug(string_of_msg, update, view, subscriptions, shutdown) { - var init_debug = function (param) { - return /* tuple */[ - { - history: /* :: */[ - /* tuple */[ - "_init_", - param[0] - ], - /* [] */0 - ], - state: /* Running */0, - show_details: false - }, - Tea_cmd.map(client_msg, param[1]) - ]; - }; - var update$prime = function (model, param) { - if (typeof param === "number") { - if (param === /* TogglePaused */0) { - var match = model.state; - if (match) { - return /* tuple */[ - { - history: model.history, - state: /* Running */0, - show_details: model.show_details - }, - /* NoCmd */0 - ]; - } else { - return /* tuple */[ - { - history: model.history, - state: /* Paused */[0], - show_details: model.show_details - }, - /* NoCmd */0 - ]; - } - } else { - return /* tuple */[ - { - history: model.history, - state: model.state, - show_details: !model.show_details - }, - /* NoCmd */0 - ]; - } - } else if (param.tag) { - return /* tuple */[ - { - history: model.history, - state: /* Paused */[param[0]], - show_details: model.show_details - }, - /* NoCmd */0 - ]; - } else if (model.state === /* Running */0) { - var msg = param[0]; - var match$1 = List.hd(model.history); - var match$2 = Curry._2(update, match$1[1], msg); - var dmodel$prime_history = /* :: */[ - /* tuple */[ - Curry._1(string_of_msg, msg), - match$2[0] - ], - model.history - ]; - var dmodel$prime_state = model.state; - var dmodel$prime_show_details = model.show_details; - var dmodel$prime = { - history: dmodel$prime_history, - state: dmodel$prime_state, - show_details: dmodel$prime_show_details - }; - return /* tuple */[ - dmodel$prime, - Tea_cmd.map(client_msg, match$2[1]) - ]; - } else { - return /* tuple */[ - model, - /* NoCmd */0 - ]; - } - }; - var view_styles = function (param) { - var rule = function (selector, properties) { - return /* Text */Block.__(1, [Curry._2(Printf.sprintf(/* Format */[ - /* String */Block.__(2, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - " {", - /* String */Block.__(2, [ - /* No_padding */0, - /* Char_literal */Block.__(12, [ - /* "}" */125, - /* End_of_format */0 - ]) - ]) - ]) - ]), - "%s {%s}" - ]), selector, $$String.concat(";", List.map((function (param) { - return param[0] + (":" + param[1]); - }), properties)))]); - }; - return Tea_html2.node(undefined, "style", undefined, undefined, /* [] */0, /* :: */[ - rule("#debug.paused", /* :: */[ - /* tuple */[ - "position", - "fixed" - ], - /* :: */[ - /* tuple */[ - "top", - "0" - ], - /* :: */[ - /* tuple */[ - "left", - "0" - ], - /* :: */[ - /* tuple */[ - "width", - "100%" - ], - /* :: */[ - /* tuple */[ - "height", - "100%" - ], - /* :: */[ - /* tuple */[ - "pointer-events", - "all" - ], - /* :: */[ - /* tuple */[ - "background-color", - "rgba(0,0,0,.1)" - ], - /* :: */[ - /* tuple */[ - "box-shadow", - "inset 0 0 10px #333" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav", /* :: */[ - /* tuple */[ - "position", - "fixed" - ], - /* :: */[ - /* tuple */[ - "max-width", - "50%" - ], - /* :: */[ - /* tuple */[ - "bottom", - "0" - ], - /* :: */[ - /* tuple */[ - "right", - "6px" - ], - /* :: */[ - /* tuple */[ - "border-radius", - "4px 4px 0 0" - ], - /* :: */[ - /* tuple */[ - "background-color", - "#444" - ], - /* :: */[ - /* tuple */[ - "color", - "#fff" - ], - /* :: */[ - /* tuple */[ - "font-family", - "monospace" - ], - /* :: */[ - /* tuple */[ - "box-shadow", - "0 0 10px #333" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug.paused nav", /* :: */[ - /* tuple */[ - "height", - "50%" - ], - /* :: */[ - /* tuple */[ - "padding-bottom", - "2em" - ], - /* [] */0 - ] - ]), - /* :: */[ - rule("#debug nav .toggle", /* :: */[ - /* tuple */[ - "padding", - "6px" - ], - /* :: */[ - /* tuple */[ - "padding-left", - "9px" - ], - /* :: */[ - /* tuple */[ - "cursor", - "pointer" - ], - /* :: */[ - /* tuple */[ - "min-width", - "24ch" - ], - /* :: */[ - /* tuple */[ - "text-align", - "center" - ], - /* :: */[ - /* tuple */[ - "border-left", - "3px solid #333" - ], - /* :: */[ - /* tuple */[ - "border-radius", - "4px 4px 0 0" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .toggle:before", /* :: */[ - /* tuple */[ - "content", - "' '" - ], - /* :: */[ - /* tuple */[ - "position", - "absolute" - ], - /* :: */[ - /* tuple */[ - "left", - "0" - ], - /* :: */[ - /* tuple */[ - "top", - "0" - ], - /* :: */[ - /* tuple */[ - "width", - ".5ch" - ], - /* :: */[ - /* tuple */[ - "height", - "1.8ch" - ], - /* :: */[ - /* tuple */[ - "margin", - "1.2ch" - ], - /* :: */[ - /* tuple */[ - "border", - "solid #fff" - ], - /* :: */[ - /* tuple */[ - "border-width", - "0 .5ch" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug.paused nav .toggle:before", /* :: */[ - /* tuple */[ - "border-color", - "transparent" - ], - /* :: */[ - /* tuple */[ - "border-left-color", - "#fff" - ], - /* :: */[ - /* tuple */[ - "border-width", - "1ch" - ], - /* :: */[ - /* tuple */[ - "width", - "0" - ], - /* :: */[ - /* tuple */[ - "height", - "0" - ], - /* [] */0 - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .history", /* :: */[ - /* tuple */[ - "margin", - "0" - ], - /* :: */[ - /* tuple */[ - "padding", - "0" - ], - /* :: */[ - /* tuple */[ - "height", - "100%" - ], - /* :: */[ - /* tuple */[ - "overflow-y", - "auto" - ], - /* :: */[ - /* tuple */[ - "list-style", - "none" - ], - /* [] */0 - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .history li", /* :: */[ - /* tuple */[ - "margin", - "0" - ], - /* :: */[ - /* tuple */[ - "padding", - "0.2ch" - ], - /* :: */[ - /* tuple */[ - "border-left", - "3px solid #333" - ], - /* [] */0 - ] - ] - ]), - /* :: */[ - rule("#debug nav .history li.selected", /* :: */[ - /* tuple */[ - "background-color", - "#333" - ], - /* [] */0 - ]), - /* :: */[ - rule("#debug nav .history span.details", /* :: */[ - /* tuple */[ - "display", - "inline-block" - ], - /* :: */[ - /* tuple */[ - "cursor", - "pointer" - ], - /* :: */[ - /* tuple */[ - "width", - "1ch" - ], - /* :: */[ - /* tuple */[ - "margin", - "0 1ch" - ], - /* :: */[ - /* tuple */[ - "vertical-align", - "super" - ], - /* [] */0 - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .history li.selected span.details:after", /* :: */[ - /* tuple */[ - "content", - "'\\2026'" - ], - /* [] */0 - ]), - /* :: */[ - rule("#debug nav .history li.selected.show", /* :: */[ - /* tuple */[ - "border-left", - "3px solid white" - ], - /* [] */0 - ]), - /* :: */[ - rule("#debug nav .history span.message", /* :: */[ - /* tuple */[ - "display", - "inline-block" - ], - /* :: */[ - /* tuple */[ - "cursor", - "pointer" - ], - /* :: */[ - /* tuple */[ - "white-space", - "nowrap" - ], - /* :: */[ - /* tuple */[ - "overflow", - "hidden" - ], - /* :: */[ - /* tuple */[ - "text-overflow", - "ellipsis" - ], - /* :: */[ - /* tuple */[ - "width", - "calc(100% - 75px)" - ], - /* [] */0 - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .history span.index", /* :: */[ - /* tuple */[ - "display", - "inline-block" - ], - /* :: */[ - /* tuple */[ - "min-width", - "3ch" - ], - /* :: */[ - /* tuple */[ - "margin", - "0 1ch" - ], - /* :: */[ - /* tuple */[ - "color", - "#aaa" - ], - /* :: */[ - /* tuple */[ - "text-align", - "right" - ], - /* :: */[ - /* tuple */[ - "float", - "right" - ], - /* [] */0 - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug aside.details", /* :: */[ - /* tuple */[ - "position", - "absolute" - ], - /* :: */[ - /* tuple */[ - "width", - "40ch" - ], - /* :: */[ - /* tuple */[ - "top", - "0" - ], - /* :: */[ - /* tuple */[ - "bottom", - "0" - ], - /* :: */[ - /* tuple */[ - "right", - "100%" - ], - /* :: */[ - /* tuple */[ - "margin-right", - "1.5ch" - ], - /* :: */[ - /* tuple */[ - "overflow", - "scroll" - ], - /* :: */[ - /* tuple */[ - "background-color", - "#fff" - ], - /* :: */[ - /* tuple */[ - "color", - "#000" - ], - /* :: */[ - /* tuple */[ - "box-shadow", - "0 0 10px #333" - ], - /* :: */[ - /* tuple */[ - "border-radius", - "4px 4px 0 0" - ], - /* :: */[ - /* tuple */[ - "border", - "2px solid #333" - ], - /* :: */[ - /* tuple */[ - "padding", - "1ch" - ], - /* :: */[ - /* tuple */[ - "white-space", - "pre" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ]), - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ]); - }; - var view_details = function (model) { - var format = (function (v) { - var formatRecord = function (data, labels) { - return data.reduce( - function (acc, cur, index) { - acc[labels[index]] = formatValue(cur) - return acc - }, {}) - } - var listToArray = function (data) { - var result = [] - var cur = data - while (typeof cur !== "number") { - result.push(formatValue(cur[0])) - cur = cur[1] - } - return result - } - var formatVariant = function (data, recordVariant) { - if (recordVariant === "::") { - return listToArray(data) - } - else { - return formatRecord(data, [recordVariant]) - } - } - var formatValue = function (x) { - var recordLabels, recordVariant, recordModule, recordPolyVar - if (x == null) { - return null - } - else if ((recordLabels = x[Symbol.for('BsRecord')]) !== undefined) { - return formatRecord(x, recordLabels) - } - else if ((recordModule = x[Symbol.for('BsLocalModule')]) !== undefined) { - return formatRecord(x, recordModule) - } - else if ((recordVariant = x[Symbol.for('BsVariant')]) !== undefined) { - return formatVariant(x, recordVariant) - } - else if ((recordPolyVar = x[Symbol.for('BsPolyVar')]) !== undefined) { - return x[1] - } - else if (Array.isArray(x)) { - // tuple - return x.map(formatValue) - } - else { - // scalar - return x - } - } - return JSON.stringify(formatValue(v), null, 2); - }); - return Tea_html2.aside(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("details"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [format(model)]), - /* [] */0 - ]); - }; - var view_history = function (model, selected_index) { - var count = List.length(model.history); - return Tea_html2.ul(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("history"), - /* [] */0 - ], List.mapi((function (i, param) { - var selected = i === selected_index; - return Tea_html2.li(undefined, undefined, /* :: */[ - Tea_html2.Events.onClick(/* SelectHistoryItem */Block.__(1, [i])), - /* :: */[ - Tea_html2.Attributes.classList(/* :: */[ - /* tuple */[ - "selected", - selected - ], - /* :: */[ - /* tuple */[ - "show", - selected && model.show_details - ], - /* [] */0 - ] - ]), - /* [] */0 - ] - ], /* :: */[ - Tea_html2.span(undefined, undefined, /* :: */[ - Tea_html2.Attributes.classList(/* :: */[ - /* tuple */[ - "details", - true - ], - /* :: */[ - /* tuple */[ - "show", - true - ], - /* [] */0 - ] - ]), - selected ? /* :: */[ - Tea_html2.Events.onClick(/* ToggleDetails */1), - /* :: */[ - Tea_html2.Attributes.title("toggle details"), - /* [] */0 - ] - ] : /* :: */[ - Tea_html2.Attributes.noProp, - /* :: */[ - Tea_html2.Attributes.noProp, - /* [] */0 - ] - ] - ], /* :: */[ - selected && model.show_details ? view_details(param[1]) : Tea_html2.noNode, - /* [] */0 - ]), - /* :: */[ - Tea_html2.span(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("message"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [param[0]]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.span(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("index"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(count - i | 0)]), - /* [] */0 - ]), - /* [] */0 - ] - ] - ]); - }), model.history)); - }; - var view$prime = function (model) { - var match = model.state; - var match$1; - if (match) { - var index = match[0]; - match$1 = /* tuple */[ - index, - List.nth(model.history, index)[1], - true - ]; - } else { - match$1 = /* tuple */[ - 0, - List.hd(model.history)[1], - false - ]; - } - var paused = match$1[2]; - var history_count = List.length(model.history); - var vnode = Curry._1(view, match$1[1]); - return Tea_html2.div(undefined, undefined, /* [] */0, /* :: */[ - Vdom.map(client_msg, vnode), - /* :: */[ - Tea_html2.div(undefined, undefined, /* :: */[ - Tea_html2.Attributes.id("debug"), - /* :: */[ - Tea_html2.Attributes.classList(/* :: */[ - /* tuple */[ - "paused", - paused - ], - /* [] */0 - ]), - /* [] */0 - ] - ], /* :: */[ - view_styles(/* () */0), - /* :: */[ - Tea_html2.nav(undefined, undefined, /* [] */0, /* :: */[ - Tea_html2.div(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("toggle"), - /* :: */[ - Tea_html2.Events.onClick(/* TogglePaused */0), - /* :: */[ - paused ? Tea_html2.Attributes.title("click to resume") : Tea_html2.Attributes.title("click to pause"), - /* [] */0 - ] - ] - ], /* :: */[ - /* Text */Block.__(1, [Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */Block.__(11, [ - "Explore History (", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* Char_literal */Block.__(12, [ - /* ")" */41, - /* End_of_format */0 - ]) - ]) - ]), - "Explore History (%d)" - ]), history_count)]), - /* [] */0 - ]), - /* :: */[ - paused ? view_history(model, match$1[0]) : Tea_html2.noNode, - /* [] */0 - ] - ]), - /* [] */0 - ] - ]), - /* [] */0 - ] - ]); - }; - var subscriptions$prime = function (model) { - return Tea_sub.map(client_msg, Curry._1(subscriptions, List.hd(model.history)[1])); - }; - var shutdown$prime = function (model) { - return Tea_cmd.map(client_msg, Curry._1(shutdown, List.hd(model.history)[1])); - }; - return /* tuple */[ - init_debug, - update$prime, - view$prime, - subscriptions$prime, - shutdown$prime - ]; -} - -function debug_program(string_of_msg, param) { - var init = param.init; - var match = debug(string_of_msg, param.update, param.view, param.subscriptions, param.shutdown); - var init_debug = match[0]; - return { - init: (function (flags) { - return Curry._1(init_debug, Curry._1(init, flags)); - }), - update: match[1], - view: match[2], - subscriptions: match[3], - shutdown: match[4] - }; -} - -function debug_navigation_program(string_of_msg, param) { - var init = param.init; - var match = debug(string_of_msg, param.update, param.view, param.subscriptions, param.shutdown); - var init_debug = match[0]; - return { - init: (function (flags, $$location) { - return Curry._1(init_debug, Curry._2(init, flags, $$location)); - }), - update: match[1], - view: match[2], - subscriptions: match[3], - shutdown: match[4] - }; -} - -function beginnerProgram(param, string_of_msg, pnode, flags) { - var update = param.update; - var model = param.model; - var debugged = debug_program(string_of_msg, { - init: (function (param) { - return /* tuple */[ - model, - /* NoCmd */0 - ]; - }), - update: (function (model, msg) { - return /* tuple */[ - Curry._2(update, model, msg), - /* NoCmd */0 - ]; - }), - view: param.view, - subscriptions: (function (_model) { - return /* NoSub */0; - }), - shutdown: (function (_model) { - return /* NoCmd */0; - }) - }); - return Tea_app.program(debugged, pnode, flags); -} - -function standardProgram(param, string_of_msg, pnode, flags) { - var debugged = debug_program(string_of_msg, { - init: param.init, - update: param.update, - view: param.view, - subscriptions: param.subscriptions, - shutdown: (function (_model) { - return /* NoCmd */0; - }) - }); - return Tea_app.program(debugged, pnode, flags); -} - -function program(param, string_of_msg, pnode, flags) { - var debugged = debug_program(string_of_msg, { - init: param.init, - update: param.update, - view: param.view, - subscriptions: param.subscriptions, - shutdown: param.shutdown - }); - return Tea_app.program(debugged, pnode, flags); -} - -function navigationProgram(location_to_msg, param, string_of_msg, pnode, flags) { - var $$location = function ($$location$1) { - return /* ClientMsg */Block.__(0, [Curry._1(location_to_msg, $$location$1)]); - }; - var debugged = debug_navigation_program(string_of_msg, { - init: param.init, - update: param.update, - view: param.view, - subscriptions: param.subscriptions, - shutdown: param.shutdown - }); - return Tea_navigation.navigationProgram($$location, debugged)(pnode, flags); -} - -exports.client_msg = client_msg; -exports.debug = debug; -exports.debug_program = debug_program; -exports.debug_navigation_program = debug_navigation_program; -exports.beginnerProgram = beginnerProgram; -exports.standardProgram = standardProgram; -exports.program = program; -exports.navigationProgram = navigationProgram; -/* Tea_html2 Not a pure module */ diff --git a/lib/js/src-ocaml/tea_ex.js b/lib/js/src-ocaml/tea_ex.js deleted file mode 100644 index 1b09519..0000000 --- a/lib/js/src-ocaml/tea_ex.js +++ /dev/null @@ -1,115 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_sub = require("./tea_sub.js"); -var Tea_task = require("./tea_task.js"); -var Web_window_localstorage = require("./web_window_localstorage.js"); - -function render_event($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var enableCall = function (callbacks) { - Curry._1(callbacks.on, /* AddRenderMsg */Block.__(0, [msg])); - return (function (param) { - return Curry._1(callbacks.on, /* RemoveRenderMsg */Block.__(1, [msg])); - }); - }; - return Tea_sub.registration(key, enableCall); -} - -var length = /* Task */[(function (cb) { - var match = Web_window_localstorage.length(window); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; - -var clear = /* Task */[(function (cb) { - var match = Web_window_localstorage.clear(window); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; - -function clearCmd(param) { - return Tea_task.attemptOpt((function (param) { - return ; - }), clear); -} - -function key(idx) { - return /* Task */[(function (cb) { - var match = Web_window_localstorage.key(window, idx); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; -} - -function getItem(key) { - return /* Task */[(function (cb) { - var match = Web_window_localstorage.getItem(window, key); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; -} - -function removeItem(key) { - return /* Task */[(function (cb) { - var match = Web_window_localstorage.removeItem(window, key); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; -} - -function removeItemCmd(key) { - return Tea_task.attemptOpt((function (param) { - return ; - }), removeItem(key)); -} - -function setItem(key, value) { - return /* Task */[(function (cb) { - var match = Web_window_localstorage.setItem(window, key, value); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [/* () */0])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; -} - -function setItemCmd(key, value) { - return Tea_task.attemptOpt((function (param) { - return ; - }), setItem(key, value)); -} - -var LocalStorage = { - length: length, - clear: clear, - clearCmd: clearCmd, - key: key, - getItem: getItem, - removeItem: removeItem, - removeItemCmd: removeItemCmd, - setItem: setItem, - setItemCmd: setItemCmd -}; - -exports.render_event = render_event; -exports.LocalStorage = LocalStorage; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_html.js b/lib/js/src-ocaml/tea_html.js deleted file mode 100644 index 30942ec..0000000 --- a/lib/js/src-ocaml/tea_html.js +++ /dev/null @@ -1,1113 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var $$String = require("bs-platform/lib/js/string.js"); -var Tea_app = require("./tea_app.js"); -var Tea_json = require("./tea_json.js"); -var Tea_result = require("./tea_result.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function text(str) { - return /* Text */Block.__(1, [str]); -} - -var lazy1 = Vdom.lazyGen; - -function node($staropt$star, tagName, $staropt$star$1, $staropt$star$2, props, nodes) { - var namespace = $staropt$star !== undefined ? $staropt$star : ""; - var key = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - var unique = $staropt$star$2 !== undefined ? $staropt$star$2 : ""; - return Vdom.fullnode(namespace, tagName, key, unique, props, nodes); -} - -function br(props) { - return Vdom.fullnode("", "br", "br", "br", props, /* [] */0); -} - -function br$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "br", key, unique, props, nodes); -} - -function div($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "div", key, unique, props, nodes); -} - -function span($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "span", key, unique, props, nodes); -} - -function p($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "p", key, unique, props, nodes); -} - -function pre($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "pre", key, unique, props, nodes); -} - -function a($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "a", key, unique, props, nodes); -} - -function section($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "section", key, unique, props, nodes); -} - -function header($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "header", key, unique, props, nodes); -} - -function footer($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "footer", key, unique, props, nodes); -} - -function h1($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h1", key, unique, props, nodes); -} - -function h2($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h2", key, unique, props, nodes); -} - -function h3($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h3", key, unique, props, nodes); -} - -function h4($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h4", key, unique, props, nodes); -} - -function h5($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h5", key, unique, props, nodes); -} - -function h6($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h6", key, unique, props, nodes); -} - -function i($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "i", key, unique, props, nodes); -} - -function strong($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "strong", key, unique, props, nodes); -} - -function button($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "button", key, unique, props, nodes); -} - -function input$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "input", key, unique, props, nodes); -} - -function textarea($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "textarea", key, unique, props, nodes); -} - -function label($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "label", key, unique, props, nodes); -} - -function ul($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ul", key, unique, props, nodes); -} - -function ol($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ol", key, unique, props, nodes); -} - -function li($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "li", key, unique, props, nodes); -} - -function table($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "table", key, unique, props, nodes); -} - -function thead($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "thead", key, unique, props, nodes); -} - -function tfoot($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tfoot", key, unique, props, nodes); -} - -function tbody($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tbody", key, unique, props, nodes); -} - -function th($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "th", key, unique, props, nodes); -} - -function tr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tr", key, unique, props, nodes); -} - -function td($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "td", key, unique, props, nodes); -} - -function progress($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "progress", key, unique, props, nodes); -} - -function img($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "img", key, unique, props, nodes); -} - -function select($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "select", key, unique, props, nodes); -} - -function option$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "option", key, unique, props, nodes); -} - -function form($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "form", key, unique, props, nodes); -} - -function nav($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "nav", key, unique, props, nodes); -} - -function main($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "main", key, unique, props, nodes); -} - -function aside($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "aside", key, unique, props, nodes); -} - -function article($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "article", key, unique, props, nodes); -} - -function details($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "details", key, unique, props, nodes); -} - -function figcaption($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "figcaption", key, unique, props, nodes); -} - -function figure($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "figure", key, unique, props, nodes); -} - -function mark($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "mark", key, unique, props, nodes); -} - -function summary($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "summary", key, unique, props, nodes); -} - -function time($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "time", key, unique, props, nodes); -} - -function hr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "hr", key, unique, props, nodes); -} - -function blockquote($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "blockquote", key, unique, props, nodes); -} - -function code($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "code", key, unique, props, nodes); -} - -function em($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "em", key, unique, props, nodes); -} - -function b($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "b", key, unique, props, nodes); -} - -function u($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "u", key, unique, props, nodes); -} - -function sub($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "sub", key, unique, props, nodes); -} - -function sup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "sup", key, unique, props, nodes); -} - -function dl($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dl", key, unique, props, nodes); -} - -function dt($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dt", key, unique, props, nodes); -} - -function dd($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dd", key, unique, props, nodes); -} - -function iframe($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "iframe", key, unique, props, nodes); -} - -function canvas($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "canvas", key, unique, props, nodes); -} - -function address($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "address", key, unique, props, nodes); -} - -function caption($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "caption", key, unique, props, nodes); -} - -function colgroup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "colgroup", key, unique, props, nodes); -} - -function col($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "col", key, unique, props, nodes); -} - -function fieldset($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "fieldset", key, unique, props, nodes); -} - -function legend($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "legend", key, unique, props, nodes); -} - -function datalist($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "datalist", key, unique, props, nodes); -} - -function optgroup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "optgroup", key, unique, props, nodes); -} - -function output($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "output", key, unique, props, nodes); -} - -function meter($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "meter", key, unique, props, nodes); -} - -function audio($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "audio", key, unique, props, nodes); -} - -function video($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "video", key, unique, props, nodes); -} - -function source($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "source", key, unique, props, nodes); -} - -function track($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "track", key, unique, props, nodes); -} - -function embed($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "embed", key, unique, props, nodes); -} - -function object$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "object", key, unique, props, nodes); -} - -function param($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "param", key, unique, props, nodes); -} - -function ins($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ins", key, unique, props, nodes); -} - -function del($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "del", key, unique, props, nodes); -} - -function small($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "small", key, unique, props, nodes); -} - -function cite($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "cite", key, unique, props, nodes); -} - -function dfn($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dfn", key, unique, props, nodes); -} - -function abbr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "abbr", key, unique, props, nodes); -} - -function var$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "var", key, unique, props, nodes); -} - -function samp($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "samp", key, unique, props, nodes); -} - -function kbd($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "kbd", key, unique, props, nodes); -} - -function s($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "s", key, unique, props, nodes); -} - -function q($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "q", key, unique, props, nodes); -} - -function rt($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "rt", key, unique, props, nodes); -} - -function bdi($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "bdi", key, unique, props, nodes); -} - -function bdo($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "bdo", key, unique, props, nodes); -} - -function wbr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "wbr", key, unique, props, nodes); -} - -function menuitem($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "menuitem", key, unique, props, nodes); -} - -function menu($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "menu", key, unique, props, nodes); -} - -function id(str) { - return /* RawProp */Block.__(0, [ - "id", - str - ]); -} - -function href(str) { - return /* Attribute */Block.__(1, [ - "", - "href", - str - ]); -} - -function src(str) { - return /* Attribute */Block.__(1, [ - "", - "src", - str - ]); -} - -function title(str) { - return /* Attribute */Block.__(1, [ - "", - "title", - str - ]); -} - -function class$prime(name) { - return /* RawProp */Block.__(0, [ - "className", - name - ]); -} - -function classList(classes) { - var name = $$String.concat(" ", List.map((function (param) { - return param[0]; - }), List.filter((function (param) { - return param[1]; - }))(classes))); - return /* RawProp */Block.__(0, [ - "className", - name - ]); -} - -function type$prime(typ) { - return /* RawProp */Block.__(0, [ - "type", - typ - ]); -} - -var style = Vdom.style; - -function styles(s) { - return /* Style */Block.__(4, [s]); -} - -function placeholder(str) { - return /* RawProp */Block.__(0, [ - "placeholder", - str - ]); -} - -function autofocus(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "autofocus", - "autofocus" - ]); - } else { - return /* NoProp */0; - } -} - -function value(str) { - return /* RawProp */Block.__(0, [ - "value", - str - ]); -} - -function name(str) { - return /* RawProp */Block.__(0, [ - "name", - str - ]); -} - -function checked(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "checked", - "checked" - ]); - } else { - return /* NoProp */0; - } -} - -function for$prime(str) { - return /* RawProp */Block.__(0, [ - "htmlFor", - str - ]); -} - -function hidden(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "hidden", - "hidden" - ]); - } else { - return /* NoProp */0; - } -} - -function target(t) { - return /* RawProp */Block.__(0, [ - "target", - t - ]); -} - -function action(a) { - return /* RawProp */Block.__(0, [ - "action", - a - ]); -} - -function method$prime(m) { - return /* RawProp */Block.__(0, [ - "method", - m - ]); -} - -var onCB = Vdom.onCB; - -var onMsg = Vdom.onMsg; - -function onInputOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("input", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.value; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onInput($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onInputOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onChangeOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("change", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.value; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onChange($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onChangeOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onClick(msg) { - return Vdom.onMsg("click", msg); -} - -function onDoubleClick(msg) { - return Vdom.onMsg("dblclick", msg); -} - -function onBlur(msg) { - return Vdom.onMsg("blur", msg); -} - -function onFocus(msg) { - return Vdom.onMsg("focus", msg); -} - -function onCheckOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("change", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.checked; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onCheck($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onCheckOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onMouseDown(msg) { - return Vdom.onMsg("mousedown", msg); -} - -function onMouseUp(msg) { - return Vdom.onMsg("mouseup", msg); -} - -function onMouseEnter(msg) { - return Vdom.onMsg("mouseenter", msg); -} - -function onMouseLeave(msg) { - return Vdom.onMsg("mouseleave", msg); -} - -function onMouseOver(msg) { - return Vdom.onMsg("mouseover", msg); -} - -function onMouseOut(msg) { - return Vdom.onMsg("mouseout", msg); -} - -var defaultOptions = { - stopPropagation: false, - preventDefault: false -}; - -function onWithOptions(key, eventName, options, decoder) { - return Vdom.onCB(eventName, key, (function ($$event) { - if (options.stopPropagation) { - $$event.stopPropagation(); - } - if (options.preventDefault) { - $$event.preventDefault(); - } - return Tea_result.result_to_option(Tea_json.Decoder.decodeEvent(decoder, $$event)); - })); -} - -function on(key, eventName, decoder) { - return onWithOptions(key, eventName, defaultOptions, decoder); -} - -var targetValue = Tea_json.Decoder.at(/* :: */[ - "target", - /* :: */[ - "value", - /* [] */0 - ] - ], Tea_json.Decoder.string); - -var targetChecked = Tea_json.Decoder.at(/* :: */[ - "target", - /* :: */[ - "checked", - /* [] */0 - ] - ], Tea_json.Decoder.bool); - -var keyCode = Tea_json.Decoder.field("keyCode", Tea_json.Decoder.$$int); - -function max(value) { - return /* Attribute */Block.__(1, [ - "", - "max", - value - ]); -} - -function min(value) { - return /* Attribute */Block.__(1, [ - "", - "min", - value - ]); -} - -function step(value) { - return /* Attribute */Block.__(1, [ - "", - "step", - value - ]); -} - -function disabled(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "disabled", - "true" - ]); - } else { - return /* NoProp */0; - } -} - -function selected(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "selected", - "true" - ]); - } else { - return /* NoProp */0; - } -} - -function acceptCharset(c) { - return /* Attribute */Block.__(1, [ - "", - "accept-charset", - c - ]); -} - -function rel(value) { - return /* Attribute */Block.__(1, [ - "", - "rel", - value - ]); -} - -var Attributes = { - max: max, - min: min, - step: step, - disabled: disabled, - selected: selected, - acceptCharset: acceptCharset, - rel: rel -}; - -var Cmds = /* alias */0; - -var map = Tea_app.map; - -var noNode = Vdom.noNode; - -var noProp = /* NoProp */0; - -exports.Cmds = Cmds; -exports.map = map; -exports.noNode = noNode; -exports.text = text; -exports.lazy1 = lazy1; -exports.node = node; -exports.br = br; -exports.br$prime = br$prime; -exports.div = div; -exports.span = span; -exports.p = p; -exports.pre = pre; -exports.a = a; -exports.section = section; -exports.header = header; -exports.footer = footer; -exports.h1 = h1; -exports.h2 = h2; -exports.h3 = h3; -exports.h4 = h4; -exports.h5 = h5; -exports.h6 = h6; -exports.i = i; -exports.strong = strong; -exports.button = button; -exports.input$prime = input$prime; -exports.textarea = textarea; -exports.label = label; -exports.ul = ul; -exports.ol = ol; -exports.li = li; -exports.table = table; -exports.thead = thead; -exports.tfoot = tfoot; -exports.tbody = tbody; -exports.th = th; -exports.tr = tr; -exports.td = td; -exports.progress = progress; -exports.img = img; -exports.select = select; -exports.option$prime = option$prime; -exports.form = form; -exports.nav = nav; -exports.main = main; -exports.aside = aside; -exports.article = article; -exports.details = details; -exports.figcaption = figcaption; -exports.figure = figure; -exports.mark = mark; -exports.summary = summary; -exports.time = time; -exports.hr = hr; -exports.blockquote = blockquote; -exports.code = code; -exports.em = em; -exports.b = b; -exports.u = u; -exports.sub = sub; -exports.sup = sup; -exports.dl = dl; -exports.dt = dt; -exports.dd = dd; -exports.iframe = iframe; -exports.canvas = canvas; -exports.address = address; -exports.caption = caption; -exports.colgroup = colgroup; -exports.col = col; -exports.fieldset = fieldset; -exports.legend = legend; -exports.datalist = datalist; -exports.optgroup = optgroup; -exports.output = output; -exports.meter = meter; -exports.audio = audio; -exports.video = video; -exports.source = source; -exports.track = track; -exports.embed = embed; -exports.object$prime = object$prime; -exports.param = param; -exports.ins = ins; -exports.del = del; -exports.small = small; -exports.cite = cite; -exports.dfn = dfn; -exports.abbr = abbr; -exports.var$prime = var$prime; -exports.samp = samp; -exports.kbd = kbd; -exports.s = s; -exports.q = q; -exports.rt = rt; -exports.bdi = bdi; -exports.bdo = bdo; -exports.wbr = wbr; -exports.menuitem = menuitem; -exports.menu = menu; -exports.noProp = noProp; -exports.id = id; -exports.href = href; -exports.src = src; -exports.title = title; -exports.class$prime = class$prime; -exports.classList = classList; -exports.type$prime = type$prime; -exports.style = style; -exports.styles = styles; -exports.placeholder = placeholder; -exports.autofocus = autofocus; -exports.value = value; -exports.name = name; -exports.checked = checked; -exports.for$prime = for$prime; -exports.hidden = hidden; -exports.target = target; -exports.action = action; -exports.method$prime = method$prime; -exports.onCB = onCB; -exports.onMsg = onMsg; -exports.onInputOpt = onInputOpt; -exports.onInput = onInput; -exports.onChangeOpt = onChangeOpt; -exports.onChange = onChange; -exports.onClick = onClick; -exports.onDoubleClick = onDoubleClick; -exports.onBlur = onBlur; -exports.onFocus = onFocus; -exports.onCheckOpt = onCheckOpt; -exports.onCheck = onCheck; -exports.onMouseDown = onMouseDown; -exports.onMouseUp = onMouseUp; -exports.onMouseEnter = onMouseEnter; -exports.onMouseLeave = onMouseLeave; -exports.onMouseOver = onMouseOver; -exports.onMouseOut = onMouseOut; -exports.defaultOptions = defaultOptions; -exports.onWithOptions = onWithOptions; -exports.on = on; -exports.targetValue = targetValue; -exports.targetChecked = targetChecked; -exports.keyCode = keyCode; -exports.Attributes = Attributes; -/* targetValue Not a pure module */ diff --git a/lib/js/src-ocaml/tea_html2.js b/lib/js/src-ocaml/tea_html2.js deleted file mode 100644 index 4a875d9..0000000 --- a/lib/js/src-ocaml/tea_html2.js +++ /dev/null @@ -1,1820 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Bytes = require("bs-platform/lib/js/bytes.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var $$String = require("bs-platform/lib/js/string.js"); -var Tea_app = require("./tea_app.js"); -var Tea_html = require("./tea_html.js"); -var Tea_json = require("./tea_json.js"); -var Caml_bytes = require("bs-platform/lib/js/caml_bytes.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function text(str) { - return /* Text */Block.__(1, [str]); -} - -function node($staropt$star, tagName, $staropt$star$1, $staropt$star$2, props, nodes) { - var namespace = $staropt$star !== undefined ? $staropt$star : ""; - var key = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - var unique = $staropt$star$2 !== undefined ? $staropt$star$2 : ""; - return Vdom.fullnode(namespace, tagName, key, unique, props, nodes); -} - -var lazy1 = Vdom.lazyGen; - -function h1($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h1", key, unique, props, nodes); -} - -function h2($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h2", key, unique, props, nodes); -} - -function h3($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h3", key, unique, props, nodes); -} - -function h4($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h4", key, unique, props, nodes); -} - -function h5($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h5", key, unique, props, nodes); -} - -function h6($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h6", key, unique, props, nodes); -} - -function div($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "div", key, unique, props, nodes); -} - -function p($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "p", key, unique, props, nodes); -} - -function hr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "hr", key, unique, props, nodes); -} - -function pre($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "pre", key, unique, props, nodes); -} - -function blockquote($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "blockquote", key, unique, props, nodes); -} - -function span($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "span", key, unique, props, nodes); -} - -function a($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "a", key, unique, props, nodes); -} - -function code($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "code", key, unique, props, nodes); -} - -function em($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "em", key, unique, props, nodes); -} - -function strong($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "strong", key, unique, props, nodes); -} - -function i($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "i", key, unique, props, nodes); -} - -function b($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "b", key, unique, props, nodes); -} - -function u($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "u", key, unique, props, nodes); -} - -function sub($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "sub", key, unique, props, nodes); -} - -function sup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "sup", key, unique, props, nodes); -} - -function br(props) { - return Vdom.fullnode("", "br", "br", "br", props, /* [] */0); -} - -function br$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "br", key, unique, props, nodes); -} - -function ol($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ol", key, unique, props, nodes); -} - -function ul($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ul", key, unique, props, nodes); -} - -function li($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "li", key, unique, props, nodes); -} - -function dl($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dl", key, unique, props, nodes); -} - -function dt($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dt", key, unique, props, nodes); -} - -function dd($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dd", key, unique, props, nodes); -} - -function img($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "img", key, unique, props, nodes); -} - -function iframe($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "iframe", key, unique, props, nodes); -} - -function canvas($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "canvas", key, unique, props, nodes); -} - -function math($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "math", key, unique, props, nodes); -} - -function form($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "form", key, unique, props, nodes); -} - -function input$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "input", key, unique, props, nodes); -} - -function textarea($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "textarea", key, unique, props, nodes); -} - -function button($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "button", key, unique, props, nodes); -} - -function select($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "select", key, unique, props, nodes); -} - -function option$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "option", key, unique, props, nodes); -} - -function optgroup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "optgroup", key, unique, props, nodes); -} - -function label($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "label", key, unique, props, nodes); -} - -function fieldset($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "fieldset", key, unique, props, nodes); -} - -function legend($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "legend", key, unique, props, nodes); -} - -function section($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "section", key, unique, props, nodes); -} - -function nav($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "nav", key, unique, props, nodes); -} - -function article($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "article", key, unique, props, nodes); -} - -function aside($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "aside", key, unique, props, nodes); -} - -function header($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "header", key, unique, props, nodes); -} - -function footer($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "footer", key, unique, props, nodes); -} - -function address($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "address", key, unique, props, nodes); -} - -function main($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "main", key, unique, props, nodes); -} - -function body($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "body", key, unique, props, nodes); -} - -function figure($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "figure", key, unique, props, nodes); -} - -function figcaption($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "figcaption", key, unique, props, nodes); -} - -function table($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "table", key, unique, props, nodes); -} - -function caption($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "caption", key, unique, props, nodes); -} - -function colgroup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "colgroup", key, unique, props, nodes); -} - -function col($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "col", key, unique, props, nodes); -} - -function tbody($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tbody", key, unique, props, nodes); -} - -function thead($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "thead", key, unique, props, nodes); -} - -function tfoot($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tfoot", key, unique, props, nodes); -} - -function tr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tr", key, unique, props, nodes); -} - -function th($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "th", key, unique, props, nodes); -} - -function td($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "td", key, unique, props, nodes); -} - -function datalist($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "datalist", key, unique, props, nodes); -} - -function keygen($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "keygen", key, unique, props, nodes); -} - -function output($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "output", key, unique, props, nodes); -} - -function progress($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "progress", key, unique, props, nodes); -} - -function meter($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "meter", key, unique, props, nodes); -} - -function audio($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "audio", key, unique, props, nodes); -} - -function video($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "video", key, unique, props, nodes); -} - -function source($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "source", key, unique, props, nodes); -} - -function track($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "track", key, unique, props, nodes); -} - -function embed($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "embed", key, unique, props, nodes); -} - -function object$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "object", key, unique, props, nodes); -} - -function param($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "param", key, unique, props, nodes); -} - -function ins($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ins", key, unique, props, nodes); -} - -function del($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "del", key, unique, props, nodes); -} - -function small($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "small", key, unique, props, nodes); -} - -function cite($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "cite", key, unique, props, nodes); -} - -function dfn($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dfn", key, unique, props, nodes); -} - -function abbr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "abbr", key, unique, props, nodes); -} - -function time($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "time", key, unique, props, nodes); -} - -function var$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "var", key, unique, props, nodes); -} - -function samp($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "samp", key, unique, props, nodes); -} - -function kbd($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "kbd", key, unique, props, nodes); -} - -function s($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "s", key, unique, props, nodes); -} - -function q($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "q", key, unique, props, nodes); -} - -function mark($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "mark", key, unique, props, nodes); -} - -function ruby($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ruby", key, unique, props, nodes); -} - -function rt($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "rt", key, unique, props, nodes); -} - -function rp($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "rp", key, unique, props, nodes); -} - -function bdi($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "bdi", key, unique, props, nodes); -} - -function bdo($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "bdo", key, unique, props, nodes); -} - -function wbr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "wbr", key, unique, props, nodes); -} - -function details($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "details", key, unique, props, nodes); -} - -function summary($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "summary", key, unique, props, nodes); -} - -function menuitem($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "menuitem", key, unique, props, nodes); -} - -function menu($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "menu", key, unique, props, nodes); -} - -function meta($staropt$star, $staropt$star$1, props) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "meta", key, unique, props, /* [] */0); -} - -function style($staropt$star, $staropt$star$1, props, content) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "style", key, unique, props, /* :: */[ - /* Text */Block.__(1, [content]), - /* [] */0 - ]); -} - -function title($staropt$star, $staropt$star$1, props, content) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "title", key, unique, props, /* :: */[ - /* Text */Block.__(1, [content]), - /* [] */0 - ]); -} - -function link($staropt$star, $staropt$star$1, props) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "link", key, unique, props, /* [] */0); -} - -var style$1 = Vdom.style; - -function styles(s) { - return /* Style */Block.__(4, [s]); -} - -function class$prime(name) { - return /* RawProp */Block.__(0, [ - "className", - name - ]); -} - -function classList(classes) { - var name = $$String.concat(" ", List.map((function (param) { - return param[0]; - }), List.filter((function (param) { - return param[1]; - }))(classes))); - return /* RawProp */Block.__(0, [ - "className", - name - ]); -} - -function id(str) { - return /* RawProp */Block.__(0, [ - "id", - str - ]); -} - -function title$1(str) { - return /* Attribute */Block.__(1, [ - "", - "title", - str - ]); -} - -function hidden(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "hidden", - "hidden" - ]); - } else { - return /* NoProp */0; - } -} - -function type$prime(typ) { - return /* RawProp */Block.__(0, [ - "type", - typ - ]); -} - -function value(str) { - return /* RawProp */Block.__(0, [ - "value", - str - ]); -} - -function defaultValue(str) { - return /* RawProp */Block.__(0, [ - "defaultValue", - str - ]); -} - -function checked(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "checked", - "checked" - ]); - } else { - return /* NoProp */0; - } -} - -function placeholder(str) { - return /* RawProp */Block.__(0, [ - "placeholder", - str - ]); -} - -function selected(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "selected", - "true" - ]); - } else { - return /* NoProp */0; - } -} - -function accept(c) { - return /* Attribute */Block.__(1, [ - "", - "accept", - c - ]); -} - -function acceptCharset(c) { - return /* Attribute */Block.__(1, [ - "", - "accept-charset", - c - ]); -} - -function action(a) { - return /* RawProp */Block.__(0, [ - "action", - a - ]); -} - -function autocomplete(b) { - return /* RawProp */Block.__(0, [ - "autocomplete", - b ? "on" : "off" - ]); -} - -function autofocus(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "autofocus", - "autofocus" - ]); - } else { - return /* NoProp */0; - } -} - -function disabled(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "disabled", - "true" - ]); - } else { - return /* NoProp */0; - } -} - -function enctype(encoding) { - return /* Attribute */Block.__(1, [ - "", - "enctype", - encoding - ]); -} - -function formaction(url) { - return /* Attribute */Block.__(1, [ - "", - "formaction", - url - ]); -} - -function list(value) { - return /* Attribute */Block.__(1, [ - "", - "list", - value - ]); -} - -function minlength(n) { - return /* Attribute */Block.__(1, [ - "", - "minlength", - String(n) - ]); -} - -function maxlength(n) { - return /* Attribute */Block.__(1, [ - "", - "maxlength", - String(n) - ]); -} - -function method$prime(m) { - return /* RawProp */Block.__(0, [ - "method", - m - ]); -} - -function multiple(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "multiple", - "multiple" - ]); - } else { - return /* NoProp */0; - } -} - -function name(str) { - return /* RawProp */Block.__(0, [ - "name", - str - ]); -} - -function novalidate(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "novalidate", - "novalidate" - ]); - } else { - return /* NoProp */0; - } -} - -function pattern(p) { - return /* RawProp */Block.__(0, [ - "pattern", - p - ]); -} - -function readonly(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "readonly", - "readonly" - ]); - } else { - return /* NoProp */0; - } -} - -function required(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "required", - "required" - ]); - } else { - return /* NoProp */0; - } -} - -function size(n) { - return /* Attribute */Block.__(1, [ - "", - "size", - String(n) - ]); -} - -function for$prime(str) { - return /* RawProp */Block.__(0, [ - "htmlFor", - str - ]); -} - -function form$1(value) { - return /* Attribute */Block.__(1, [ - "", - "form", - value - ]); -} - -function max(value) { - return /* Attribute */Block.__(1, [ - "", - "max", - value - ]); -} - -function min(value) { - return /* Attribute */Block.__(1, [ - "", - "min", - value - ]); -} - -function step(value) { - return /* Attribute */Block.__(1, [ - "", - "step", - value - ]); -} - -function cols(n) { - return /* Attribute */Block.__(1, [ - "", - "cols", - String(n) - ]); -} - -function rows(n) { - return /* Attribute */Block.__(1, [ - "", - "rows", - String(n) - ]); -} - -function wrap(value) { - return /* RawProp */Block.__(0, [ - "wrap", - value - ]); -} - -function href(str) { - return /* Attribute */Block.__(1, [ - "", - "href", - str - ]); -} - -function target(t) { - return /* RawProp */Block.__(0, [ - "target", - t - ]); -} - -function download(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "download", - "" - ]); - } else { - return /* NoProp */0; - } -} - -function downloadAs(name) { - return /* RawProp */Block.__(0, [ - "download", - name - ]); -} - -function hreflang(code) { - return /* RawProp */Block.__(0, [ - "hreflang", - code - ]); -} - -function media(value) { - return /* Attribute */Block.__(1, [ - "", - "media", - value - ]); -} - -function ping(url) { - return /* RawProp */Block.__(0, [ - "ping", - url - ]); -} - -function rel(value) { - return /* Attribute */Block.__(1, [ - "", - "rel", - value - ]); -} - -function ismap(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "ismap", - "ismap" - ]); - } else { - return /* NoProp */0; - } -} - -function usemap(name) { - return /* RawProp */Block.__(0, [ - "usemap", - name - ]); -} - -function shape(value) { - return /* RawProp */Block.__(0, [ - "shape", - value - ]); -} - -function coords(value) { - return /* RawProp */Block.__(0, [ - "coords", - value - ]); -} - -function src(str) { - return /* Attribute */Block.__(1, [ - "", - "src", - str - ]); -} - -function height(n) { - return /* Attribute */Block.__(1, [ - "", - "height", - String(n) - ]); -} - -function width(n) { - return /* Attribute */Block.__(1, [ - "", - "width", - String(n) - ]); -} - -function alt(value) { - return /* RawProp */Block.__(0, [ - "alt", - value - ]); -} - -function autoplay(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "autoplay", - "autoplay" - ]); - } else { - return /* NoProp */0; - } -} - -function controls(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "controls", - "controls" - ]); - } else { - return /* NoProp */0; - } -} - -function loop(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "loop", - "loop" - ]); - } else { - return /* NoProp */0; - } -} - -function preload(value) { - return /* RawProp */Block.__(0, [ - "preload", - value - ]); -} - -function poster(url) { - return /* RawProp */Block.__(0, [ - "poster", - url - ]); -} - -function $$default(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "default", - "default" - ]); - } else { - return /* NoProp */0; - } -} - -function kind(value) { - return /* RawProp */Block.__(0, [ - "kind", - value - ]); -} - -function srclang(code) { - return /* RawProp */Block.__(0, [ - "srclang", - code - ]); -} - -function sandbox(value) { - return /* RawProp */Block.__(0, [ - "sandbox", - value - ]); -} - -function seamless(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "seamless", - "seamless" - ]); - } else { - return /* NoProp */0; - } -} - -function srcdoc(value) { - return /* RawProp */Block.__(0, [ - "srcdoc", - value - ]); -} - -function reversed(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "reversed", - "reversed" - ]); - } else { - return /* NoProp */0; - } -} - -function start(n) { - return /* RawProp */Block.__(0, [ - "start", - String(n) - ]); -} - -function colspan(n) { - return /* Attribute */Block.__(1, [ - "", - "colspan", - String(n) - ]); -} - -function rowspan(n) { - return /* Attribute */Block.__(1, [ - "", - "rowspan", - String(n) - ]); -} - -function headers(value) { - return /* RawProp */Block.__(0, [ - "headers", - value - ]); -} - -function scope(value) { - return /* RawProp */Block.__(0, [ - "scope", - value - ]); -} - -function align(value) { - return /* RawProp */Block.__(0, [ - "align", - value - ]); -} - -function async(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "async", - "async" - ]); - } else { - return /* NoProp */0; - } -} - -function charset(value) { - return /* Attribute */Block.__(1, [ - "", - "charset", - value - ]); -} - -function content(value) { - return /* Attribute */Block.__(1, [ - "", - "content", - value - ]); -} - -function defer(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "defer", - "defer" - ]); - } else { - return /* NoProp */0; - } -} - -function httpEquiv(value) { - return /* RawProp */Block.__(0, [ - "http-equiv", - value - ]); -} - -function language(value) { - return /* RawProp */Block.__(0, [ - "language", - value - ]); -} - -function scoped(value) { - return /* RawProp */Block.__(0, [ - "scoped", - value - ]); -} - -function accesskey(ch) { - return /* RawProp */Block.__(0, [ - "accesskey", - Caml_bytes.bytes_to_string(Bytes.make(1, ch)) - ]); -} - -function contenteditable(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "contenteditable", - "contenteditable" - ]); - } else { - return /* NoProp */0; - } -} - -function contextmenu(id) { - return /* Attribute */Block.__(1, [ - "", - "contextmenu", - id - ]); -} - -function dir(value) { - return /* RawProp */Block.__(0, [ - "dir", - value - ]); -} - -function draggable(value) { - return /* Attribute */Block.__(1, [ - "", - "draggable", - value - ]); -} - -function dropzone(value) { - return /* RawProp */Block.__(0, [ - "dropzone", - value - ]); -} - -function itemprop(value) { - return /* Attribute */Block.__(1, [ - "", - "itemprop", - value - ]); -} - -function lang(code) { - return /* RawProp */Block.__(0, [ - "lang", - code - ]); -} - -function spellcheck(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "spellcheck", - "spellcheck" - ]); - } else { - return /* NoProp */0; - } -} - -function tabindex(n) { - return /* Attribute */Block.__(1, [ - "", - "tabindex", - String(n) - ]); -} - -function challenge(value) { - return /* Attribute */Block.__(1, [ - "", - "challenge", - value - ]); -} - -function keytype(value) { - return /* RawProp */Block.__(0, [ - "keytype", - value - ]); -} - -function cite$1(url) { - return /* RawProp */Block.__(0, [ - "cite", - url - ]); -} - -function datetime(value) { - return /* Attribute */Block.__(1, [ - "", - "datetime", - value - ]); -} - -function pubdate(value) { - return /* Attribute */Block.__(1, [ - "", - "pubdate", - value - ]); -} - -function manifest(value) { - return /* Attribute */Block.__(1, [ - "", - "manifest", - value - ]); -} - -var Attributes = { - noProp: /* NoProp */0, - style: style$1, - styles: styles, - class$prime: class$prime, - classList: classList, - id: id, - title: title$1, - hidden: hidden, - type$prime: type$prime, - value: value, - defaultValue: defaultValue, - checked: checked, - placeholder: placeholder, - selected: selected, - accept: accept, - acceptCharset: acceptCharset, - action: action, - autocomplete: autocomplete, - autofocus: autofocus, - disabled: disabled, - enctype: enctype, - formaction: formaction, - list: list, - minlength: minlength, - maxlength: maxlength, - method$prime: method$prime, - multiple: multiple, - name: name, - novalidate: novalidate, - pattern: pattern, - readonly: readonly, - required: required, - size: size, - for$prime: for$prime, - form: form$1, - max: max, - min: min, - step: step, - cols: cols, - rows: rows, - wrap: wrap, - href: href, - target: target, - download: download, - downloadAs: downloadAs, - hreflang: hreflang, - media: media, - ping: ping, - rel: rel, - ismap: ismap, - usemap: usemap, - shape: shape, - coords: coords, - src: src, - height: height, - width: width, - alt: alt, - autoplay: autoplay, - controls: controls, - loop: loop, - preload: preload, - poster: poster, - $$default: $$default, - kind: kind, - srclang: srclang, - sandbox: sandbox, - seamless: seamless, - srcdoc: srcdoc, - reversed: reversed, - start: start, - colspan: colspan, - rowspan: rowspan, - headers: headers, - scope: scope, - align: align, - async: async, - charset: charset, - content: content, - defer: defer, - httpEquiv: httpEquiv, - language: language, - scoped: scoped, - accesskey: accesskey, - contenteditable: contenteditable, - contextmenu: contextmenu, - dir: dir, - draggable: draggable, - dropzone: dropzone, - itemprop: itemprop, - lang: lang, - spellcheck: spellcheck, - tabindex: tabindex, - challenge: challenge, - keytype: keytype, - cite: cite$1, - datetime: datetime, - pubdate: pubdate, - manifest: manifest -}; - -var onCB = Vdom.onCB; - -var onMsg = Vdom.onMsg; - -function preventDefaultOn($staropt$star, eventName, decoder) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Tea_html.onWithOptions(key, eventName, { - stopPropagation: Tea_html.defaultOptions.stopPropagation, - preventDefault: true - }, decoder); -} - -function onClick(msg) { - return Vdom.onMsg("click", msg); -} - -function onDoubleClick(msg) { - return Vdom.onMsg("dblclick", msg); -} - -function onMouseDown(msg) { - return Vdom.onMsg("mousedown", msg); -} - -function onMouseUp(msg) { - return Vdom.onMsg("mouseup", msg); -} - -function onMouseEnter(msg) { - return Vdom.onMsg("mouseenter", msg); -} - -function onMouseLeave(msg) { - return Vdom.onMsg("mouseleave", msg); -} - -function onMouseOver(msg) { - return Vdom.onMsg("mouseover", msg); -} - -function onMouseOut(msg) { - return Vdom.onMsg("mouseout", msg); -} - -function onInputOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("input", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.value; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onInput($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onInputOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onCheckOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("change", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.checked; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onCheck($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onCheckOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onChangeOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("change", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.value; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onChange($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onChangeOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onSubmit(msg) { - return preventDefaultOn(undefined, "submit", Tea_json.Decoder.succeed(msg)); -} - -function onBlur(msg) { - return Vdom.onMsg("blur", msg); -} - -function onFocus(msg) { - return Vdom.onMsg("focus", msg); -} - -var Events = { - onCB: onCB, - onMsg: onMsg, - on: Tea_html.on, - onWithOptions: Tea_html.onWithOptions, - defaultOptions: Tea_html.defaultOptions, - targetValue: Tea_html.targetValue, - targetChecked: Tea_html.targetChecked, - keyCode: Tea_html.keyCode, - preventDefaultOn: preventDefaultOn, - onClick: onClick, - onDoubleClick: onDoubleClick, - onMouseDown: onMouseDown, - onMouseUp: onMouseUp, - onMouseEnter: onMouseEnter, - onMouseLeave: onMouseLeave, - onMouseOver: onMouseOver, - onMouseOut: onMouseOut, - onInputOpt: onInputOpt, - onInput: onInput, - onCheckOpt: onCheckOpt, - onCheck: onCheck, - onChangeOpt: onChangeOpt, - onChange: onChange, - onSubmit: onSubmit, - onBlur: onBlur, - onFocus: onFocus -}; - -var Cmds = /* alias */0; - -var map = Tea_app.map; - -var noNode = Vdom.noNode; - -exports.Cmds = Cmds; -exports.map = map; -exports.text = text; -exports.node = node; -exports.noNode = noNode; -exports.lazy1 = lazy1; -exports.h1 = h1; -exports.h2 = h2; -exports.h3 = h3; -exports.h4 = h4; -exports.h5 = h5; -exports.h6 = h6; -exports.div = div; -exports.p = p; -exports.hr = hr; -exports.pre = pre; -exports.blockquote = blockquote; -exports.span = span; -exports.a = a; -exports.code = code; -exports.em = em; -exports.strong = strong; -exports.i = i; -exports.b = b; -exports.u = u; -exports.sub = sub; -exports.sup = sup; -exports.br = br; -exports.br$prime = br$prime; -exports.ol = ol; -exports.ul = ul; -exports.li = li; -exports.dl = dl; -exports.dt = dt; -exports.dd = dd; -exports.img = img; -exports.iframe = iframe; -exports.canvas = canvas; -exports.math = math; -exports.form = form; -exports.input$prime = input$prime; -exports.textarea = textarea; -exports.button = button; -exports.select = select; -exports.option$prime = option$prime; -exports.optgroup = optgroup; -exports.label = label; -exports.fieldset = fieldset; -exports.legend = legend; -exports.section = section; -exports.nav = nav; -exports.article = article; -exports.aside = aside; -exports.header = header; -exports.footer = footer; -exports.address = address; -exports.main = main; -exports.body = body; -exports.figure = figure; -exports.figcaption = figcaption; -exports.table = table; -exports.caption = caption; -exports.colgroup = colgroup; -exports.col = col; -exports.tbody = tbody; -exports.thead = thead; -exports.tfoot = tfoot; -exports.tr = tr; -exports.th = th; -exports.td = td; -exports.datalist = datalist; -exports.keygen = keygen; -exports.output = output; -exports.progress = progress; -exports.meter = meter; -exports.audio = audio; -exports.video = video; -exports.source = source; -exports.track = track; -exports.embed = embed; -exports.object$prime = object$prime; -exports.param = param; -exports.ins = ins; -exports.del = del; -exports.small = small; -exports.cite = cite; -exports.dfn = dfn; -exports.abbr = abbr; -exports.time = time; -exports.var$prime = var$prime; -exports.samp = samp; -exports.kbd = kbd; -exports.s = s; -exports.q = q; -exports.mark = mark; -exports.ruby = ruby; -exports.rt = rt; -exports.rp = rp; -exports.bdi = bdi; -exports.bdo = bdo; -exports.wbr = wbr; -exports.details = details; -exports.summary = summary; -exports.menuitem = menuitem; -exports.menu = menu; -exports.meta = meta; -exports.style = style; -exports.title = title; -exports.link = link; -exports.Attributes = Attributes; -exports.Events = Events; -/* Tea_html Not a pure module */ diff --git a/lib/js/src-ocaml/tea_html_cmds.js b/lib/js/src-ocaml/tea_html_cmds.js deleted file mode 100644 index d395c2b..0000000 --- a/lib/js/src-ocaml/tea_html_cmds.js +++ /dev/null @@ -1,30 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); - -function focus(id) { - return /* EnqueueCall */Block.__(2, [(function (_enqueue) { - var ecb = function (param) { - var match = document.getElementById(id); - if (match == null) { - console.log(/* tuple */[ - "Attempted to focus a non-existant element of: ", - id - ]); - return /* () */0; - } else { - return match.focus(); - } - }; - var cb = function (param) { - window.requestAnimationFrame(ecb); - return /* () */0; - }; - window.requestAnimationFrame(cb); - return /* () */0; - })]); -} - -exports.focus = focus; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_http.js b/lib/js/src-ocaml/tea_http.js deleted file mode 100644 index 652fb76..0000000 --- a/lib/js/src-ocaml/tea_http.js +++ /dev/null @@ -1,1497 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_json = require("./tea_json.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); -var Web_xmlhttprequest = require("./web_xmlhttprequest.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function string_of_error(param) { - if (typeof param === "number") { - switch (param) { - case /* Timeout */0 : - return "Timeout"; - case /* NetworkError */1 : - return "Unknown network error"; - case /* Aborted */2 : - return "Request aborted"; - - } - } else { - switch (param.tag | 0) { - case /* BadUrl */0 : - return "Bad Url: " + param[0]; - case /* BadStatus */1 : - return "Bad Status: " + param[0].url; - case /* BadPayload */2 : - return "Bad Payload: " + param[1].url; - - } - } -} - -var emptyRequestEvents = { - onreadystatechange: undefined, - onprogress: undefined -}; - -function expectStringResponse(func) { - return /* Expect */[ - /* TextResponseType */5, - (function (param) { - var body = param.body; - if (typeof body === "number" || body.tag !== /* TextResponse */5) { - return /* Error */Block.__(1, ["Non-text response returned"]); - } else { - return Curry._1(func, body[0]); - } - }) - ]; -} - -var expectString = expectStringResponse((function (resString) { - return /* Ok */Block.__(0, [resString]); - })); - -function request(rawRequest) { - return /* Request */[ - rawRequest, - undefined - ]; -} - -function getString(url) { - return /* Request */[ - { - "method'": "GET", - headers: /* [] */0, - url: url, - body: /* EmptyBody */0, - expect: expectString, - timeout: undefined, - withCredentials: false - }, - undefined - ]; -} - -function toTask(param) { - var request = param[0]; - var height = function (param) { - if (param) { - return param[/* h */4]; - } else { - return 0; - } - }; - var create = function (l, x, d, r) { - var hl = height(l); - var hr = height(r); - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - }; - var singleton = function (x, d) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */d, - /* r : Empty */0, - /* h */1 - ]; - }; - var bal = function (l, x, d, r) { - var hl = l ? l[/* h */4] : 0; - var hr = r ? r[/* h */4] : 0; - if (hl > (hr + 2 | 0)) { - if (l) { - var lr = l[/* r */3]; - var ld = l[/* d */2]; - var lv = l[/* v */1]; - var ll = l[/* l */0]; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } else if (lr) { - return create(create(ll, lv, ld, lr[/* l */0]), lr[/* v */1], lr[/* d */2], create(lr[/* r */3], x, d, r)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else if (hr > (hl + 2 | 0)) { - if (r) { - var rr = r[/* r */3]; - var rd = r[/* d */2]; - var rv = r[/* v */1]; - var rl = r[/* l */0]; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } else if (rl) { - return create(create(l, x, d, rl[/* l */0]), rl[/* v */1], rl[/* d */2], create(rl[/* r */3], rv, rd, rr)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - } - }; - var add = function (x, data, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = add(x, data, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */data, - /* r : Empty */0, - /* h */1 - ]; - } - }; - var min_binding = function (_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; - }; - var remove_min_binding = function (param) { - if (param) { - var l = param[/* l */0]; - if (l) { - return bal(remove_min_binding(l), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return param[/* r */3]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.remove_min_elt" - ]; - } - }; - var merge = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var remove = function (x, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return merge(l, r); - } else if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = remove(x, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Empty */0; - } - }; - var update = function (x, f, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - var match = Curry._1(f, Caml_option.some(d)); - if (match !== undefined) { - var data = Caml_option.valFromOption(match); - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else { - return merge(l, r); - } - } else if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = update(x, f, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - var match$1 = Curry._1(f, undefined); - if (match$1 !== undefined) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */Caml_option.valFromOption(match$1), - /* r : Empty */0, - /* h */1 - ]; - } else { - return /* Empty */0; - } - } - }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (param) { - iter(f, param[/* l */0]); - Curry._2(f, param[/* v */1], param[/* d */2]); - _param = param[/* r */3]; - continue ; - } else { - return /* () */0; - } - }; - }; - var map = function (f, param) { - if (param) { - var l$prime = map(f, param[/* l */0]); - var d$prime = Curry._1(f, param[/* d */2]); - var r$prime = map(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */param[/* v */1], - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var mapi = function (f, param) { - if (param) { - var v = param[/* v */1]; - var l$prime = mapi(f, param[/* l */0]); - var d$prime = Curry._2(f, v, param[/* d */2]); - var r$prime = mapi(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */v, - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var fold = function (f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (m) { - _accu = Curry._3(f, m[/* v */1], m[/* d */2], fold(f, m[/* l */0], accu)); - _m = m[/* r */3]; - continue ; - } else { - return accu; - } - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) && for_all(p, param[/* l */0])) { - _param = param[/* r */3]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; - }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) || exists(p, param[/* l */0])) { - return true; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return false; - } - }; - }; - var add_min_binding = function (k, x, param) { - if (param) { - return bal(add_min_binding(k, x, param[/* l */0]), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return singleton(k, x); - } - }; - var add_max_binding = function (k, x, param) { - if (param) { - return bal(param[/* l */0], param[/* v */1], param[/* d */2], add_max_binding(k, x, param[/* r */3])); - } else { - return singleton(k, x); - } - }; - var join = function (l, v, d, r) { - if (l) { - if (r) { - var rh = r[/* h */4]; - var lh = l[/* h */4]; - if (lh > (rh + 2 | 0)) { - return bal(l[/* l */0], l[/* v */1], l[/* d */2], join(l[/* r */3], v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r[/* l */0]), r[/* v */1], r[/* d */2], r[/* r */3]); - } else { - return create(l, v, d, r); - } - } else { - return add_max_binding(v, d, l); - } - } else { - return add_min_binding(v, d, r); - } - }; - var concat = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var concat_or_join = function (t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); - } - }; - var split = function (x, param) { - if (param) { - var r = param[/* r */3]; - var d = param[/* d */2]; - var v = param[/* v */1]; - var l = param[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return /* tuple */[ - l, - Caml_option.some(d), - r - ]; - } else if (c < 0) { - var match = split(x, l); - return /* tuple */[ - match[0], - match[1], - join(match[2], v, d, r) - ]; - } else { - var match$1 = split(x, r); - return /* tuple */[ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - undefined, - /* Empty */0 - ]; - } - }; - var merge$1 = function (f, s1, s2) { - if (s1) { - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1[/* l */0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[/* d */2]), match[1]), merge$1(f, s1[/* r */3], match[2])); - } - - } else if (!s2) { - return /* Empty */0; - } - if (s2) { - var v2 = s2[/* v */1]; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2[/* l */0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[/* d */2])), merge$1(f, match$1[2], s2[/* r */3])); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "map.ml", - 393, - 10 - ] - ]; - } - }; - var union = function (f, s1, s2) { - if (s1) { - if (s2) { - var d2 = s2[/* d */2]; - var v2 = s2[/* v */1]; - var d1 = s1[/* d */2]; - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= s2[/* h */4]) { - var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1[/* l */0], match[0]); - var r = union(f, s1[/* r */3], match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } - } else { - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2[/* l */0]); - var r$1 = union(f, match$1[2], s2[/* r */3]); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); - } else { - return join(l$1, v2, d2, r$1); - } - } - } else { - return s1; - } - } else { - return s2; - } - }; - var filter = function (p, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var l$prime = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$prime = filter(p, r); - if (pvd) { - if (l === l$prime && r === r$prime) { - return m; - } else { - return join(l$prime, v, d, r$prime); - } - } else { - return concat(l$prime, r$prime); - } - } else { - return /* Empty */0; - } - }; - var partition = function (p, param) { - if (param) { - var d = param[/* d */2]; - var v = param[/* v */1]; - var match = partition(p, param[/* l */0]); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param[/* r */3]); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return /* tuple */[ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return /* tuple */[ - concat(lt, rt), - join(lf, v, d, rf) - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - /* Empty */0 - ]; - } - }; - var cardinal = function (param) { - if (param) { - return (cardinal(param[/* l */0]) + 1 | 0) + cardinal(param[/* r */3]) | 0; - } else { - return 0; - } - }; - var bindings_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[/* l */0]; - _accu = /* :: */[ - /* tuple */[ - param[/* v */1], - param[/* d */2] - ], - bindings_aux(accu, param[/* r */3]) - ]; - continue ; - } else { - return accu; - } - }; - }; - var expect = request.expect; - var responseToResult = expect[1]; - var typ = expect[0]; - var withCredentials = request.withCredentials; - var timeout = request.timeout; - var body = request.body; - var url = request.url; - var headers = request.headers; - var method$prime = request["method'"]; - return /* Task */[(function (cb) { - var enqResError = function (result) { - var partial_arg = /* Error */Block.__(1, [result]); - return (function (param) { - return Curry._1(cb, partial_arg); - }); - }; - var enqResOk = function (result) { - var partial_arg = /* Ok */Block.__(0, [result]); - return (function (param) { - return Curry._1(cb, partial_arg); - }); - }; - var xhr = new XMLHttpRequest(); - var partial_arg = /* Error */Block.__(1, [/* NetworkError */1]); - var cb$1 = function (param) { - return Curry._1(cb, partial_arg); - }; - xhr.onerror = cb$1; - var partial_arg$1 = /* Error */Block.__(1, [/* Timeout */0]); - var cb$2 = function (param) { - return Curry._1(cb, partial_arg$1); - }; - xhr.ontimeout = cb$2; - var partial_arg$2 = /* Error */Block.__(1, [/* Aborted */2]); - var cb$3 = function (param) { - return Curry._1(cb, partial_arg$2); - }; - xhr.onabort = cb$3; - var cb$4 = function (_ev) { - var match = Web_xmlhttprequest.getAllResponseHeadersAsDict(xhr); - var headers; - headers = match.tag ? /* Empty */0 : match[0]; - var response_url = xhr.responseURL; - var response_status = { - code: xhr.status, - message: xhr.statusText - }; - var response_body = Web_xmlhttprequest.get_response(xhr); - var response = { - url: response_url, - status: response_status, - headers: headers, - body: response_body - }; - if (response_status.code < 200 || 300 <= response_status.code) { - return enqResError(/* BadStatus */Block.__(1, [response]))(/* () */0); - } else { - var match$1 = Curry._1(responseToResult, response); - if (match$1.tag) { - return enqResError(/* BadPayload */Block.__(2, [ - match$1[0], - response - ]))(/* () */0); - } else { - return enqResOk(match$1[0])(/* () */0); - } - } - }; - xhr.onload = cb$4; - try { - Web_xmlhttprequest.open_(method$prime, url, undefined, undefined, undefined, xhr); - } - catch (exn){ - enqResError(/* BadUrl */Block.__(0, [url]))(/* () */0); - } - var setHeader = function (param) { - return Web_xmlhttprequest.setRequestHeader(param[0], param[1], xhr); - }; - List.iter(setHeader, headers); - Web_xmlhttprequest.set_responseType(typ, xhr); - if (timeout !== undefined) { - xhr.timeout = timeout; - } - xhr.withCredentials = withCredentials; - Web_xmlhttprequest.send(body, xhr); - return /* () */0; - })]; -} - -function send(resultToMessage, param) { - var maybeEvents = param[1]; - var request = param[0]; - var height = function (param) { - if (param) { - return param[/* h */4]; - } else { - return 0; - } - }; - var create = function (l, x, d, r) { - var hl = height(l); - var hr = height(r); - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - }; - var singleton = function (x, d) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */d, - /* r : Empty */0, - /* h */1 - ]; - }; - var bal = function (l, x, d, r) { - var hl = l ? l[/* h */4] : 0; - var hr = r ? r[/* h */4] : 0; - if (hl > (hr + 2 | 0)) { - if (l) { - var lr = l[/* r */3]; - var ld = l[/* d */2]; - var lv = l[/* v */1]; - var ll = l[/* l */0]; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } else if (lr) { - return create(create(ll, lv, ld, lr[/* l */0]), lr[/* v */1], lr[/* d */2], create(lr[/* r */3], x, d, r)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else if (hr > (hl + 2 | 0)) { - if (r) { - var rr = r[/* r */3]; - var rd = r[/* d */2]; - var rv = r[/* v */1]; - var rl = r[/* l */0]; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } else if (rl) { - return create(create(l, x, d, rl[/* l */0]), rl[/* v */1], rl[/* d */2], create(rl[/* r */3], rv, rd, rr)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - } - }; - var add = function (x, data, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = add(x, data, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */data, - /* r : Empty */0, - /* h */1 - ]; - } - }; - var min_binding = function (_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; - }; - var remove_min_binding = function (param) { - if (param) { - var l = param[/* l */0]; - if (l) { - return bal(remove_min_binding(l), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return param[/* r */3]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.remove_min_elt" - ]; - } - }; - var merge = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var remove = function (x, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return merge(l, r); - } else if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = remove(x, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Empty */0; - } - }; - var update = function (x, f, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - var match = Curry._1(f, Caml_option.some(d)); - if (match !== undefined) { - var data = Caml_option.valFromOption(match); - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else { - return merge(l, r); - } - } else if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = update(x, f, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - var match$1 = Curry._1(f, undefined); - if (match$1 !== undefined) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */Caml_option.valFromOption(match$1), - /* r : Empty */0, - /* h */1 - ]; - } else { - return /* Empty */0; - } - } - }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (param) { - iter(f, param[/* l */0]); - Curry._2(f, param[/* v */1], param[/* d */2]); - _param = param[/* r */3]; - continue ; - } else { - return /* () */0; - } - }; - }; - var map = function (f, param) { - if (param) { - var l$prime = map(f, param[/* l */0]); - var d$prime = Curry._1(f, param[/* d */2]); - var r$prime = map(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */param[/* v */1], - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var mapi = function (f, param) { - if (param) { - var v = param[/* v */1]; - var l$prime = mapi(f, param[/* l */0]); - var d$prime = Curry._2(f, v, param[/* d */2]); - var r$prime = mapi(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */v, - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var fold = function (f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (m) { - _accu = Curry._3(f, m[/* v */1], m[/* d */2], fold(f, m[/* l */0], accu)); - _m = m[/* r */3]; - continue ; - } else { - return accu; - } - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) && for_all(p, param[/* l */0])) { - _param = param[/* r */3]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; - }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) || exists(p, param[/* l */0])) { - return true; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return false; - } - }; - }; - var add_min_binding = function (k, x, param) { - if (param) { - return bal(add_min_binding(k, x, param[/* l */0]), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return singleton(k, x); - } - }; - var add_max_binding = function (k, x, param) { - if (param) { - return bal(param[/* l */0], param[/* v */1], param[/* d */2], add_max_binding(k, x, param[/* r */3])); - } else { - return singleton(k, x); - } - }; - var join = function (l, v, d, r) { - if (l) { - if (r) { - var rh = r[/* h */4]; - var lh = l[/* h */4]; - if (lh > (rh + 2 | 0)) { - return bal(l[/* l */0], l[/* v */1], l[/* d */2], join(l[/* r */3], v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r[/* l */0]), r[/* v */1], r[/* d */2], r[/* r */3]); - } else { - return create(l, v, d, r); - } - } else { - return add_max_binding(v, d, l); - } - } else { - return add_min_binding(v, d, r); - } - }; - var concat = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var concat_or_join = function (t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); - } - }; - var split = function (x, param) { - if (param) { - var r = param[/* r */3]; - var d = param[/* d */2]; - var v = param[/* v */1]; - var l = param[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return /* tuple */[ - l, - Caml_option.some(d), - r - ]; - } else if (c < 0) { - var match = split(x, l); - return /* tuple */[ - match[0], - match[1], - join(match[2], v, d, r) - ]; - } else { - var match$1 = split(x, r); - return /* tuple */[ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - undefined, - /* Empty */0 - ]; - } - }; - var merge$1 = function (f, s1, s2) { - if (s1) { - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1[/* l */0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[/* d */2]), match[1]), merge$1(f, s1[/* r */3], match[2])); - } - - } else if (!s2) { - return /* Empty */0; - } - if (s2) { - var v2 = s2[/* v */1]; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2[/* l */0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[/* d */2])), merge$1(f, match$1[2], s2[/* r */3])); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "map.ml", - 393, - 10 - ] - ]; - } - }; - var union = function (f, s1, s2) { - if (s1) { - if (s2) { - var d2 = s2[/* d */2]; - var v2 = s2[/* v */1]; - var d1 = s1[/* d */2]; - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= s2[/* h */4]) { - var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1[/* l */0], match[0]); - var r = union(f, s1[/* r */3], match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } - } else { - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2[/* l */0]); - var r$1 = union(f, match$1[2], s2[/* r */3]); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); - } else { - return join(l$1, v2, d2, r$1); - } - } - } else { - return s1; - } - } else { - return s2; - } - }; - var filter = function (p, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var l$prime = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$prime = filter(p, r); - if (pvd) { - if (l === l$prime && r === r$prime) { - return m; - } else { - return join(l$prime, v, d, r$prime); - } - } else { - return concat(l$prime, r$prime); - } - } else { - return /* Empty */0; - } - }; - var partition = function (p, param) { - if (param) { - var d = param[/* d */2]; - var v = param[/* v */1]; - var match = partition(p, param[/* l */0]); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param[/* r */3]); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return /* tuple */[ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return /* tuple */[ - concat(lt, rt), - join(lf, v, d, rf) - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - /* Empty */0 - ]; - } - }; - var cardinal = function (param) { - if (param) { - return (cardinal(param[/* l */0]) + 1 | 0) + cardinal(param[/* r */3]) | 0; - } else { - return 0; - } - }; - var bindings_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[/* l */0]; - _accu = /* :: */[ - /* tuple */[ - param[/* v */1], - param[/* d */2] - ], - bindings_aux(accu, param[/* r */3]) - ]; - continue ; - } else { - return accu; - } - }; - }; - var expect = request.expect; - var responseToResult = expect[1]; - var typ = expect[0]; - var withCredentials = request.withCredentials; - var timeout = request.timeout; - var body = request.body; - var url = request.url; - var headers = request.headers; - var method$prime = request["method'"]; - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - var enqRes = function (result, _ev) { - return Curry._1(callbacks.contents.enqueue, Curry._1(resultToMessage, result)); - }; - var enqResError = function (result) { - var partial_arg = /* Error */Block.__(1, [result]); - return (function (param) { - return enqRes(partial_arg, param); - }); - }; - var enqResOk = function (result) { - var partial_arg = /* Ok */Block.__(0, [result]); - return (function (param) { - return enqRes(partial_arg, param); - }); - }; - var xhr = new XMLHttpRequest(); - if (maybeEvents !== undefined) { - var match = maybeEvents; - var mayCB = function (thenDo, param) { - if (param !== undefined) { - return Curry._1(thenDo, Curry._1(param, callbacks)); - } else { - return /* () */0; - } - }; - mayCB((function (param) { - xhr.onreadystatechange = param; - return /* () */0; - }), match.onreadystatechange); - mayCB((function (param) { - xhr.onprogress = param; - return /* () */0; - }), match.onprogress); - } - var partial_arg = /* Error */Block.__(1, [/* NetworkError */1]); - var cb = function (param) { - return enqRes(partial_arg, param); - }; - xhr.onerror = cb; - var partial_arg$1 = /* Error */Block.__(1, [/* Timeout */0]); - var cb$1 = function (param) { - return enqRes(partial_arg$1, param); - }; - xhr.ontimeout = cb$1; - var partial_arg$2 = /* Error */Block.__(1, [/* Aborted */2]); - var cb$2 = function (param) { - return enqRes(partial_arg$2, param); - }; - xhr.onabort = cb$2; - var cb$3 = function (_ev) { - var match = Web_xmlhttprequest.getAllResponseHeadersAsDict(xhr); - var headers; - headers = match.tag ? /* Empty */0 : match[0]; - var response_url = xhr.responseURL; - var response_status = { - code: xhr.status, - message: xhr.statusText - }; - var response_body = Web_xmlhttprequest.get_response(xhr); - var response = { - url: response_url, - status: response_status, - headers: headers, - body: response_body - }; - if (response_status.code < 200 || 300 <= response_status.code) { - return enqResError(/* BadStatus */Block.__(1, [response]))(/* () */0); - } else { - var match$1 = Curry._1(responseToResult, response); - if (match$1.tag) { - return enqResError(/* BadPayload */Block.__(2, [ - match$1[0], - response - ]))(/* () */0); - } else { - return enqResOk(match$1[0])(/* () */0); - } - } - }; - xhr.onload = cb$3; - try { - Web_xmlhttprequest.open_(method$prime, url, undefined, undefined, undefined, xhr); - } - catch (exn){ - enqResError(/* BadUrl */Block.__(0, [url]))(/* () */0); - } - var setHeader = function (param) { - return Web_xmlhttprequest.setRequestHeader(param[0], param[1], xhr); - }; - List.iter(setHeader, headers); - Web_xmlhttprequest.set_responseType(typ, xhr); - if (timeout !== undefined) { - xhr.timeout = timeout; - } - xhr.withCredentials = withCredentials; - Web_xmlhttprequest.send(body, xhr); - return /* () */0; - })]); -} - -function encodeUri(str) { - return encodeURIComponent(str); -} - -function decodeUri(str) { - try { - return decodeURIComponent(str); - } - catch (exn){ - return ; - } -} - -function track(toMessage, param) { - var events = param[1]; - var onprogress = (function (callbacks, ev) { - var match = Tea_json.Decoder.decodeValue(Tea_json.Decoder.field("lengthComputable", Tea_json.Decoder.bool), ev); - var lengthComputable; - lengthComputable = match.tag ? false : match[0]; - if (lengthComputable) { - var decoder = Tea_json.Decoder.map2((function (bytes, bytesExpected) { - return { - bytes: bytes, - bytesExpected: bytesExpected - }; - }), Tea_json.Decoder.field("loaded", Tea_json.Decoder.$$int), Tea_json.Decoder.field("total", Tea_json.Decoder.$$int)); - var match$1 = Tea_json.Decoder.decodeValue(decoder, ev); - if (match$1.tag) { - return /* () */0; - } else { - return Curry._1(callbacks.contents.enqueue, Curry._1(toMessage, match$1[0])); - } - } else { - return 0; - } - }); - var events$1 = events !== undefined ? events : emptyRequestEvents; - return /* Request */[ - param[0], - { - onreadystatechange: events$1.onreadystatechange, - onprogress: onprogress - } - ]; -} - -var Progress_emptyProgress = { - bytes: 0, - bytesExpected: 0 -}; - -var Progress = { - emptyProgress: Progress_emptyProgress, - track: track -}; - -exports.string_of_error = string_of_error; -exports.emptyRequestEvents = emptyRequestEvents; -exports.expectStringResponse = expectStringResponse; -exports.expectString = expectString; -exports.request = request; -exports.getString = getString; -exports.toTask = toTask; -exports.send = send; -exports.encodeUri = encodeUri; -exports.decodeUri = decodeUri; -exports.Progress = Progress; -/* expectString Not a pure module */ diff --git a/lib/js/src-ocaml/tea_json.js b/lib/js/src-ocaml/tea_json.js deleted file mode 100644 index 18e194e..0000000 --- a/lib/js/src-ocaml/tea_json.js +++ /dev/null @@ -1,1693 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var $$Array = require("bs-platform/lib/js/array.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Js_dict = require("bs-platform/lib/js/js_dict.js"); -var Web_json = require("./web_json.js"); -var Caml_array = require("bs-platform/lib/js/caml_array.js"); -var Pervasives = require("bs-platform/lib/js/pervasives.js"); -var Tea_result = require("./tea_result.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); -var Caml_exceptions = require("bs-platform/lib/js/caml_exceptions.js"); -var Caml_js_exceptions = require("bs-platform/lib/js/caml_js_exceptions.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function height(param) { - if (param) { - return param[/* h */4]; - } else { - return 0; - } -} - -function create(l, x, d, r) { - var hl = height(l); - var hr = height(r); - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; -} - -function singleton(x, d) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */d, - /* r : Empty */0, - /* h */1 - ]; -} - -function bal(l, x, d, r) { - var hl = l ? l[/* h */4] : 0; - var hr = r ? r[/* h */4] : 0; - if (hl > (hr + 2 | 0)) { - if (l) { - var lr = l[/* r */3]; - var ld = l[/* d */2]; - var lv = l[/* v */1]; - var ll = l[/* l */0]; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } else if (lr) { - return create(create(ll, lv, ld, lr[/* l */0]), lr[/* v */1], lr[/* d */2], create(lr[/* r */3], x, d, r)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else if (hr > (hl + 2 | 0)) { - if (r) { - var rr = r[/* r */3]; - var rd = r[/* d */2]; - var rv = r[/* v */1]; - var rl = r[/* l */0]; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } else if (rl) { - return create(create(l, x, d, rl[/* l */0]), rl[/* v */1], rl[/* d */2], create(rl[/* r */3], rv, rd, rr)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - } -} - -function is_empty(param) { - if (param) { - return false; - } else { - return true; - } -} - -function add(x, data, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = add(x, data, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */data, - /* r : Empty */0, - /* h */1 - ]; - } -} - -function find(x, _param) { - while(true) { - var param = _param; - if (param) { - var c = Caml_primitive.caml_string_compare(x, param[/* v */1]); - if (c === 0) { - return param[/* d */2]; - } else { - _param = c < 0 ? param[/* l */0] : param[/* r */3]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function find_first(f, _param) { - while(true) { - var param = _param; - if (param) { - var v = param[/* v */1]; - if (Curry._1(f, v)) { - var _v0 = v; - var _d0 = param[/* d */2]; - var f$1 = f; - var _param$1 = param[/* l */0]; - while(true) { - var param$1 = _param$1; - var d0 = _d0; - var v0 = _v0; - if (param$1) { - var v$1 = param$1[/* v */1]; - if (Curry._1(f$1, v$1)) { - _param$1 = param$1[/* l */0]; - _d0 = param$1[/* d */2]; - _v0 = v$1; - continue ; - } else { - _param$1 = param$1[/* r */3]; - continue ; - } - } else { - return /* tuple */[ - v0, - d0 - ]; - } - }; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function find_first_opt(f, _param) { - while(true) { - var param = _param; - if (param) { - var v = param[/* v */1]; - if (Curry._1(f, v)) { - var _v0 = v; - var _d0 = param[/* d */2]; - var f$1 = f; - var _param$1 = param[/* l */0]; - while(true) { - var param$1 = _param$1; - var d0 = _d0; - var v0 = _v0; - if (param$1) { - var v$1 = param$1[/* v */1]; - if (Curry._1(f$1, v$1)) { - _param$1 = param$1[/* l */0]; - _d0 = param$1[/* d */2]; - _v0 = v$1; - continue ; - } else { - _param$1 = param$1[/* r */3]; - continue ; - } - } else { - return /* tuple */[ - v0, - d0 - ]; - } - }; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return ; - } - }; -} - -function find_last(f, _param) { - while(true) { - var param = _param; - if (param) { - var v = param[/* v */1]; - if (Curry._1(f, v)) { - var _v0 = v; - var _d0 = param[/* d */2]; - var f$1 = f; - var _param$1 = param[/* r */3]; - while(true) { - var param$1 = _param$1; - var d0 = _d0; - var v0 = _v0; - if (param$1) { - var v$1 = param$1[/* v */1]; - if (Curry._1(f$1, v$1)) { - _param$1 = param$1[/* r */3]; - _d0 = param$1[/* d */2]; - _v0 = v$1; - continue ; - } else { - _param$1 = param$1[/* l */0]; - continue ; - } - } else { - return /* tuple */[ - v0, - d0 - ]; - } - }; - } else { - _param = param[/* l */0]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function find_last_opt(f, _param) { - while(true) { - var param = _param; - if (param) { - var v = param[/* v */1]; - if (Curry._1(f, v)) { - var _v0 = v; - var _d0 = param[/* d */2]; - var f$1 = f; - var _param$1 = param[/* r */3]; - while(true) { - var param$1 = _param$1; - var d0 = _d0; - var v0 = _v0; - if (param$1) { - var v$1 = param$1[/* v */1]; - if (Curry._1(f$1, v$1)) { - _param$1 = param$1[/* r */3]; - _d0 = param$1[/* d */2]; - _v0 = v$1; - continue ; - } else { - _param$1 = param$1[/* l */0]; - continue ; - } - } else { - return /* tuple */[ - v0, - d0 - ]; - } - }; - } else { - _param = param[/* l */0]; - continue ; - } - } else { - return ; - } - }; -} - -function find_opt(x, _param) { - while(true) { - var param = _param; - if (param) { - var c = Caml_primitive.caml_string_compare(x, param[/* v */1]); - if (c === 0) { - return Caml_option.some(param[/* d */2]); - } else { - _param = c < 0 ? param[/* l */0] : param[/* r */3]; - continue ; - } - } else { - return ; - } - }; -} - -function mem(x, _param) { - while(true) { - var param = _param; - if (param) { - var c = Caml_primitive.caml_string_compare(x, param[/* v */1]); - if (c === 0) { - return true; - } else { - _param = c < 0 ? param[/* l */0] : param[/* r */3]; - continue ; - } - } else { - return false; - } - }; -} - -function min_binding(_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function min_binding_opt(_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - return ; - } - }; -} - -function max_binding(_param) { - while(true) { - var param = _param; - if (param) { - var r = param[/* r */3]; - if (r) { - _param = r; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function max_binding_opt(_param) { - while(true) { - var param = _param; - if (param) { - var r = param[/* r */3]; - if (r) { - _param = r; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - return ; - } - }; -} - -function remove_min_binding(param) { - if (param) { - var l = param[/* l */0]; - if (l) { - return bal(remove_min_binding(l), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return param[/* r */3]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.remove_min_elt" - ]; - } -} - -function merge(t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } -} - -function remove(x, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return merge(l, r); - } else if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = remove(x, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Empty */0; - } -} - -function update(x, f, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - var match = Curry._1(f, Caml_option.some(d)); - if (match !== undefined) { - var data = Caml_option.valFromOption(match); - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else { - return merge(l, r); - } - } else if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = update(x, f, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - var match$1 = Curry._1(f, undefined); - if (match$1 !== undefined) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */Caml_option.valFromOption(match$1), - /* r : Empty */0, - /* h */1 - ]; - } else { - return /* Empty */0; - } - } -} - -function iter(f, _param) { - while(true) { - var param = _param; - if (param) { - iter(f, param[/* l */0]); - Curry._2(f, param[/* v */1], param[/* d */2]); - _param = param[/* r */3]; - continue ; - } else { - return /* () */0; - } - }; -} - -function map(f, param) { - if (param) { - var l$prime = map(f, param[/* l */0]); - var d$prime = Curry._1(f, param[/* d */2]); - var r$prime = map(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */param[/* v */1], - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } -} - -function mapi(f, param) { - if (param) { - var v = param[/* v */1]; - var l$prime = mapi(f, param[/* l */0]); - var d$prime = Curry._2(f, v, param[/* d */2]); - var r$prime = mapi(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */v, - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } -} - -function fold(f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (m) { - _accu = Curry._3(f, m[/* v */1], m[/* d */2], fold(f, m[/* l */0], accu)); - _m = m[/* r */3]; - continue ; - } else { - return accu; - } - }; -} - -function for_all(p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) && for_all(p, param[/* l */0])) { - _param = param[/* r */3]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; -} - -function exists(p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) || exists(p, param[/* l */0])) { - return true; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return false; - } - }; -} - -function add_min_binding(k, x, param) { - if (param) { - return bal(add_min_binding(k, x, param[/* l */0]), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return singleton(k, x); - } -} - -function add_max_binding(k, x, param) { - if (param) { - return bal(param[/* l */0], param[/* v */1], param[/* d */2], add_max_binding(k, x, param[/* r */3])); - } else { - return singleton(k, x); - } -} - -function join(l, v, d, r) { - if (l) { - if (r) { - var rh = r[/* h */4]; - var lh = l[/* h */4]; - if (lh > (rh + 2 | 0)) { - return bal(l[/* l */0], l[/* v */1], l[/* d */2], join(l[/* r */3], v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r[/* l */0]), r[/* v */1], r[/* d */2], r[/* r */3]); - } else { - return create(l, v, d, r); - } - } else { - return add_max_binding(v, d, l); - } - } else { - return add_min_binding(v, d, r); - } -} - -function concat(t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } -} - -function concat_or_join(t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); - } -} - -function split(x, param) { - if (param) { - var r = param[/* r */3]; - var d = param[/* d */2]; - var v = param[/* v */1]; - var l = param[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return /* tuple */[ - l, - Caml_option.some(d), - r - ]; - } else if (c < 0) { - var match = split(x, l); - return /* tuple */[ - match[0], - match[1], - join(match[2], v, d, r) - ]; - } else { - var match$1 = split(x, r); - return /* tuple */[ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - undefined, - /* Empty */0 - ]; - } -} - -function merge$1(f, s1, s2) { - if (s1) { - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1[/* l */0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[/* d */2]), match[1]), merge$1(f, s1[/* r */3], match[2])); - } - - } else if (!s2) { - return /* Empty */0; - } - if (s2) { - var v2 = s2[/* v */1]; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2[/* l */0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[/* d */2])), merge$1(f, match$1[2], s2[/* r */3])); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "map.ml", - 393, - 10 - ] - ]; - } -} - -function union(f, s1, s2) { - if (s1) { - if (s2) { - var d2 = s2[/* d */2]; - var v2 = s2[/* v */1]; - var d1 = s1[/* d */2]; - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= s2[/* h */4]) { - var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1[/* l */0], match[0]); - var r = union(f, s1[/* r */3], match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } - } else { - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2[/* l */0]); - var r$1 = union(f, match$1[2], s2[/* r */3]); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); - } else { - return join(l$1, v2, d2, r$1); - } - } - } else { - return s1; - } - } else { - return s2; - } -} - -function filter(p, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var l$prime = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$prime = filter(p, r); - if (pvd) { - if (l === l$prime && r === r$prime) { - return m; - } else { - return join(l$prime, v, d, r$prime); - } - } else { - return concat(l$prime, r$prime); - } - } else { - return /* Empty */0; - } -} - -function partition(p, param) { - if (param) { - var d = param[/* d */2]; - var v = param[/* v */1]; - var match = partition(p, param[/* l */0]); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param[/* r */3]); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return /* tuple */[ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return /* tuple */[ - concat(lt, rt), - join(lf, v, d, rf) - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - /* Empty */0 - ]; - } -} - -function cons_enum(_m, _e) { - while(true) { - var e = _e; - var m = _m; - if (m) { - _e = /* More */[ - m[/* v */1], - m[/* d */2], - m[/* r */3], - e - ]; - _m = m[/* l */0]; - continue ; - } else { - return e; - } - }; -} - -function compare(cmp, m1, m2) { - var _e1 = cons_enum(m1, /* End */0); - var _e2 = cons_enum(m2, /* End */0); - while(true) { - var e2 = _e2; - var e1 = _e1; - if (e1) { - if (e2) { - var c = Caml_primitive.caml_string_compare(e1[0], e2[0]); - if (c !== 0) { - return c; - } else { - var c$1 = Curry._2(cmp, e1[1], e2[1]); - if (c$1 !== 0) { - return c$1; - } else { - _e2 = cons_enum(e2[2], e2[3]); - _e1 = cons_enum(e1[2], e1[3]); - continue ; - } - } - } else { - return 1; - } - } else if (e2) { - return -1; - } else { - return 0; - } - }; -} - -function equal(cmp, m1, m2) { - var _e1 = cons_enum(m1, /* End */0); - var _e2 = cons_enum(m2, /* End */0); - while(true) { - var e2 = _e2; - var e1 = _e1; - if (e1) { - if (e2 && Caml_primitive.caml_string_compare(e1[0], e2[0]) === 0 && Curry._2(cmp, e1[1], e2[1])) { - _e2 = cons_enum(e2[2], e2[3]); - _e1 = cons_enum(e1[2], e1[3]); - continue ; - } else { - return false; - } - } else if (e2) { - return false; - } else { - return true; - } - }; -} - -function cardinal(param) { - if (param) { - return (cardinal(param[/* l */0]) + 1 | 0) + cardinal(param[/* r */3]) | 0; - } else { - return 0; - } -} - -function bindings_aux(_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[/* l */0]; - _accu = /* :: */[ - /* tuple */[ - param[/* v */1], - param[/* d */2] - ], - bindings_aux(accu, param[/* r */3]) - ]; - continue ; - } else { - return accu; - } - }; -} - -function bindings(s) { - return bindings_aux(/* [] */0, s); -} - -var ObjectDict = { - empty: /* Empty */0, - is_empty: is_empty, - mem: mem, - add: add, - update: update, - singleton: singleton, - remove: remove, - merge: merge$1, - union: union, - compare: compare, - equal: equal, - iter: iter, - fold: fold, - for_all: for_all, - exists: exists, - filter: filter, - partition: partition, - cardinal: cardinal, - bindings: bindings, - min_binding: min_binding, - min_binding_opt: min_binding_opt, - max_binding: max_binding, - max_binding_opt: max_binding_opt, - choose: min_binding, - choose_opt: min_binding_opt, - split: split, - find: find, - find_opt: find_opt, - find_first: find_first, - find_first_opt: find_first_opt, - find_last: find_last, - find_last_opt: find_last_opt, - map: map, - mapi: mapi -}; - -var ParseFail = Caml_exceptions.create("Tea_json.Decoder.ParseFail"); - -var string = /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag) { - return /* Error */Block.__(1, ["Non-string value"]); - } else { - return /* Ok */Block.__(0, [match[0]]); - } - })]; - -var $$int = /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONNumber */1) { - return /* Error */Block.__(1, ["Non-int value"]); - } else { - var n = match[0]; - if (n > Pervasives.min_int && n < Pervasives.max_int) { - return /* Ok */Block.__(0, [n | 0]); - } else { - return /* Error */Block.__(1, ["number out of int range"]); - } - } - })]; - -var $$float = /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONNumber */1) { - return /* Error */Block.__(1, ["Non-float-value"]); - } else { - return /* Ok */Block.__(0, [match[0]]); - } - })]; - -var bool = /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number") { - switch (match) { - case /* JSONFalse */0 : - return /* Ok */Block.__(0, [false]); - case /* JSONTrue */1 : - return /* Ok */Block.__(0, [true]); - case /* JSONNull */2 : - return /* Error */Block.__(1, ["Non-boolean value"]); - - } - } else { - return /* Error */Block.__(1, ["Non-boolean value"]); - } - })]; - -function $$null(v) { - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" && match >= 2) { - return /* Ok */Block.__(0, [v]); - } else { - return /* Error */Block.__(1, ["Non-null value"]); - } - })]; -} - -function list(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONArray */3) { - return /* Error */Block.__(1, ["Non-list value"]); - } else { - var parse = function (v) { - var match = Curry._1(decoder, v); - if (match.tag) { - throw [ - ParseFail, - match[0] - ]; - } else { - return match[0]; - } - }; - try { - return /* Ok */Block.__(0, [List.map(parse, $$Array.to_list(match[0]))]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, ["list -> " + exn[1]]); - } else { - throw exn; - } - } - } - })]; -} - -function array(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONArray */3) { - return /* Error */Block.__(1, ["Non-array value"]); - } else { - var parse = function (v) { - var match = Curry._1(decoder, v); - if (match.tag) { - throw [ - ParseFail, - match[0] - ]; - } else { - return match[0]; - } - }; - try { - return /* Ok */Block.__(0, [$$Array.map(parse, match[0])]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, ["array -> " + exn[1]]); - } else { - throw exn; - } - } - } - })]; -} - -function keyValuePairs(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONObject */2) { - return /* Error */Block.__(1, ["Non-keyValuePair value"]); - } else { - var o = match[0]; - var keys = Object.keys(o); - var parse = function (k, l) { - var match = Js_dict.get(o, k); - if (match !== undefined) { - var match$1 = Curry._1(decoder, Caml_option.valFromOption(match)); - if (match$1.tag) { - throw [ - ParseFail, - match$1[0] - ]; - } else { - return /* :: */[ - /* tuple */[ - k, - match$1[0] - ], - l - ]; - } - } else { - throw [ - ParseFail, - "Key is undefined: " + k - ]; - } - }; - try { - return /* Ok */Block.__(0, [$$Array.fold_right(parse, keys, /* [] */0)]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, ["Invalid keyValuePair parsing: " + exn[1]]); - } else { - throw exn; - } - } - } - })]; -} - -function dict(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONObject */2) { - return /* Error */Block.__(1, ["Non-dict value"]); - } else { - var o = match[0]; - var keys = Object.keys(o); - var parse = function (k, d) { - var match = Js_dict.get(o, k); - if (match !== undefined) { - var match$1 = Curry._1(decoder, Caml_option.valFromOption(match)); - if (match$1.tag) { - throw [ - ParseFail, - match$1[0] - ]; - } else { - return add(k, match$1[0], d); - } - } else { - throw [ - ParseFail, - "Key is undefined: " + k - ]; - } - }; - try { - return /* Ok */Block.__(0, [$$Array.fold_right(parse, keys, /* Empty */0)]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, ["Invalid dict parsing: " + exn[1]]); - } else { - throw exn; - } - } - } - })]; -} - -function field(key, param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONObject */2) { - return /* Error */Block.__(1, ["Non-fieldable value"]); - } else { - var match$1 = Js_dict.get(match[0], key); - if (match$1 !== undefined) { - var o = Curry._1(decoder, Caml_option.valFromOption(match$1)); - if (o.tag) { - return /* Error */Block.__(1, ["field `" + (key + ("` -> " + o[0]))]); - } else { - return o; - } - } else { - return /* Error */Block.__(1, ["Field Value is undefined: " + key]); - } - } - })]; -} - -function at(fields, dec) { - return List.fold_right(field, fields, dec); -} - -function index(idx, param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONArray */3) { - return /* Error */Block.__(1, ["Non-array value"]); - } else { - var a = match[0]; - if (idx < 0 || idx > a.length) { - return /* Error */Block.__(1, ["Array index out of range: " + String(idx)]); - } else { - return Curry._1(decoder, Caml_array.caml_array_get(a, idx)); - } - } - })]; -} - -function maybe(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder, value); - if (match.tag) { - return /* Ok */Block.__(0, [undefined]); - } else { - return /* Ok */Block.__(0, [Caml_option.some(match[0])]); - } - })]; -} - -function oneOf(decoders) { - return /* Decoder */[(function (value) { - var parse = function (v, _param) { - while(true) { - var param = _param; - if (param) { - var rest = param[1]; - try { - var ok = Curry._1(param[0][0], v); - if (ok.tag) { - return parse(v, rest); - } else { - return ok; - } - } - catch (exn){ - _param = rest; - continue ; - } - } else { - return /* Error */Block.__(1, ["No one-of's matched"]); - } - }; - }; - return parse(value, decoders); - })]; -} - -function map$1(mapper, param) { - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - if (match.tag) { - return /* Error */Block.__(1, ["map " + match[0]]); - } else { - return /* Ok */Block.__(0, [Curry._1(mapper, match[0])]); - } - })]; -} - -function map2(mapper, param, param$1) { - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - if (!match.tag && !match$1.tag) { - return /* Ok */Block.__(0, [Curry._2(mapper, match[0], match$1[0])]); - } - var match$2 = Tea_result.error_of_first(match, match$1); - if (match$2 !== undefined) { - return /* Error */Block.__(1, ["map2 -> " + match$2]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map3(mapper, param, param$1, param$2) { - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - if (!match.tag && !match$1.tag && !match$2.tag) { - return /* Ok */Block.__(0, [Curry._3(mapper, match[0], match$1[0], match$2[0])]); - } - var match$3 = Tea_result.first(match$2, Tea_result.first(match$1, match)); - if (match$3.tag) { - return /* Error */Block.__(1, ["map3 -> " + match$3[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map4(mapper, param, param$1, param$2, param$3) { - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag) { - return /* Ok */Block.__(0, [Curry._4(mapper, match[0], match$1[0], match$2[0], match$3[0])]); - } - var match$4 = Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match))); - if (match$4.tag) { - return /* Error */Block.__(1, ["map4 -> " + match$4[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map5(mapper, param, param$1, param$2, param$3, param$4) { - var decoder5 = param$4[0]; - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - var match$4 = Curry._1(decoder5, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag && !match$4.tag) { - return /* Ok */Block.__(0, [Curry._5(mapper, match[0], match$1[0], match$2[0], match$3[0], match$4[0])]); - } - var match$5 = Tea_result.first(match$4, Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match)))); - if (match$5.tag) { - return /* Error */Block.__(1, ["map5 -> " + match$5[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map6(mapper, param, param$1, param$2, param$3, param$4, param$5) { - var decoder6 = param$5[0]; - var decoder5 = param$4[0]; - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - var match$4 = Curry._1(decoder5, value); - var match$5 = Curry._1(decoder6, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag && !match$4.tag && !match$5.tag) { - return /* Ok */Block.__(0, [Curry._6(mapper, match[0], match$1[0], match$2[0], match$3[0], match$4[0], match$5[0])]); - } - var match$6 = Tea_result.first(match$5, Tea_result.first(match$4, Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match))))); - if (match$6.tag) { - return /* Error */Block.__(1, ["map6 -> " + match$6[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map7(mapper, param, param$1, param$2, param$3, param$4, param$5, param$6) { - var decoder7 = param$6[0]; - var decoder6 = param$5[0]; - var decoder5 = param$4[0]; - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - var match$4 = Curry._1(decoder5, value); - var match$5 = Curry._1(decoder6, value); - var match$6 = Curry._1(decoder7, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag && !match$4.tag && !match$5.tag && !match$6.tag) { - return /* Ok */Block.__(0, [Curry._7(mapper, match[0], match$1[0], match$2[0], match$3[0], match$4[0], match$5[0], match$6[0])]); - } - var match$7 = Tea_result.first(match$6, Tea_result.first(match$5, Tea_result.first(match$4, Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match)))))); - if (match$7.tag) { - return /* Error */Block.__(1, ["map7 -> " + match$7[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map8(mapper, param, param$1, param$2, param$3, param$4, param$5, param$6, param$7) { - var decoder8 = param$7[0]; - var decoder7 = param$6[0]; - var decoder6 = param$5[0]; - var decoder5 = param$4[0]; - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - var match$4 = Curry._1(decoder5, value); - var match$5 = Curry._1(decoder6, value); - var match$6 = Curry._1(decoder7, value); - var match$7 = Curry._1(decoder8, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag && !match$4.tag && !match$5.tag && !match$6.tag && !match$7.tag) { - return /* Ok */Block.__(0, [Curry._8(mapper, match[0], match$1[0], match$2[0], match$3[0], match$4[0], match$5[0], match$6[0], match$7[0])]); - } - var match$8 = Tea_result.first(match$7, Tea_result.first(match$6, Tea_result.first(match$5, Tea_result.first(match$4, Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match))))))); - if (match$8.tag) { - return /* Error */Block.__(1, ["map8 -> " + match$8[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function succeed(v) { - return /* Decoder */[(function (_value) { - return /* Ok */Block.__(0, [v]); - })]; -} - -function fail(e) { - return /* Decoder */[(function (_value) { - return /* Error */Block.__(1, [e]); - })]; -} - -var value = /* Decoder */[(function (value) { - return /* Ok */Block.__(0, [value]); - })]; - -function andThen(func, param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var err = Curry._1(decoder, value); - if (err.tag) { - return err; - } else { - var match = Curry._1(func, err[0]); - return Curry._1(match[0], value); - } - })]; -} - -function lazy_(func) { - return andThen(func, /* Decoder */[(function (_value) { - return /* Ok */Block.__(0, [/* () */0]); - })]); -} - -function nullable(decoder) { - return oneOf(/* :: */[ - $$null(undefined), - /* :: */[ - map$1((function (v) { - return Caml_option.some(v); - }), decoder), - /* [] */0 - ] - ]); -} - -function decodeValue(param, value) { - try { - return Curry._1(param[0], value); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, [exn[1]]); - } else { - return /* Error */Block.__(1, ["Unknown JSON parsing error"]); - } - } -} - -function decodeEvent(param, value) { - try { - return Curry._1(param[0], value); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, [exn[1]]); - } else { - return /* Error */Block.__(1, ["Unknown JSON parsing error"]); - } - } -} - -function decodeString(decoder, string) { - try { - var value = JSON.parse(string); - return decodeValue(decoder, value); - } - catch (exn){ - return /* Error */Block.__(1, ["Invalid JSON string"]); - } -} - -var Decoder = { - ObjectDict: ObjectDict, - ParseFail: ParseFail, - string: string, - $$int: $$int, - $$float: $$float, - bool: bool, - $$null: $$null, - list: list, - array: array, - keyValuePairs: keyValuePairs, - dict: dict, - field: field, - at: at, - index: index, - maybe: maybe, - oneOf: oneOf, - map: map$1, - map2: map2, - map3: map3, - map4: map4, - map5: map5, - map6: map6, - map7: map7, - map8: map8, - succeed: succeed, - fail: fail, - value: value, - andThen: andThen, - lazy_: lazy_, - nullable: nullable, - decodeValue: decodeValue, - decodeEvent: decodeEvent, - decodeString: decodeString -}; - -function encode(indentLevel, value) { - return Web_json.string_of_json(indentLevel, value); -} - -function string$1(v) { - return v; -} - -function $$int$1(v) { - return v; -} - -function $$float$1(v) { - return v; -} - -function bool$1(v) { - return v; -} - -function object_(v) { - var aux = function (o, param) { - o[param[0]] = param[1]; - return o; - }; - return List.fold_left(aux, { }, v); -} - -function array$1(v) { - return v; -} - -var list$1 = $$Array.of_list; - -var Encoder = { - encode: encode, - string: string$1, - $$int: $$int$1, - $$float: $$float$1, - bool: bool$1, - $$null: Web_json.$$null, - object_: object_, - array: array$1, - list: list$1 -}; - -exports.Decoder = Decoder; -exports.Encoder = Encoder; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_mouse.js b/lib/js/src-ocaml/tea_mouse.js deleted file mode 100644 index 61be8f0..0000000 --- a/lib/js/src-ocaml/tea_mouse.js +++ /dev/null @@ -1,71 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_sub = require("./tea_sub.js"); -var Tea_json = require("./tea_json.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -var position = Tea_json.Decoder.map2((function (x, y) { - return { - x: x, - y: y - }; - }), Tea_json.Decoder.field("pageX", Tea_json.Decoder.$$int), Tea_json.Decoder.field("pageY", Tea_json.Decoder.$$int)); - -function registerGlobal(name, key, tagger) { - var enableCall = function (callbacks_base) { - var callbacks = { - contents: callbacks_base - }; - var fn = function (ev) { - var match = Tea_json.Decoder.decodeEvent(position, ev); - if (match.tag) { - return ; - } else { - return Caml_option.some(Curry._1(tagger, match[0])); - } - }; - var handler = /* EventHandlerCallback */Block.__(0, [ - key, - fn - ]); - var elem = document; - var cache = Vdom.eventHandler_Register(callbacks, elem, name, handler); - return (function (param) { - Vdom.eventHandler_Unregister(elem, name, cache); - return /* () */0; - }); - }; - return Tea_sub.registration(key, enableCall); -} - -function clicks($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return registerGlobal("click", key, tagger); -} - -function moves($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return registerGlobal("mousemove", key, tagger); -} - -function downs($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return registerGlobal("mousedown", key, tagger); -} - -function ups($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return registerGlobal("mouseup", key, tagger); -} - -exports.position = position; -exports.registerGlobal = registerGlobal; -exports.clicks = clicks; -exports.moves = moves; -exports.downs = downs; -exports.ups = ups; -/* position Not a pure module */ diff --git a/lib/js/src-ocaml/tea_navigation.js b/lib/js/src-ocaml/tea_navigation.js deleted file mode 100644 index cdff7ab..0000000 --- a/lib/js/src-ocaml/tea_navigation.js +++ /dev/null @@ -1,128 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_app = require("./tea_app.js"); -var Tea_sub = require("./tea_sub.js"); -var Web_window = require("./web_window.js"); -var Web_location = require("./web_location.js"); -var Web_window_history = require("./web_window_history.js"); - -function getLocation(param) { - return Web_location.asRecord(document.location); -} - -var notifier = { - contents: undefined -}; - -function notifyUrlChange(param) { - var match = notifier.contents; - if (match !== undefined) { - var $$location = Web_location.asRecord(document.location); - Curry._1(match, $$location); - return /* () */0; - } else { - return /* () */0; - } -} - -function subscribe(tagger) { - var enableCall = function (callbacks) { - var notifyHandler = function ($$location) { - return Curry._1(callbacks.enqueue, Curry._1(tagger, $$location)); - }; - notifier.contents = notifyHandler; - var handler = function (_event) { - return notifyUrlChange(/* () */0); - }; - Web_window.addEventListener("popstate", handler, false); - return (function (param) { - return Web_window.removeEventListener("popstate", handler, false); - }); - }; - return Tea_sub.registration("navigation", enableCall); -} - -function replaceState(url) { - Web_window_history.replaceState(window, JSON.parse("{}"), "", url); - return /* () */0; -} - -function pushState(url) { - Web_window_history.pushState(window, JSON.parse("{}"), "", url); - return /* () */0; -} - -function modifyUrl(url) { - return /* EnqueueCall */Block.__(2, [(function (_enqueue) { - replaceState(url); - notifyUrlChange(/* () */0); - return /* () */0; - })]); -} - -function newUrl(url) { - return /* EnqueueCall */Block.__(2, [(function (_enqueue) { - pushState(url); - notifyUrlChange(/* () */0); - return /* () */0; - })]); -} - -function go(step) { - return /* EnqueueCall */Block.__(2, [(function (_enqueue) { - Web_window_history.go(window, step); - notifyUrlChange(/* () */0); - return /* () */0; - })]); -} - -function back(step) { - return go(-step | 0); -} - -var forward = go; - -function navigationProgram(locationToMessage, stuff) { - var init = function (flag) { - return Curry._2(stuff.init, flag, Web_location.asRecord(document.location)); - }; - var subscriptions = function (model) { - return /* Batch */Block.__(0, [/* :: */[ - subscribe(locationToMessage), - /* :: */[ - Curry._1(stuff.subscriptions, model), - /* [] */0 - ] - ]]); - }; - var partial_arg_update = stuff.update; - var partial_arg_view = stuff.view; - var partial_arg_shutdown = stuff.shutdown; - var partial_arg = { - init: init, - update: partial_arg_update, - view: partial_arg_view, - subscriptions: subscriptions, - shutdown: partial_arg_shutdown - }; - return (function (param, param$1) { - return Tea_app.program(partial_arg, param, param$1); - }); -} - -exports.getLocation = getLocation; -exports.notifier = notifier; -exports.notifyUrlChange = notifyUrlChange; -exports.subscribe = subscribe; -exports.replaceState = replaceState; -exports.pushState = pushState; -exports.modifyUrl = modifyUrl; -exports.newUrl = newUrl; -exports.go = go; -exports.back = back; -exports.forward = forward; -exports.navigationProgram = navigationProgram; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_program.js b/lib/js/src-ocaml/tea_program.js deleted file mode 100644 index 49778a8..0000000 --- a/lib/js/src-ocaml/tea_program.js +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function spawn(initState, update, shutdown) { - var state = { - contents: Caml_option.some(initState) - }; - return (function (procMsg) { - var match = state.contents; - if (match !== undefined) { - var model = Caml_option.valFromOption(match); - if (procMsg) { - state.contents = Curry._2(update, model, procMsg[0]); - return /* () */0; - } else { - Curry._1(shutdown, model); - state.contents = undefined; - return /* () */0; - } - } else { - return /* () */0; - } - }); -} - -var testing1 = 42; - -exports.spawn = spawn; -exports.testing1 = testing1; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_promise.js b/lib/js/src-ocaml/tea_promise.js deleted file mode 100644 index 5940085..0000000 --- a/lib/js/src-ocaml/tea_promise.js +++ /dev/null @@ -1,42 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function cmd(promise, tagger) { - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - promise.then((function (res) { - var match = Curry._1(tagger, res); - if (match !== undefined) { - Curry._1(callbacks.contents.enqueue, Caml_option.valFromOption(match)); - return Promise.resolve(/* () */0); - } else { - return Promise.resolve(/* () */0); - } - })); - return /* () */0; - })]); -} - -function result(promise, msg) { - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - var enq = function (result) { - return Curry._1(callbacks.contents.enqueue, Curry._1(msg, result)); - }; - promise.then((function (res) { - return Promise.resolve(enq(/* Ok */Block.__(0, [res]))); - })).catch((function (err) { - var err_to_string = function (err) { - return "" + (String(err) + ""); - }; - return Promise.resolve(enq(/* Error */Block.__(1, [err_to_string(err)]))); - })); - return /* () */0; - })]); -} - -exports.cmd = cmd; -exports.result = result; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_random.js b/lib/js/src-ocaml/tea_random.js deleted file mode 100644 index e6548ed..0000000 --- a/lib/js/src-ocaml/tea_random.js +++ /dev/null @@ -1,184 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Random = require("bs-platform/lib/js/random.js"); -var Pervasives = require("bs-platform/lib/js/pervasives.js"); - -Random.self_init(/* () */0); - -var bool = /* Generator */[(function (state) { - return Random.State.bool(state); - })]; - -function $$int(min, max) { - var match = min < max ? /* tuple */[ - min, - max - ] : /* tuple */[ - max, - min - ]; - var max$1 = match[1]; - var min$1 = match[0]; - return /* Generator */[(function (state) { - return min$1 + Random.State.$$int(state, (max$1 - min$1 | 0) + 1 | 0) | 0; - })]; -} - -function $$float(min, max) { - return /* Generator */[(function (state) { - return min + Random.State.$$float(state, max - min); - })]; -} - -function list(count, param) { - var genCmd = param[0]; - return /* Generator */[(function (state) { - var state$1 = state; - var _i = count; - var _acc = /* [] */0; - while(true) { - var acc = _acc; - var i = _i; - if (i > 0) { - _acc = /* :: */[ - Curry._1(genCmd, state$1), - acc - ]; - _i = i - 1 | 0; - continue ; - } else { - return acc; - } - }; - })]; -} - -function map(func, param) { - var genCmd = param[0]; - return /* Generator */[(function (state) { - return Curry._1(func, Curry._1(genCmd, state)); - })]; -} - -function map2(func, param, param$1) { - var genCmd2 = param$1[0]; - var genCmd1 = param[0]; - return /* Generator */[(function (state) { - var res1 = Curry._1(genCmd1, state); - var res2 = Curry._1(genCmd2, state); - return Curry._2(func, res1, res2); - })]; -} - -function map3(func, param, param$1, param$2) { - var genCmd3 = param$2[0]; - var genCmd2 = param$1[0]; - var genCmd1 = param[0]; - return /* Generator */[(function (state) { - var res1 = Curry._1(genCmd1, state); - var res2 = Curry._1(genCmd2, state); - var res3 = Curry._1(genCmd3, state); - return Curry._3(func, res1, res2, res3); - })]; -} - -function map4(func, param, param$1, param$2, param$3) { - var genCmd4 = param$3[0]; - var genCmd3 = param$2[0]; - var genCmd2 = param$1[0]; - var genCmd1 = param[0]; - return /* Generator */[(function (state) { - var res1 = Curry._1(genCmd1, state); - var res2 = Curry._1(genCmd2, state); - var res3 = Curry._1(genCmd3, state); - var res4 = Curry._1(genCmd4, state); - return Curry._4(func, res1, res2, res3, res4); - })]; -} - -function map5(func, param, param$1, param$2, param$3, param$4) { - var genCmd5 = param$4[0]; - var genCmd4 = param$3[0]; - var genCmd3 = param$2[0]; - var genCmd2 = param$1[0]; - var genCmd1 = param[0]; - return /* Generator */[(function (state) { - var res1 = Curry._1(genCmd1, state); - var res2 = Curry._1(genCmd2, state); - var res3 = Curry._1(genCmd3, state); - var res4 = Curry._1(genCmd4, state); - var res5 = Curry._1(genCmd5, state); - return Curry._5(func, res1, res2, res3, res4, res5); - })]; -} - -function andThen(func, param) { - var genCmd = param[0]; - return /* Generator */[(function (state) { - var res = Curry._1(genCmd, state); - var match = Curry._1(func, res); - return Curry._1(match[0], state); - })]; -} - -function pair(gen1, gen2) { - return map2((function (a, b) { - return /* tuple */[ - a, - b - ]; - }), gen1, gen2); -} - -function generate(tagger, param) { - var genCmd = param[0]; - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - var state = Random.get_state(/* () */0); - var genValue = Curry._1(genCmd, state); - Random.set_state(state); - return Curry._1(callbacks.contents.enqueue, Curry._1(tagger, genValue)); - })]); -} - -function step(param, param$1) { - var newState = Random.State.copy(param$1[0]); - return /* tuple */[ - Curry._1(param[0], newState), - /* Seed */[newState] - ]; -} - -function initialSeed(seed) { - return /* Seed */[Random.State.make([seed])]; -} - -var minInt = Pervasives.min_int; - -var maxInt = Pervasives.max_int; - -var minFloat = Pervasives.min_float; - -var maxFloat = Pervasives.max_float; - -exports.minInt = minInt; -exports.maxInt = maxInt; -exports.minFloat = minFloat; -exports.maxFloat = maxFloat; -exports.bool = bool; -exports.$$int = $$int; -exports.$$float = $$float; -exports.list = list; -exports.map = map; -exports.map2 = map2; -exports.map3 = map3; -exports.map4 = map4; -exports.map5 = map5; -exports.andThen = andThen; -exports.pair = pair; -exports.generate = generate; -exports.step = step; -exports.initialSeed = initialSeed; -/* Not a pure module */ diff --git a/lib/js/src-ocaml/tea_result.js b/lib/js/src-ocaml/tea_result.js deleted file mode 100644 index 7acfd4f..0000000 --- a/lib/js/src-ocaml/tea_result.js +++ /dev/null @@ -1,133 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function result_to_option(param) { - if (param.tag) { - return ; - } else { - return Caml_option.some(param[0]); - } -} - -function option_of_result(param) { - if (param.tag) { - return ; - } else { - return Caml_option.some(param[0]); - } -} - -function ok(param) { - if (param.tag) { - return ; - } else { - return Caml_option.some(param[0]); - } -} - -function error(param) { - if (param.tag) { - return Caml_option.some(param[0]); - } - -} - -function last_of(_param) { - while(true) { - var param = _param; - if (param) { - var tl = param[1]; - var last = param[0]; - if (tl && !last.tag) { - _param = tl; - continue ; - } else { - return last; - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "`Tea.Result.do` must never be passed the empty list" - ]; - } - }; -} - -function accumulate(param) { - if (param) { - var tl = param[1]; - var last = param[0]; - if (tl) { - if (last.tag) { - return last; - } else { - var e = accumulate(tl); - if (e.tag) { - return e; - } else { - return /* Ok */Block.__(0, [/* :: */[ - last[0], - e[0] - ]]); - } - } - } else if (last.tag) { - return last; - } else { - return /* Ok */Block.__(0, [/* :: */[ - last[0], - /* [] */0 - ]]); - } - } else { - return /* Ok */Block.__(0, [/* [] */0]); - } -} - -function first(fst, e) { - if (e.tag) { - return e; - } else { - return fst; - } -} - -function error_of_any(_param) { - while(true) { - var param = _param; - if (param) { - var hd = param[0]; - if (hd.tag) { - return Caml_option.some(hd[0]); - } else { - _param = param[1]; - continue ; - } - } else { - return ; - } - }; -} - -function error_of_first(fst, param) { - if (param.tag) { - return Caml_option.some(param[0]); - } else { - return error(fst); - } -} - -exports.result_to_option = result_to_option; -exports.option_of_result = option_of_result; -exports.ok = ok; -exports.error = error; -exports.last_of = last_of; -exports.accumulate = accumulate; -exports.first = first; -exports.error_of_any = error_of_any; -exports.error_of_first = error_of_first; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_sub.js b/lib/js/src-ocaml/tea_sub.js deleted file mode 100644 index 6ed1873..0000000 --- a/lib/js/src-ocaml/tea_sub.js +++ /dev/null @@ -1,184 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); - -function batch(subs) { - return /* Batch */Block.__(0, [subs]); -} - -function registration(key, enableCall) { - return /* Registration */Block.__(1, [ - key, - (function (callbacks) { - return Curry._1(enableCall, callbacks.contents); - }), - { - contents: undefined - } - ]); -} - -function map(msgMapper, sub) { - var func = function (callbacks) { - return Vdom.wrapCallbacks(msgMapper, callbacks); - }; - return /* Mapper */Block.__(2, [ - func, - sub - ]); -} - -function mapFunc(func, sub) { - return /* Mapper */Block.__(2, [ - func, - sub - ]); -} - -function run(oldCallbacks, newCallbacks, oldSub, newSub) { - var enable = function (_callbacks, _param) { - while(true) { - var param = _param; - var callbacks = _callbacks; - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* Batch */0 : - var subs = param[0]; - if (subs) { - return List.iter((function(callbacks){ - return function (param) { - return enable(callbacks, param); - } - }(callbacks)), subs); - } else { - return /* () */0; - } - case /* Registration */1 : - param[2].contents = Curry._1(param[1], callbacks); - return /* () */0; - case /* Mapper */2 : - var subCallbacks = Curry._1(param[0], callbacks); - _param = param[1]; - _callbacks = subCallbacks; - continue ; - - } - } - }; - }; - var disable = function (_callbacks, _param) { - while(true) { - var param = _param; - var callbacks = _callbacks; - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* Batch */0 : - var subs = param[0]; - if (subs) { - return List.iter((function(callbacks){ - return function (param) { - return disable(callbacks, param); - } - }(callbacks)), subs); - } else { - return /* () */0; - } - case /* Registration */1 : - var diCB = param[2]; - var match = diCB.contents; - if (match !== undefined) { - diCB.contents = undefined; - return Curry._1(match, /* () */0); - } else { - return /* () */0; - } - case /* Mapper */2 : - var subCallbacks = Curry._1(param[0], callbacks); - _param = param[1]; - _callbacks = subCallbacks; - continue ; - - } - } - }; - }; - if (typeof oldSub === "number") { - if (typeof newSub === "number") { - return newSub; - } - - } else { - switch (oldSub.tag | 0) { - case /* Batch */0 : - if (typeof newSub !== "number" && !newSub.tag) { - var aux = function (_oldList, _newList) { - while(true) { - var newList = _newList; - var oldList = _oldList; - if (oldList) { - var oldRest = oldList[1]; - var oldSubSub = oldList[0]; - if (newList) { - run(oldCallbacks, newCallbacks, oldSubSub, newList[0]); - _newList = newList[1]; - _oldList = oldRest; - continue ; - } else { - disable(oldCallbacks, oldSubSub); - _newList = /* [] */0; - _oldList = oldRest; - continue ; - } - } else if (newList) { - enable(newCallbacks, newList[0]); - _newList = newList[1]; - _oldList = /* [] */0; - continue ; - } else { - return /* () */0; - } - }; - }; - aux(oldSub[0], newSub[0]); - return newSub; - } - break; - case /* Registration */1 : - if (typeof newSub !== "number" && newSub.tag === /* Registration */1 && oldSub[0] === newSub[0]) { - newSub[2].contents = oldSub[2].contents; - return newSub; - } - break; - case /* Mapper */2 : - if (typeof newSub !== "number" && newSub.tag === /* Mapper */2) { - var olderCallbacks = Curry._1(oldSub[0], oldCallbacks); - var newerCallbacks = Curry._1(newSub[0], newCallbacks); - run(olderCallbacks, newerCallbacks, oldSub[1], newSub[1]); - return newSub; - } - break; - - } - } - disable(oldCallbacks, oldSub); - enable(newCallbacks, newSub); - return newSub; -} - -var none = /* NoSub */0; - -exports.none = none; -exports.batch = batch; -exports.registration = registration; -exports.map = map; -exports.mapFunc = mapFunc; -exports.run = run; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_svg.js b/lib/js/src-ocaml/tea_svg.js deleted file mode 100644 index 4211013..0000000 --- a/lib/js/src-ocaml/tea_svg.js +++ /dev/null @@ -1,597 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); - -var svgNamespace = "http://www.w3.org/2000/svg"; - -function text(str) { - return /* Text */Block.__(1, [str]); -} - -var lazy1 = Vdom.lazyGen; - -function node(tagName, $staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, tagName, key, unique, props, nodes); -} - -function svg($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "svg", key, unique, props, nodes); -} - -function foreignObject($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "foreignObject", key, unique, props, nodes); -} - -function animate($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "animate", key, unique, props, nodes); -} - -function animateColor($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "animateColor", key, unique, props, nodes); -} - -function animateMotion($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "animateMotion", key, unique, props, nodes); -} - -function animateTransform($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "animateTransform", key, unique, props, nodes); -} - -function mpath($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "mpath", key, unique, props, nodes); -} - -function set($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "set", key, unique, props, nodes); -} - -function a($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "a", key, unique, props, nodes); -} - -function defs($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "defs", key, unique, props, nodes); -} - -function g($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "g", key, unique, props, nodes); -} - -function marker($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "marker", key, unique, props, nodes); -} - -function mask($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "mask", key, unique, props, nodes); -} - -function missingGlyph($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "missingGlyph", key, unique, props, nodes); -} - -function pattern($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "pattern", key, unique, props, nodes); -} - -function $$switch($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "switch", key, unique, props, nodes); -} - -function symbol($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "symbol", key, unique, props, nodes); -} - -function desc($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "desc", key, unique, props, nodes); -} - -function metadata($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "metadata", key, unique, props, nodes); -} - -function title($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "title", key, unique, props, nodes); -} - -function feBlend($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feBlend", key, unique, props, nodes); -} - -function feColorMatrix($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feColorMatrix", key, unique, props, nodes); -} - -function feComponentTransfer($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feComponentTransfer", key, unique, props, nodes); -} - -function feComposite($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feComposite", key, unique, props, nodes); -} - -function feConvolveMatrix($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feConvolveMatrix", key, unique, props, nodes); -} - -function feDiffuseLighting($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feDiffuseLighting", key, unique, props, nodes); -} - -function feDisplacementMap($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feDisplacementMap", key, unique, props, nodes); -} - -function feFlood($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feFlood", key, unique, props, nodes); -} - -function feFuncA($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feFuncA", key, unique, props, nodes); -} - -function feFuncB($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feFuncB", key, unique, props, nodes); -} - -function feFuncG($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feFuncG", key, unique, props, nodes); -} - -function feFuncR($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feFuncR", key, unique, props, nodes); -} - -function feGaussianBlur($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feGaussianBlur", key, unique, props, nodes); -} - -function feImage($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feImage", key, unique, props, nodes); -} - -function feMerge($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feMerge", key, unique, props, nodes); -} - -function feMergeNode($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feMergeNode", key, unique, props, nodes); -} - -function feMorphology($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feMorphology", key, unique, props, nodes); -} - -function feOffset($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feOffset", key, unique, props, nodes); -} - -function feSpecularLighting($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feSpecularLighting", key, unique, props, nodes); -} - -function feTile($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feTile", key, unique, props, nodes); -} - -function feTurbulence($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feTurbulence", key, unique, props, nodes); -} - -function font($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "font", key, unique, props, nodes); -} - -function fontFace($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "fontFace", key, unique, props, nodes); -} - -function fontFaceFormat($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "fontFaceFormat", key, unique, props, nodes); -} - -function fontFaceName($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "fontFaceName", key, unique, props, nodes); -} - -function fontFaceSrc($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "fontFaceSrc", key, unique, props, nodes); -} - -function fontFaceUri($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "fontFaceUri", key, unique, props, nodes); -} - -function hkern($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "hkern", key, unique, props, nodes); -} - -function vkern($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "vkern", key, unique, props, nodes); -} - -function linearGradient($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "linearGradient", key, unique, props, nodes); -} - -function radialGradient($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "radialGradient", key, unique, props, nodes); -} - -function stop($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "stop", key, unique, props, nodes); -} - -function circle($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "circle", key, unique, props, nodes); -} - -function ellipse($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "ellipse", key, unique, props, nodes); -} - -function svgimage($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "image", key, unique, props, nodes); -} - -function line($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "line", key, unique, props, nodes); -} - -function path($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "path", key, unique, props, nodes); -} - -function polygon($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "polygon", key, unique, props, nodes); -} - -function polyline($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "polyline", key, unique, props, nodes); -} - -function rect($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "rect", key, unique, props, nodes); -} - -function use($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "use", key, unique, props, nodes); -} - -function feDistantLight($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feDistantLight", key, unique, props, nodes); -} - -function fePointLight($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "fePointLight", key, unique, props, nodes); -} - -function feSpotLight($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "feSpotLight", key, unique, props, nodes); -} - -function altGlyph($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "altGlyph", key, unique, props, nodes); -} - -function altGlyphDef($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "altGlyphDef", key, unique, props, nodes); -} - -function altGlyphItem($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "altGlyphItem", key, unique, props, nodes); -} - -function glyph($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "glyph", key, unique, props, nodes); -} - -function glyphRef($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "glyphRef", key, unique, props, nodes); -} - -function textPath($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "textPath", key, unique, props, nodes); -} - -function text$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "text", key, unique, props, nodes); -} - -function tref($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "tref", key, unique, props, nodes); -} - -function tspan($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "tspan", key, unique, props, nodes); -} - -function clipPath($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "clipPath", key, unique, props, nodes); -} - -function svgcolorProfile($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "colorProfile", key, unique, props, nodes); -} - -function cursor($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "cursor", key, unique, props, nodes); -} - -function filter($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "filter", key, unique, props, nodes); -} - -function script($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "script", key, unique, props, nodes); -} - -function style($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "style", key, unique, props, nodes); -} - -function view($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode(svgNamespace, "view", key, unique, props, nodes); -} - -var Cmds = /* alias */0; - -var Attributes = /* alias */0; - -var Events = /* alias */0; - -var noNode = Vdom.noNode; - -exports.Cmds = Cmds; -exports.Attributes = Attributes; -exports.Events = Events; -exports.svgNamespace = svgNamespace; -exports.noNode = noNode; -exports.text = text; -exports.lazy1 = lazy1; -exports.node = node; -exports.svg = svg; -exports.foreignObject = foreignObject; -exports.animate = animate; -exports.animateColor = animateColor; -exports.animateMotion = animateMotion; -exports.animateTransform = animateTransform; -exports.mpath = mpath; -exports.set = set; -exports.a = a; -exports.defs = defs; -exports.g = g; -exports.marker = marker; -exports.mask = mask; -exports.missingGlyph = missingGlyph; -exports.pattern = pattern; -exports.$$switch = $$switch; -exports.symbol = symbol; -exports.desc = desc; -exports.metadata = metadata; -exports.title = title; -exports.feBlend = feBlend; -exports.feColorMatrix = feColorMatrix; -exports.feComponentTransfer = feComponentTransfer; -exports.feComposite = feComposite; -exports.feConvolveMatrix = feConvolveMatrix; -exports.feDiffuseLighting = feDiffuseLighting; -exports.feDisplacementMap = feDisplacementMap; -exports.feFlood = feFlood; -exports.feFuncA = feFuncA; -exports.feFuncB = feFuncB; -exports.feFuncG = feFuncG; -exports.feFuncR = feFuncR; -exports.feGaussianBlur = feGaussianBlur; -exports.feImage = feImage; -exports.feMerge = feMerge; -exports.feMergeNode = feMergeNode; -exports.feMorphology = feMorphology; -exports.feOffset = feOffset; -exports.feSpecularLighting = feSpecularLighting; -exports.feTile = feTile; -exports.feTurbulence = feTurbulence; -exports.font = font; -exports.fontFace = fontFace; -exports.fontFaceFormat = fontFaceFormat; -exports.fontFaceName = fontFaceName; -exports.fontFaceSrc = fontFaceSrc; -exports.fontFaceUri = fontFaceUri; -exports.hkern = hkern; -exports.vkern = vkern; -exports.linearGradient = linearGradient; -exports.radialGradient = radialGradient; -exports.stop = stop; -exports.circle = circle; -exports.ellipse = ellipse; -exports.svgimage = svgimage; -exports.line = line; -exports.path = path; -exports.polygon = polygon; -exports.polyline = polyline; -exports.rect = rect; -exports.use = use; -exports.feDistantLight = feDistantLight; -exports.fePointLight = fePointLight; -exports.feSpotLight = feSpotLight; -exports.altGlyph = altGlyph; -exports.altGlyphDef = altGlyphDef; -exports.altGlyphItem = altGlyphItem; -exports.glyph = glyph; -exports.glyphRef = glyphRef; -exports.textPath = textPath; -exports.text$prime = text$prime; -exports.tref = tref; -exports.tspan = tspan; -exports.clipPath = clipPath; -exports.svgcolorProfile = svgcolorProfile; -exports.cursor = cursor; -exports.filter = filter; -exports.script = script; -exports.style = style; -exports.view = view; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_svg_attributes.js b/lib/js/src-ocaml/tea_svg_attributes.js deleted file mode 100644 index 4eb30c3..0000000 --- a/lib/js/src-ocaml/tea_svg_attributes.js +++ /dev/null @@ -1,2283 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); - -function accentHeight(v) { - return /* Attribute */Block.__(1, [ - "", - "accent-height", - v - ]); -} - -function accelerate(v) { - return /* Attribute */Block.__(1, [ - "", - "accelerate", - v - ]); -} - -function accumulate(v) { - return /* Attribute */Block.__(1, [ - "", - "accumulate", - v - ]); -} - -function additive(v) { - return /* Attribute */Block.__(1, [ - "", - "additive", - v - ]); -} - -function alphabetic(v) { - return /* Attribute */Block.__(1, [ - "", - "alphabetic", - v - ]); -} - -function allowReorder(v) { - return /* Attribute */Block.__(1, [ - "", - "allowReorder", - v - ]); -} - -function amplitude(v) { - return /* Attribute */Block.__(1, [ - "", - "amplitude", - v - ]); -} - -function arabicForm(v) { - return /* Attribute */Block.__(1, [ - "", - "arabic-form", - v - ]); -} - -function ascent(v) { - return /* Attribute */Block.__(1, [ - "", - "ascent", - v - ]); -} - -function attributeName(v) { - return /* Attribute */Block.__(1, [ - "", - "attributeName", - v - ]); -} - -function attributeType(v) { - return /* Attribute */Block.__(1, [ - "", - "attributeType", - v - ]); -} - -function autoReverse(v) { - return /* Attribute */Block.__(1, [ - "", - "autoReverse", - v - ]); -} - -function azimuth(v) { - return /* Attribute */Block.__(1, [ - "", - "azimuth", - v - ]); -} - -function baseFrequency(v) { - return /* Attribute */Block.__(1, [ - "", - "baseFrequency", - v - ]); -} - -function baseProfile(v) { - return /* Attribute */Block.__(1, [ - "", - "baseProfile", - v - ]); -} - -function bbox(v) { - return /* Attribute */Block.__(1, [ - "", - "bbox", - v - ]); -} - -function begin$prime(v) { - return /* Attribute */Block.__(1, [ - "", - "begin", - v - ]); -} - -function bias(v) { - return /* Attribute */Block.__(1, [ - "", - "bias", - v - ]); -} - -function by(v) { - return /* Attribute */Block.__(1, [ - "", - "by", - v - ]); -} - -function calcMode(v) { - return /* Attribute */Block.__(1, [ - "", - "calcMode", - v - ]); -} - -function capHeight(v) { - return /* Attribute */Block.__(1, [ - "", - "cap-height", - v - ]); -} - -function class$prime(v) { - return /* Attribute */Block.__(1, [ - "", - "class", - v - ]); -} - -function clipPathUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "clipPathUnits", - v - ]); -} - -function contentScriptType(v) { - return /* Attribute */Block.__(1, [ - "", - "contentScriptType", - v - ]); -} - -function contentStyleType(v) { - return /* Attribute */Block.__(1, [ - "", - "contentStyleType", - v - ]); -} - -function cx(v) { - return /* Attribute */Block.__(1, [ - "", - "cx", - v - ]); -} - -function cy(v) { - return /* Attribute */Block.__(1, [ - "", - "cy", - v - ]); -} - -function d(v) { - return /* Attribute */Block.__(1, [ - "", - "d", - v - ]); -} - -function decelerate(v) { - return /* Attribute */Block.__(1, [ - "", - "decelerate", - v - ]); -} - -function descent(v) { - return /* Attribute */Block.__(1, [ - "", - "descent", - v - ]); -} - -function diffuseConstant(v) { - return /* Attribute */Block.__(1, [ - "", - "diffuseConstant", - v - ]); -} - -function divisor(v) { - return /* Attribute */Block.__(1, [ - "", - "divisor", - v - ]); -} - -function dur(v) { - return /* Attribute */Block.__(1, [ - "", - "dur", - v - ]); -} - -function dx(v) { - return /* Attribute */Block.__(1, [ - "", - "dx", - v - ]); -} - -function dy(v) { - return /* Attribute */Block.__(1, [ - "", - "dy", - v - ]); -} - -function edgeMode(v) { - return /* Attribute */Block.__(1, [ - "", - "edgeMode", - v - ]); -} - -function elevation(v) { - return /* Attribute */Block.__(1, [ - "", - "elevation", - v - ]); -} - -function end$prime(v) { - return /* Attribute */Block.__(1, [ - "", - "end", - v - ]); -} - -function exponent(v) { - return /* Attribute */Block.__(1, [ - "", - "exponent", - v - ]); -} - -function externalResourcesRequired(v) { - return /* Attribute */Block.__(1, [ - "", - "externalResourcesRequired", - v - ]); -} - -function filterRes(v) { - return /* Attribute */Block.__(1, [ - "", - "filterRes", - v - ]); -} - -function filterUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "filterUnits", - v - ]); -} - -function format(v) { - return /* Attribute */Block.__(1, [ - "", - "format", - v - ]); -} - -function from(v) { - return /* Attribute */Block.__(1, [ - "", - "from", - v - ]); -} - -function fx(v) { - return /* Attribute */Block.__(1, [ - "", - "fx", - v - ]); -} - -function fy(v) { - return /* Attribute */Block.__(1, [ - "", - "fy", - v - ]); -} - -function g1(v) { - return /* Attribute */Block.__(1, [ - "", - "g1", - v - ]); -} - -function g2(v) { - return /* Attribute */Block.__(1, [ - "", - "g2", - v - ]); -} - -function glyphName(v) { - return /* Attribute */Block.__(1, [ - "", - "glyph-name", - v - ]); -} - -function glyphRef(v) { - return /* Attribute */Block.__(1, [ - "", - "glyphRef", - v - ]); -} - -function gradientTransform(v) { - return /* Attribute */Block.__(1, [ - "", - "gradientTransform", - v - ]); -} - -function gradientUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "gradientUnits", - v - ]); -} - -function hanging(v) { - return /* Attribute */Block.__(1, [ - "", - "hanging", - v - ]); -} - -function height(v) { - return /* Attribute */Block.__(1, [ - "", - "height", - v - ]); -} - -function horizAdvX(v) { - return /* Attribute */Block.__(1, [ - "", - "horiz-adv-x", - v - ]); -} - -function horizOriginX(v) { - return /* Attribute */Block.__(1, [ - "", - "horiz-origin-x", - v - ]); -} - -function horizOriginY(v) { - return /* Attribute */Block.__(1, [ - "", - "horiz-origin-y", - v - ]); -} - -function id(v) { - return /* Attribute */Block.__(1, [ - "", - "id", - v - ]); -} - -function ideographic(v) { - return /* Attribute */Block.__(1, [ - "", - "ideographic", - v - ]); -} - -function in$prime(v) { - return /* Attribute */Block.__(1, [ - "", - "in", - v - ]); -} - -function in2(v) { - return /* Attribute */Block.__(1, [ - "", - "in2", - v - ]); -} - -function intercept(v) { - return /* Attribute */Block.__(1, [ - "", - "intercept", - v - ]); -} - -function k(v) { - return /* Attribute */Block.__(1, [ - "", - "k", - v - ]); -} - -function k1(v) { - return /* Attribute */Block.__(1, [ - "", - "k1", - v - ]); -} - -function k2(v) { - return /* Attribute */Block.__(1, [ - "", - "k2", - v - ]); -} - -function k3(v) { - return /* Attribute */Block.__(1, [ - "", - "k3", - v - ]); -} - -function k4(v) { - return /* Attribute */Block.__(1, [ - "", - "k4", - v - ]); -} - -function kernelMatrix(v) { - return /* Attribute */Block.__(1, [ - "", - "kernelMatrix", - v - ]); -} - -function kernelUnitLength(v) { - return /* Attribute */Block.__(1, [ - "", - "kernelUnitLength", - v - ]); -} - -function keyPoints(v) { - return /* Attribute */Block.__(1, [ - "", - "keyPoints", - v - ]); -} - -function keySplines(v) { - return /* Attribute */Block.__(1, [ - "", - "keySplines", - v - ]); -} - -function keyTimes(v) { - return /* Attribute */Block.__(1, [ - "", - "keyTimes", - v - ]); -} - -function lang(v) { - return /* Attribute */Block.__(1, [ - "", - "lang", - v - ]); -} - -function lengthAdjust(v) { - return /* Attribute */Block.__(1, [ - "", - "lengthAdjust", - v - ]); -} - -function limitingConeAngle(v) { - return /* Attribute */Block.__(1, [ - "", - "limitingConeAngle", - v - ]); -} - -function local(v) { - return /* Attribute */Block.__(1, [ - "", - "local", - v - ]); -} - -function markerHeight(v) { - return /* Attribute */Block.__(1, [ - "", - "markerHeight", - v - ]); -} - -function markerUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "markerUnits", - v - ]); -} - -function markerWidth(v) { - return /* Attribute */Block.__(1, [ - "", - "markerWidth", - v - ]); -} - -function maskContentUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "maskContentUnits", - v - ]); -} - -function maskUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "maskUnits", - v - ]); -} - -function mathematical(v) { - return /* Attribute */Block.__(1, [ - "", - "mathematical", - v - ]); -} - -function max(v) { - return /* Attribute */Block.__(1, [ - "", - "max", - v - ]); -} - -function media(v) { - return /* Attribute */Block.__(1, [ - "", - "media", - v - ]); -} - -function method$prime(v) { - return /* Attribute */Block.__(1, [ - "", - "method", - v - ]); -} - -function min(v) { - return /* Attribute */Block.__(1, [ - "", - "min", - v - ]); -} - -function mode(v) { - return /* Attribute */Block.__(1, [ - "", - "mode", - v - ]); -} - -function name(v) { - return /* Attribute */Block.__(1, [ - "", - "name", - v - ]); -} - -function numOctaves(v) { - return /* Attribute */Block.__(1, [ - "", - "numOctaves", - v - ]); -} - -function offset(v) { - return /* Attribute */Block.__(1, [ - "", - "offset", - v - ]); -} - -function operator(v) { - return /* Attribute */Block.__(1, [ - "", - "operator", - v - ]); -} - -function order(v) { - return /* Attribute */Block.__(1, [ - "", - "order", - v - ]); -} - -function orient(v) { - return /* Attribute */Block.__(1, [ - "", - "orient", - v - ]); -} - -function orientation(v) { - return /* Attribute */Block.__(1, [ - "", - "orientation", - v - ]); -} - -function origin(v) { - return /* Attribute */Block.__(1, [ - "", - "origin", - v - ]); -} - -function overlinePosition(v) { - return /* Attribute */Block.__(1, [ - "", - "overline-position", - v - ]); -} - -function overlineThickness(v) { - return /* Attribute */Block.__(1, [ - "", - "overline-thickness", - v - ]); -} - -function panose1(v) { - return /* Attribute */Block.__(1, [ - "", - "panose-1", - v - ]); -} - -function path(v) { - return /* Attribute */Block.__(1, [ - "", - "path", - v - ]); -} - -function pathLength(v) { - return /* Attribute */Block.__(1, [ - "", - "pathLength", - v - ]); -} - -function patternContentUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "patternContentUnits", - v - ]); -} - -function patternTransform(v) { - return /* Attribute */Block.__(1, [ - "", - "patternTransform", - v - ]); -} - -function patternUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "patternUnits", - v - ]); -} - -function pointOrder(v) { - return /* Attribute */Block.__(1, [ - "", - "point-order", - v - ]); -} - -function points(v) { - return /* Attribute */Block.__(1, [ - "", - "points", - v - ]); -} - -function pointsAtX(v) { - return /* Attribute */Block.__(1, [ - "", - "pointsAtX", - v - ]); -} - -function pointsAtY(v) { - return /* Attribute */Block.__(1, [ - "", - "pointsAtY", - v - ]); -} - -function pointsAtZ(v) { - return /* Attribute */Block.__(1, [ - "", - "pointsAtZ", - v - ]); -} - -function preserveAlpha(v) { - return /* Attribute */Block.__(1, [ - "", - "preserveAlpha", - v - ]); -} - -function preserveAspectRatio(v) { - return /* Attribute */Block.__(1, [ - "", - "preserveAspectRatio", - v - ]); -} - -function primitiveUnits(v) { - return /* Attribute */Block.__(1, [ - "", - "primitiveUnits", - v - ]); -} - -function r(v) { - return /* Attribute */Block.__(1, [ - "", - "r", - v - ]); -} - -function radius(v) { - return /* Attribute */Block.__(1, [ - "", - "radius", - v - ]); -} - -function refX(v) { - return /* Attribute */Block.__(1, [ - "", - "refX", - v - ]); -} - -function refY(v) { - return /* Attribute */Block.__(1, [ - "", - "refY", - v - ]); -} - -function renderingIntent(v) { - return /* Attribute */Block.__(1, [ - "", - "rendering-intent", - v - ]); -} - -function repeatCount(v) { - return /* Attribute */Block.__(1, [ - "", - "repeatCount", - v - ]); -} - -function repeatDur(v) { - return /* Attribute */Block.__(1, [ - "", - "repeatDur", - v - ]); -} - -function requiredExtensions(v) { - return /* Attribute */Block.__(1, [ - "", - "requiredExtensions", - v - ]); -} - -function requiredFeatures(v) { - return /* Attribute */Block.__(1, [ - "", - "requiredFeatures", - v - ]); -} - -function restart(v) { - return /* Attribute */Block.__(1, [ - "", - "restart", - v - ]); -} - -function result(v) { - return /* Attribute */Block.__(1, [ - "", - "result", - v - ]); -} - -function rotate(v) { - return /* Attribute */Block.__(1, [ - "", - "rotate", - v - ]); -} - -function rx(v) { - return /* Attribute */Block.__(1, [ - "", - "rx", - v - ]); -} - -function ry(v) { - return /* Attribute */Block.__(1, [ - "", - "ry", - v - ]); -} - -function scale(v) { - return /* Attribute */Block.__(1, [ - "", - "scale", - v - ]); -} - -function seed(v) { - return /* Attribute */Block.__(1, [ - "", - "seed", - v - ]); -} - -function slope(v) { - return /* Attribute */Block.__(1, [ - "", - "slope", - v - ]); -} - -function spacing(v) { - return /* Attribute */Block.__(1, [ - "", - "spacing", - v - ]); -} - -function specularConstant(v) { - return /* Attribute */Block.__(1, [ - "", - "specularConstant", - v - ]); -} - -function specularExponent(v) { - return /* Attribute */Block.__(1, [ - "", - "specularExponent", - v - ]); -} - -function speed(v) { - return /* Attribute */Block.__(1, [ - "", - "speed", - v - ]); -} - -function spreadMethod(v) { - return /* Attribute */Block.__(1, [ - "", - "spreadMethod", - v - ]); -} - -function startOffset(v) { - return /* Attribute */Block.__(1, [ - "", - "startOffset", - v - ]); -} - -function stdDeviation(v) { - return /* Attribute */Block.__(1, [ - "", - "stdDeviation", - v - ]); -} - -function stemh(v) { - return /* Attribute */Block.__(1, [ - "", - "stemh", - v - ]); -} - -function stemv(v) { - return /* Attribute */Block.__(1, [ - "", - "stemv", - v - ]); -} - -function stitchTiles(v) { - return /* Attribute */Block.__(1, [ - "", - "stitchTiles", - v - ]); -} - -function strikethroughPosition(v) { - return /* Attribute */Block.__(1, [ - "", - "strikethrough-position", - v - ]); -} - -function strikethroughThickness(v) { - return /* Attribute */Block.__(1, [ - "", - "strikethrough-thickness", - v - ]); -} - -function string(v) { - return /* Attribute */Block.__(1, [ - "", - "string", - v - ]); -} - -function style(v) { - return /* Attribute */Block.__(1, [ - "", - "style", - v - ]); -} - -function surfaceScale(v) { - return /* Attribute */Block.__(1, [ - "", - "surfaceScale", - v - ]); -} - -function systemLanguage(v) { - return /* Attribute */Block.__(1, [ - "", - "systemLanguage", - v - ]); -} - -function tableValues(v) { - return /* Attribute */Block.__(1, [ - "", - "tableValues", - v - ]); -} - -function target(v) { - return /* Attribute */Block.__(1, [ - "", - "target", - v - ]); -} - -function targetX(v) { - return /* Attribute */Block.__(1, [ - "", - "targetX", - v - ]); -} - -function targetY(v) { - return /* Attribute */Block.__(1, [ - "", - "targetY", - v - ]); -} - -function textLength(v) { - return /* Attribute */Block.__(1, [ - "", - "textLength", - v - ]); -} - -function title(v) { - return /* Attribute */Block.__(1, [ - "", - "title", - v - ]); -} - -function to$prime(v) { - return /* Attribute */Block.__(1, [ - "", - "to", - v - ]); -} - -function transform(v) { - return /* Attribute */Block.__(1, [ - "", - "transform", - v - ]); -} - -function type$prime(v) { - return /* Attribute */Block.__(1, [ - "", - "type", - v - ]); -} - -function u1(v) { - return /* Attribute */Block.__(1, [ - "", - "u1", - v - ]); -} - -function u2(v) { - return /* Attribute */Block.__(1, [ - "", - "u2", - v - ]); -} - -function underlinePosition(v) { - return /* Attribute */Block.__(1, [ - "", - "underline-position", - v - ]); -} - -function underlineThickness(v) { - return /* Attribute */Block.__(1, [ - "", - "underline-thickness", - v - ]); -} - -function unicode(v) { - return /* Attribute */Block.__(1, [ - "", - "unicode", - v - ]); -} - -function unicodeRange(v) { - return /* Attribute */Block.__(1, [ - "", - "unicode-range", - v - ]); -} - -function unitsPerEm(v) { - return /* Attribute */Block.__(1, [ - "", - "units-per-em", - v - ]); -} - -function vAlphabetic(v) { - return /* Attribute */Block.__(1, [ - "", - "v-alphabetic", - v - ]); -} - -function vHanging(v) { - return /* Attribute */Block.__(1, [ - "", - "v-hanging", - v - ]); -} - -function vIdeographic(v) { - return /* Attribute */Block.__(1, [ - "", - "v-ideographic", - v - ]); -} - -function vMathematical(v) { - return /* Attribute */Block.__(1, [ - "", - "v-mathematical", - v - ]); -} - -function values(v) { - return /* Attribute */Block.__(1, [ - "", - "values", - v - ]); -} - -function version(v) { - return /* Attribute */Block.__(1, [ - "", - "version", - v - ]); -} - -function vertAdvY(v) { - return /* Attribute */Block.__(1, [ - "", - "vert-adv-y", - v - ]); -} - -function vertOriginX(v) { - return /* Attribute */Block.__(1, [ - "", - "vert-origin-x", - v - ]); -} - -function vertOriginY(v) { - return /* Attribute */Block.__(1, [ - "", - "vert-origin-y", - v - ]); -} - -function viewBox(v) { - return /* Attribute */Block.__(1, [ - "", - "viewBox", - v - ]); -} - -function viewTarget(v) { - return /* Attribute */Block.__(1, [ - "", - "viewTarget", - v - ]); -} - -function width(v) { - return /* Attribute */Block.__(1, [ - "", - "width", - v - ]); -} - -function widths(v) { - return /* Attribute */Block.__(1, [ - "", - "widths", - v - ]); -} - -function x(v) { - return /* Attribute */Block.__(1, [ - "", - "x", - v - ]); -} - -function xHeight(v) { - return /* Attribute */Block.__(1, [ - "", - "x-height", - v - ]); -} - -function x1(v) { - return /* Attribute */Block.__(1, [ - "", - "x1", - v - ]); -} - -function x2(v) { - return /* Attribute */Block.__(1, [ - "", - "x2", - v - ]); -} - -function xChannelSelector(v) { - return /* Attribute */Block.__(1, [ - "", - "xChannelSelector", - v - ]); -} - -function xlinkActuate(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/1999/xlink", - "xlink:actuate", - v - ]); -} - -function xlinkArcrole(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/1999/xlink", - "xlink:arcrole", - v - ]); -} - -function xlinkHref(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/1999/xlink", - "xlink:href", - v - ]); -} - -function xlinkRole(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/1999/xlink", - "xlink:role", - v - ]); -} - -function xlinkShow(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/1999/xlink", - "xlink:show", - v - ]); -} - -function xlinkTitle(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/1999/xlink", - "xlink:title", - v - ]); -} - -function xlinkType(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/1999/xlink", - "xlink:type", - v - ]); -} - -function xmlBase(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/XML/1998/namespace", - "xml:base", - v - ]); -} - -function xmlLang(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/XML/1998/namespace", - "xml:lang", - v - ]); -} - -function xmlSpace(v) { - return /* Attribute */Block.__(1, [ - "http://www.w3.org/XML/1998/namespace", - "xml:space", - v - ]); -} - -function y(v) { - return /* Attribute */Block.__(1, [ - "", - "y", - v - ]); -} - -function y1(v) { - return /* Attribute */Block.__(1, [ - "", - "y1", - v - ]); -} - -function y2(v) { - return /* Attribute */Block.__(1, [ - "", - "y2", - v - ]); -} - -function yChannelSelector(v) { - return /* Attribute */Block.__(1, [ - "", - "yChannelSelector", - v - ]); -} - -function z(v) { - return /* Attribute */Block.__(1, [ - "", - "z", - v - ]); -} - -function zoomAndPan(v) { - return /* Attribute */Block.__(1, [ - "", - "zoomAndPan", - v - ]); -} - -function alignmentBaseline(v) { - return /* Attribute */Block.__(1, [ - "", - "alignment-baseline", - v - ]); -} - -function baselineShift(v) { - return /* Attribute */Block.__(1, [ - "", - "baseline-shift", - v - ]); -} - -function clipPath(v) { - return /* Attribute */Block.__(1, [ - "", - "clip-path", - v - ]); -} - -function clipRule(v) { - return /* Attribute */Block.__(1, [ - "", - "clip-rule", - v - ]); -} - -function clip(v) { - return /* Attribute */Block.__(1, [ - "", - "clip", - v - ]); -} - -function colorInterpolationFilters(v) { - return /* Attribute */Block.__(1, [ - "", - "color-interpolation-filters", - v - ]); -} - -function colorInterpolation(v) { - return /* Attribute */Block.__(1, [ - "", - "color-interpolation", - v - ]); -} - -function colorProfile(v) { - return /* Attribute */Block.__(1, [ - "", - "color-profile", - v - ]); -} - -function colorRendering(v) { - return /* Attribute */Block.__(1, [ - "", - "color-rendering", - v - ]); -} - -function color(v) { - return /* Attribute */Block.__(1, [ - "", - "color", - v - ]); -} - -function cursor(v) { - return /* Attribute */Block.__(1, [ - "", - "cursor", - v - ]); -} - -function direction(v) { - return /* Attribute */Block.__(1, [ - "", - "direction", - v - ]); -} - -function display(v) { - return /* Attribute */Block.__(1, [ - "", - "display", - v - ]); -} - -function dominantBaseline(v) { - return /* Attribute */Block.__(1, [ - "", - "dominant-baseline", - v - ]); -} - -function enableBackground(v) { - return /* Attribute */Block.__(1, [ - "", - "enable-background", - v - ]); -} - -function fillOpacity(v) { - return /* Attribute */Block.__(1, [ - "", - "fill-opacity", - v - ]); -} - -function fillRule(v) { - return /* Attribute */Block.__(1, [ - "", - "fill-rule", - v - ]); -} - -function fill(v) { - return /* Attribute */Block.__(1, [ - "", - "fill", - v - ]); -} - -function filter(v) { - return /* Attribute */Block.__(1, [ - "", - "filter", - v - ]); -} - -function floodColor(v) { - return /* Attribute */Block.__(1, [ - "", - "flood-color", - v - ]); -} - -function floodOpacity(v) { - return /* Attribute */Block.__(1, [ - "", - "flood-opacity", - v - ]); -} - -function fontFamily(v) { - return /* Attribute */Block.__(1, [ - "", - "font-family", - v - ]); -} - -function fontSizeAdjust(v) { - return /* Attribute */Block.__(1, [ - "", - "font-size-adjust", - v - ]); -} - -function fontSize(v) { - return /* Attribute */Block.__(1, [ - "", - "font-size", - v - ]); -} - -function fontStretch(v) { - return /* Attribute */Block.__(1, [ - "", - "font-stretch", - v - ]); -} - -function fontStyle(v) { - return /* Attribute */Block.__(1, [ - "", - "font-style", - v - ]); -} - -function fontVariant(v) { - return /* Attribute */Block.__(1, [ - "", - "font-variant", - v - ]); -} - -function fontWeight(v) { - return /* Attribute */Block.__(1, [ - "", - "font-weight", - v - ]); -} - -function glyphOrientationHorizontal(v) { - return /* Attribute */Block.__(1, [ - "", - "glyph-orientation-horizontal", - v - ]); -} - -function glyphOrientationVertical(v) { - return /* Attribute */Block.__(1, [ - "", - "glyph-orientation-vertical", - v - ]); -} - -function imageRendering(v) { - return /* Attribute */Block.__(1, [ - "", - "image-rendering", - v - ]); -} - -function kerning(v) { - return /* Attribute */Block.__(1, [ - "", - "kerning", - v - ]); -} - -function letterSpacing(v) { - return /* Attribute */Block.__(1, [ - "", - "letter-spacing", - v - ]); -} - -function lightingColor(v) { - return /* Attribute */Block.__(1, [ - "", - "lighting-color", - v - ]); -} - -function markerEnd(v) { - return /* Attribute */Block.__(1, [ - "", - "marker-end", - v - ]); -} - -function markerMid(v) { - return /* Attribute */Block.__(1, [ - "", - "marker-mid", - v - ]); -} - -function markerStart(v) { - return /* Attribute */Block.__(1, [ - "", - "marker-start", - v - ]); -} - -function mask(v) { - return /* Attribute */Block.__(1, [ - "", - "mask", - v - ]); -} - -function opacity(v) { - return /* Attribute */Block.__(1, [ - "", - "opacity", - v - ]); -} - -function overflow(v) { - return /* Attribute */Block.__(1, [ - "", - "overflow", - v - ]); -} - -function pointerEvents(v) { - return /* Attribute */Block.__(1, [ - "", - "pointer-events", - v - ]); -} - -function shapeRendering(v) { - return /* Attribute */Block.__(1, [ - "", - "shape-rendering", - v - ]); -} - -function stopColor(v) { - return /* Attribute */Block.__(1, [ - "", - "stop-color", - v - ]); -} - -function stopOpacity(v) { - return /* Attribute */Block.__(1, [ - "", - "stop-opacity", - v - ]); -} - -function strokeDasharray(v) { - return /* Attribute */Block.__(1, [ - "", - "stroke-dasharray", - v - ]); -} - -function strokeDashoffset(v) { - return /* Attribute */Block.__(1, [ - "", - "stroke-dashoffset", - v - ]); -} - -function strokeLinecap(v) { - return /* Attribute */Block.__(1, [ - "", - "stroke-linecap", - v - ]); -} - -function strokeLinejoin(v) { - return /* Attribute */Block.__(1, [ - "", - "stroke-linejoin", - v - ]); -} - -function strokeMiterlimit(v) { - return /* Attribute */Block.__(1, [ - "", - "stroke-miterlimit", - v - ]); -} - -function strokeOpacity(v) { - return /* Attribute */Block.__(1, [ - "", - "stroke-opacity", - v - ]); -} - -function strokeWidth(v) { - return /* Attribute */Block.__(1, [ - "", - "stroke-width", - v - ]); -} - -function stroke(v) { - return /* Attribute */Block.__(1, [ - "", - "stroke", - v - ]); -} - -function textAnchor(v) { - return /* Attribute */Block.__(1, [ - "", - "text-anchor", - v - ]); -} - -function textDecoration(v) { - return /* Attribute */Block.__(1, [ - "", - "text-decoration", - v - ]); -} - -function textRendering(v) { - return /* Attribute */Block.__(1, [ - "", - "text-rendering", - v - ]); -} - -function unicodeBidi(v) { - return /* Attribute */Block.__(1, [ - "", - "unicode-bidi", - v - ]); -} - -function visibility(v) { - return /* Attribute */Block.__(1, [ - "", - "visibility", - v - ]); -} - -function wordSpacing(v) { - return /* Attribute */Block.__(1, [ - "", - "word-spacing", - v - ]); -} - -function writingMode(v) { - return /* Attribute */Block.__(1, [ - "", - "writing-mode", - v - ]); -} - -exports.accentHeight = accentHeight; -exports.accelerate = accelerate; -exports.accumulate = accumulate; -exports.additive = additive; -exports.alphabetic = alphabetic; -exports.allowReorder = allowReorder; -exports.amplitude = amplitude; -exports.arabicForm = arabicForm; -exports.ascent = ascent; -exports.attributeName = attributeName; -exports.attributeType = attributeType; -exports.autoReverse = autoReverse; -exports.azimuth = azimuth; -exports.baseFrequency = baseFrequency; -exports.baseProfile = baseProfile; -exports.bbox = bbox; -exports.begin$prime = begin$prime; -exports.bias = bias; -exports.by = by; -exports.calcMode = calcMode; -exports.capHeight = capHeight; -exports.class$prime = class$prime; -exports.clipPathUnits = clipPathUnits; -exports.contentScriptType = contentScriptType; -exports.contentStyleType = contentStyleType; -exports.cx = cx; -exports.cy = cy; -exports.d = d; -exports.decelerate = decelerate; -exports.descent = descent; -exports.diffuseConstant = diffuseConstant; -exports.divisor = divisor; -exports.dur = dur; -exports.dx = dx; -exports.dy = dy; -exports.edgeMode = edgeMode; -exports.elevation = elevation; -exports.end$prime = end$prime; -exports.exponent = exponent; -exports.externalResourcesRequired = externalResourcesRequired; -exports.filterRes = filterRes; -exports.filterUnits = filterUnits; -exports.format = format; -exports.from = from; -exports.fx = fx; -exports.fy = fy; -exports.g1 = g1; -exports.g2 = g2; -exports.glyphName = glyphName; -exports.glyphRef = glyphRef; -exports.gradientTransform = gradientTransform; -exports.gradientUnits = gradientUnits; -exports.hanging = hanging; -exports.height = height; -exports.horizAdvX = horizAdvX; -exports.horizOriginX = horizOriginX; -exports.horizOriginY = horizOriginY; -exports.id = id; -exports.ideographic = ideographic; -exports.in$prime = in$prime; -exports.in2 = in2; -exports.intercept = intercept; -exports.k = k; -exports.k1 = k1; -exports.k2 = k2; -exports.k3 = k3; -exports.k4 = k4; -exports.kernelMatrix = kernelMatrix; -exports.kernelUnitLength = kernelUnitLength; -exports.keyPoints = keyPoints; -exports.keySplines = keySplines; -exports.keyTimes = keyTimes; -exports.lang = lang; -exports.lengthAdjust = lengthAdjust; -exports.limitingConeAngle = limitingConeAngle; -exports.local = local; -exports.markerHeight = markerHeight; -exports.markerUnits = markerUnits; -exports.markerWidth = markerWidth; -exports.maskContentUnits = maskContentUnits; -exports.maskUnits = maskUnits; -exports.mathematical = mathematical; -exports.max = max; -exports.media = media; -exports.method$prime = method$prime; -exports.min = min; -exports.mode = mode; -exports.name = name; -exports.numOctaves = numOctaves; -exports.offset = offset; -exports.operator = operator; -exports.order = order; -exports.orient = orient; -exports.orientation = orientation; -exports.origin = origin; -exports.overlinePosition = overlinePosition; -exports.overlineThickness = overlineThickness; -exports.panose1 = panose1; -exports.path = path; -exports.pathLength = pathLength; -exports.patternContentUnits = patternContentUnits; -exports.patternTransform = patternTransform; -exports.patternUnits = patternUnits; -exports.pointOrder = pointOrder; -exports.points = points; -exports.pointsAtX = pointsAtX; -exports.pointsAtY = pointsAtY; -exports.pointsAtZ = pointsAtZ; -exports.preserveAlpha = preserveAlpha; -exports.preserveAspectRatio = preserveAspectRatio; -exports.primitiveUnits = primitiveUnits; -exports.r = r; -exports.radius = radius; -exports.refX = refX; -exports.refY = refY; -exports.renderingIntent = renderingIntent; -exports.repeatCount = repeatCount; -exports.repeatDur = repeatDur; -exports.requiredExtensions = requiredExtensions; -exports.requiredFeatures = requiredFeatures; -exports.restart = restart; -exports.result = result; -exports.rotate = rotate; -exports.rx = rx; -exports.ry = ry; -exports.scale = scale; -exports.seed = seed; -exports.slope = slope; -exports.spacing = spacing; -exports.specularConstant = specularConstant; -exports.specularExponent = specularExponent; -exports.speed = speed; -exports.spreadMethod = spreadMethod; -exports.startOffset = startOffset; -exports.stdDeviation = stdDeviation; -exports.stemh = stemh; -exports.stemv = stemv; -exports.stitchTiles = stitchTiles; -exports.strikethroughPosition = strikethroughPosition; -exports.strikethroughThickness = strikethroughThickness; -exports.string = string; -exports.style = style; -exports.surfaceScale = surfaceScale; -exports.systemLanguage = systemLanguage; -exports.tableValues = tableValues; -exports.target = target; -exports.targetX = targetX; -exports.targetY = targetY; -exports.textLength = textLength; -exports.title = title; -exports.to$prime = to$prime; -exports.transform = transform; -exports.type$prime = type$prime; -exports.u1 = u1; -exports.u2 = u2; -exports.underlinePosition = underlinePosition; -exports.underlineThickness = underlineThickness; -exports.unicode = unicode; -exports.unicodeRange = unicodeRange; -exports.unitsPerEm = unitsPerEm; -exports.vAlphabetic = vAlphabetic; -exports.vHanging = vHanging; -exports.vIdeographic = vIdeographic; -exports.vMathematical = vMathematical; -exports.values = values; -exports.version = version; -exports.vertAdvY = vertAdvY; -exports.vertOriginX = vertOriginX; -exports.vertOriginY = vertOriginY; -exports.viewBox = viewBox; -exports.viewTarget = viewTarget; -exports.width = width; -exports.widths = widths; -exports.x = x; -exports.xHeight = xHeight; -exports.x1 = x1; -exports.x2 = x2; -exports.xChannelSelector = xChannelSelector; -exports.xlinkActuate = xlinkActuate; -exports.xlinkArcrole = xlinkArcrole; -exports.xlinkHref = xlinkHref; -exports.xlinkRole = xlinkRole; -exports.xlinkShow = xlinkShow; -exports.xlinkTitle = xlinkTitle; -exports.xlinkType = xlinkType; -exports.xmlBase = xmlBase; -exports.xmlLang = xmlLang; -exports.xmlSpace = xmlSpace; -exports.y = y; -exports.y1 = y1; -exports.y2 = y2; -exports.yChannelSelector = yChannelSelector; -exports.z = z; -exports.zoomAndPan = zoomAndPan; -exports.alignmentBaseline = alignmentBaseline; -exports.baselineShift = baselineShift; -exports.clipPath = clipPath; -exports.clipRule = clipRule; -exports.clip = clip; -exports.colorInterpolationFilters = colorInterpolationFilters; -exports.colorInterpolation = colorInterpolation; -exports.colorProfile = colorProfile; -exports.colorRendering = colorRendering; -exports.color = color; -exports.cursor = cursor; -exports.direction = direction; -exports.display = display; -exports.dominantBaseline = dominantBaseline; -exports.enableBackground = enableBackground; -exports.fillOpacity = fillOpacity; -exports.fillRule = fillRule; -exports.fill = fill; -exports.filter = filter; -exports.floodColor = floodColor; -exports.floodOpacity = floodOpacity; -exports.fontFamily = fontFamily; -exports.fontSizeAdjust = fontSizeAdjust; -exports.fontSize = fontSize; -exports.fontStretch = fontStretch; -exports.fontStyle = fontStyle; -exports.fontVariant = fontVariant; -exports.fontWeight = fontWeight; -exports.glyphOrientationHorizontal = glyphOrientationHorizontal; -exports.glyphOrientationVertical = glyphOrientationVertical; -exports.imageRendering = imageRendering; -exports.kerning = kerning; -exports.letterSpacing = letterSpacing; -exports.lightingColor = lightingColor; -exports.markerEnd = markerEnd; -exports.markerMid = markerMid; -exports.markerStart = markerStart; -exports.mask = mask; -exports.opacity = opacity; -exports.overflow = overflow; -exports.pointerEvents = pointerEvents; -exports.shapeRendering = shapeRendering; -exports.stopColor = stopColor; -exports.stopOpacity = stopOpacity; -exports.strokeDasharray = strokeDasharray; -exports.strokeDashoffset = strokeDashoffset; -exports.strokeLinecap = strokeLinecap; -exports.strokeLinejoin = strokeLinejoin; -exports.strokeMiterlimit = strokeMiterlimit; -exports.strokeOpacity = strokeOpacity; -exports.strokeWidth = strokeWidth; -exports.stroke = stroke; -exports.textAnchor = textAnchor; -exports.textDecoration = textDecoration; -exports.textRendering = textRendering; -exports.unicodeBidi = unicodeBidi; -exports.visibility = visibility; -exports.wordSpacing = wordSpacing; -exports.writingMode = writingMode; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_svg_events.js b/lib/js/src-ocaml/tea_svg_events.js deleted file mode 100644 index 40fed0f..0000000 --- a/lib/js/src-ocaml/tea_svg_events.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/src-ocaml/tea_task.js b/lib/js/src-ocaml/tea_task.js deleted file mode 100644 index 73b8222..0000000 --- a/lib/js/src-ocaml/tea_task.js +++ /dev/null @@ -1,475 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function nothing(param) { - return /* () */0; -} - -function performOpt(toOptionalMessage, param) { - var task = param[0]; - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - return Curry._1(task, (function (param) { - if (param.tag) { - throw [ - Caml_builtin_exceptions.failure, - "ERROR: Task perfom returned error of never! Should not happen!" - ]; - } else { - var match = Curry._1(toOptionalMessage, param[0]); - if (match !== undefined) { - return Curry._1(callbacks.contents.enqueue, Caml_option.valFromOption(match)); - } else { - return /* () */0; - } - } - })); - })]); -} - -function perform(toMessage, task) { - return performOpt((function (v) { - return Caml_option.some(Curry._1(toMessage, v)); - }), task); -} - -function attemptOpt(resultToOptionalMessage, param) { - var task = param[0]; - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - return Curry._1(task, (function (value) { - var match = Curry._1(resultToOptionalMessage, value); - if (match !== undefined) { - return Curry._1(callbacks.contents.enqueue, Caml_option.valFromOption(match)); - } else { - return /* () */0; - } - })); - })]); -} - -function attempt(resultToMessage, task) { - return attemptOpt((function (v) { - return Caml_option.some(Curry._1(resultToMessage, v)); - }), task); -} - -function ignore(task) { - return attemptOpt((function (param) { - return ; - }), task); -} - -function succeed(value) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; -} - -function fail(value) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [value])); - })]; -} - -function nativeBinding(func) { - return /* Task */[func]; -} - -function andThen(fn, param) { - var task = param[0]; - return /* Task */[(function (cb) { - return Curry._1(task, (function (err) { - if (err.tag) { - return Curry._1(cb, err); - } else { - var match = Curry._1(fn, err[0]); - return Curry._1(match[0], cb); - } - })); - })]; -} - -function onError(fn, param) { - var task = param[0]; - return /* Task */[(function (cb) { - return Curry._1(task, (function (ok) { - if (ok.tag) { - var match = Curry._1(fn, ok[0]); - return Curry._1(match[0], cb); - } else { - return Curry._1(cb, ok); - } - })); - })]; -} - -function fromResult(param) { - if (param.tag) { - var value = param[0]; - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [value])); - })]; - } else { - var value$1 = param[0]; - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value$1])); - })]; - } -} - -function mapError(func, task) { - return onError((function (e) { - var value = Curry._1(func, e); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [value])); - })]; - }), task); -} - -function toOption(task) { - return onError((function (param) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [undefined])); - })]; - }), andThen((function (v) { - var value = Caml_option.some(v); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task)); -} - -function map(func, task1) { - return andThen((function (v1) { - var value = Curry._1(func, v1); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task1); -} - -function map2(func, task1, task2) { - return andThen((function (v1) { - return andThen((function (v2) { - var value = Curry._2(func, v1, v2); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task2); - }), task1); -} - -function map3(func, task1, task2, task3) { - return andThen((function (v1) { - return andThen((function (v2) { - return andThen((function (v3) { - var value = Curry._3(func, v1, v2, v3); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task3); - }), task2); - }), task1); -} - -function map4(func, task1, task2, task3, task4) { - return andThen((function (v1) { - return andThen((function (v2) { - return andThen((function (v3) { - return andThen((function (v4) { - var value = Curry._4(func, v1, v2, v3, v4); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task4); - }), task3); - }), task2); - }), task1); -} - -function map5(func, task1, task2, task3, task4, task5) { - return andThen((function (v1) { - return andThen((function (v2) { - return andThen((function (v3) { - return andThen((function (v4) { - return andThen((function (v5) { - var value = Curry._5(func, v1, v2, v3, v4, v5); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task5); - }), task4); - }), task3); - }), task2); - }), task1); -} - -function map6(func, task1, task2, task3, task4, task5, task6) { - return andThen((function (v1) { - return andThen((function (v2) { - return andThen((function (v3) { - return andThen((function (v4) { - return andThen((function (v5) { - return andThen((function (v6) { - var value = Curry._6(func, v1, v2, v3, v4, v5, v6); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task6); - }), task5); - }), task4); - }), task3); - }), task2); - }), task1); -} - -function sequence(param) { - if (param) { - return map2((function (l, r) { - return /* :: */[ - l, - r - ]; - }), param[0], sequence(param[1])); - } else { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [/* [] */0])); - })]; - } -} - -var testing_deop = { - contents: true -}; - -function testing(param) { - var doTest = function (expected, param) { - return Curry._1(param[0], (function (v) { - if (Caml_obj.caml_equal(v, expected)) { - console.log(/* tuple */[ - "Passed:", - expected, - v - ]); - return /* () */0; - } else { - console.log(/* tuple */[ - "FAILED:", - expected, - v - ]); - return /* () */0; - } - })); - }; - var s = /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [42])); - })]; - doTest(/* Ok */Block.__(0, [42]), s); - var f = /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [86])); - })]; - doTest(/* Error */Block.__(1, [86]), f); - var r = function (param) { - if (testing_deop.contents) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [42])); - })]; - } else { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [3.14])); - })]; - } - }; - var a1 = andThen((function (n) { - var value = n + 2 | 0; - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [2])); - })]); - doTest(/* Ok */Block.__(0, [4]), a1); - var a2 = andThen((function (n) { - var value = String(n); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [2])); - })]); - doTest(/* Ok */Block.__(0, ["2"]), a2); - var m1 = map((function (prim) { - return Math.sqrt(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [9])); - })]); - doTest(/* Ok */Block.__(0, [3]), m1); - var m2 = map2((function (prim, prim$1) { - return prim + prim$1 | 0; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [9])); - })], /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [3])); - })]); - doTest(/* Ok */Block.__(0, [12]), m2); - var m3 = map((function (prim) { - return String(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [9])); - })]); - doTest(/* Ok */Block.__(0, ["9"]), m3); - var s0 = sequence(/* :: */[ - /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [1])); - })], - /* :: */[ - /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [2])); - })], - /* [] */0 - ] - ]); - doTest(/* Ok */Block.__(0, [/* :: */[ - 1, - /* :: */[ - 2, - /* [] */0 - ] - ]]), s0); - var s1 = sequence(/* :: */[ - /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [1])); - })], - /* :: */[ - /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [2.7])); - })], - /* :: */[ - r(/* () */0), - /* [] */0 - ] - ] - ]); - doTest(/* Error */Block.__(1, [2.7]), s1); - var e0 = onError((function (_msg) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [42])); - })]; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, ["file not found"])); - })]); - doTest(/* Ok */Block.__(0, [42]), e0); - var e1 = onError((function (_msg) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [42])); - })]; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, ["file not found"])); - })]); - doTest(/* Error */Block.__(1, [42]), e1); - var n0 = sequence(/* :: */[ - mapError((function (prim) { - return String(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [42])); - })]), - /* :: */[ - mapError((function (prim) { - return prim.toString(); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [3.14])); - })]), - /* [] */0 - ] - ]); - doTest(/* Error */Block.__(1, ["42"]), n0); - var n1 = sequence(/* :: */[ - mapError((function (prim) { - return String(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [1])); - })]), - /* :: */[ - mapError((function (prim) { - return prim.toString(); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [3.14])); - })]), - /* [] */0 - ] - ]); - doTest(/* Error */Block.__(1, ["3.14"]), n1); - var n2 = sequence(/* :: */[ - mapError((function (prim) { - return String(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [1])); - })]), - /* :: */[ - mapError((function (prim) { - return prim.toString(); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [2])); - })]), - /* [] */0 - ] - ]); - doTest(/* Ok */Block.__(0, [/* :: */[ - 1, - /* :: */[ - 2, - /* [] */0 - ] - ]]), n2); - perform((function (param) { - return 42; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [18])); - })]); - var value = 42; - doTest(/* Ok */Block.__(0, [42]), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]); - var value$1 = "failure"; - doTest(/* Error */Block.__(1, ["failure"]), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [value$1])); - })]); - doTest(/* Ok */Block.__(0, [undefined]), toOption(/* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, ["for some reason"])); - })])); - doTest(/* Ok */Block.__(0, [42]), toOption(/* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [42])); - })])); - return /* () */0; -} - -exports.nothing = nothing; -exports.performOpt = performOpt; -exports.perform = perform; -exports.attemptOpt = attemptOpt; -exports.attempt = attempt; -exports.ignore = ignore; -exports.succeed = succeed; -exports.fail = fail; -exports.nativeBinding = nativeBinding; -exports.andThen = andThen; -exports.onError = onError; -exports.fromResult = fromResult; -exports.mapError = mapError; -exports.toOption = toOption; -exports.map = map; -exports.map2 = map2; -exports.map3 = map3; -exports.map4 = map4; -exports.map5 = map5; -exports.map6 = map6; -exports.sequence = sequence; -exports.testing_deop = testing_deop; -exports.testing = testing; -/* No side effect */ diff --git a/lib/js/src-ocaml/tea_time.js b/lib/js/src-ocaml/tea_time.js deleted file mode 100644 index ac9ca7f..0000000 --- a/lib/js/src-ocaml/tea_time.js +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_sub = require("./tea_sub.js"); -var Web_window = require("./web_window.js"); - -function every(key, interval, tagger) { - var enableCall = function (callbacks) { - var id = Web_window.$$setInterval((function (param) { - return Curry._1(callbacks.enqueue, Curry._1(tagger, Date.now())); - }), interval); - return (function (param) { - return window.clearTimeout(id); - }); - }; - return Tea_sub.registration(key, enableCall); -} - -function delay(msTime, msg) { - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - Web_window.$$setTimeout((function (param) { - return Curry._1(callbacks.contents.enqueue, msg); - }), msTime); - return /* () */0; - })]); -} - -var second = 1000.0 * 1.0; - -var minute = 60.0 * second; - -var hour = 60.0 * minute; - -function inMilliseconds(t) { - return t; -} - -function inSeconds(t) { - return t / second; -} - -function inMinutes(t) { - return t / minute; -} - -function inHours(t) { - return t / hour; -} - -var millisecond = 1.0; - -exports.every = every; -exports.delay = delay; -exports.millisecond = millisecond; -exports.second = second; -exports.minute = minute; -exports.hour = hour; -exports.inMilliseconds = inMilliseconds; -exports.inSeconds = inSeconds; -exports.inMinutes = inMinutes; -exports.inHours = inHours; -/* No side effect */ diff --git a/lib/js/src-ocaml/vdom.js b/lib/js/src-ocaml/vdom.js deleted file mode 100644 index 087e49a..0000000 --- a/lib/js/src-ocaml/vdom.js +++ /dev/null @@ -1,1084 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var $$String = require("bs-platform/lib/js/string.js"); -var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); -var Web_node = require("./web_node.js"); -var Caml_array = require("bs-platform/lib/js/caml_array.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Web_document = require("./web_document.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -var noNode = /* CommentNode */Block.__(0, [""]); - -function comment(s) { - return /* CommentNode */Block.__(0, [s]); -} - -function text(s) { - return /* Text */Block.__(1, [s]); -} - -function fullnode(namespace, tagName, key, unique, props, vdoms) { - return /* Node */Block.__(2, [ - namespace, - tagName, - key, - unique, - props, - vdoms - ]); -} - -function node($staropt$star, tagName, $staropt$star$1, $staropt$star$2, props, vdoms) { - var namespace = $staropt$star !== undefined ? $staropt$star : ""; - var key = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - var unique = $staropt$star$2 !== undefined ? $staropt$star$2 : ""; - return fullnode(namespace, tagName, key, unique, props, vdoms); -} - -function lazyGen(key, fn) { - return /* LazyGen */Block.__(3, [ - key, - fn, - { - contents: noNode - } - ]); -} - -function prop(key, value) { - return /* RawProp */Block.__(0, [ - key, - value - ]); -} - -function onCB(name, key, cb) { - return /* Event */Block.__(3, [ - name, - /* EventHandlerCallback */Block.__(0, [ - key, - cb - ]), - { - contents: undefined - } - ]); -} - -function onMsg(name, msg) { - return /* Event */Block.__(3, [ - name, - /* EventHandlerMsg */Block.__(1, [msg]), - { - contents: undefined - } - ]); -} - -function attribute(namespace, key, value) { - return /* Attribute */Block.__(1, [ - namespace, - key, - value - ]); -} - -function data(key, value) { - return /* Data */Block.__(2, [ - key, - value - ]); -} - -function style(key, value) { - return /* Style */Block.__(4, [/* :: */[ - /* tuple */[ - key, - value - ], - /* [] */0 - ]]); -} - -function styles(s) { - return /* Style */Block.__(4, [s]); -} - -function renderToHtmlString(_param) { - while(true) { - var param = _param; - switch (param.tag | 0) { - case /* CommentNode */0 : - return ""); - case /* Text */1 : - return param[0]; - case /* Node */2 : - var tagName = param[1]; - var namespace = param[0]; - return $$String.concat("", /* :: */[ - "<", - /* :: */[ - namespace, - /* :: */[ - namespace === "" ? "" : ":", - /* :: */[ - tagName, - /* :: */[ - $$String.concat("", List.map((function (p) { - var param = p; - if (typeof param === "number") { - return ""; - } else { - switch (param.tag | 0) { - case /* RawProp */0 : - return $$String.concat("", /* :: */[ - " ", - /* :: */[ - param[0], - /* :: */[ - "=\"", - /* :: */[ - param[1], - /* :: */[ - "\"", - /* [] */0 - ] - ] - ] - ] - ]); - case /* Attribute */1 : - return $$String.concat("", /* :: */[ - " ", - /* :: */[ - param[1], - /* :: */[ - "=\"", - /* :: */[ - param[2], - /* :: */[ - "\"", - /* [] */0 - ] - ] - ] - ] - ]); - case /* Data */2 : - return $$String.concat("", /* :: */[ - " data-", - /* :: */[ - param[0], - /* :: */[ - "=\"", - /* :: */[ - param[1], - /* :: */[ - "\"", - /* [] */0 - ] - ] - ] - ] - ]); - case /* Event */3 : - return ""; - case /* Style */4 : - return $$String.concat("", /* :: */[ - " style=\"", - /* :: */[ - $$String.concat(";", List.map((function (param) { - return $$String.concat("", /* :: */[ - param[0], - /* :: */[ - ":", - /* :: */[ - param[1], - /* :: */[ - ";", - /* [] */0 - ] - ] - ] - ]); - }), param[0])), - /* :: */[ - "\"", - /* [] */0 - ] - ] - ]); - - } - } - }), param[4])), - /* :: */[ - ">", - /* :: */[ - $$String.concat("", List.map(renderToHtmlString, param[5])), - /* :: */[ - "", - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ] - ]); - case /* LazyGen */3 : - _param = Curry._1(param[1], /* () */0); - continue ; - case /* Tagger */4 : - _param = param[1]; - continue ; - - } - }; -} - -function emptyEventHandler(_ev) { - return /* () */0; -} - -function emptyEventCB(_ev) { - return ; -} - -function eventHandler(callbacks, cb) { - return (function (ev) { - var match = Curry._1(cb.contents, ev); - if (match !== undefined) { - return Curry._1(callbacks.contents.enqueue, Caml_option.valFromOption(match)); - } else { - return /* () */0; - } - }); -} - -function eventHandler_GetCB(param) { - if (param.tag) { - var msg = param[0]; - return (function (_ev) { - return Caml_option.some(msg); - }); - } else { - return param[1]; - } -} - -function compareEventHandlerTypes(left, param) { - if (param.tag) { - if (left.tag && Caml_obj.caml_equal(param[0], left[0])) { - return true; - } else { - return false; - } - } else if (left.tag) { - return false; - } else { - return param[0] === left[0]; - } -} - -function eventHandler_Register(callbacks, elem, name, handlerType) { - var cb = { - contents: eventHandler_GetCB(handlerType) - }; - var handler = eventHandler(callbacks, cb); - Web_node.addEventListener(elem, name, handler, false); - return { - handler: handler, - cb: cb - }; -} - -function eventHandler_Unregister(elem, name, param) { - if (param !== undefined) { - Web_node.removeEventListener(elem, name, param.handler, false); - return ; - } - -} - -function eventHandler_Mutate(callbacks, elem, oldName, newName, oldHandlerType, newHandlerType, oldCache, newCache) { - var match = oldCache.contents; - if (match !== undefined) { - if (oldName === newName) { - newCache.contents = oldCache.contents; - if (compareEventHandlerTypes(oldHandlerType, newHandlerType)) { - return /* () */0; - } else { - var cb = eventHandler_GetCB(newHandlerType); - match.cb.contents = cb; - return /* () */0; - } - } else { - oldCache.contents = eventHandler_Unregister(elem, oldName, oldCache.contents); - newCache.contents = eventHandler_Register(callbacks, elem, newName, newHandlerType); - return /* () */0; - } - } else { - newCache.contents = eventHandler_Register(callbacks, elem, newName, newHandlerType); - return /* () */0; - } -} - -function patchVNodesOnElems_PropertiesApply_Add(callbacks, elem, _idx, param) { - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* RawProp */0 : - elem[param[0]] = param[1]; - return /* () */0; - case /* Attribute */1 : - return Web_node.setAttributeNsOptional(elem, param[0], param[1], param[2]); - case /* Data */2 : - console.log(/* tuple */[ - "TODO: Add Data Unhandled", - param[0], - param[1] - ]); - throw [ - Caml_builtin_exceptions.failure, - "TODO: Add Data Unhandled" - ]; - case /* Event */3 : - param[2].contents = eventHandler_Register(callbacks, elem, param[0], param[1]); - return /* () */0; - case /* Style */4 : - return List.fold_left((function (param, param$1) { - return Web_node.setStyleProperty(elem, undefined, param$1[0], param$1[1]); - }), /* () */0, param[0]); - - } - } -} - -function patchVNodesOnElems_PropertiesApply_Remove(_callbacks, elem, _idx, param) { - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* RawProp */0 : - elem[param[0]] = undefined; - return /* () */0; - case /* Attribute */1 : - return Web_node.removeAttributeNsOptional(elem, param[0], param[1]); - case /* Data */2 : - console.log(/* tuple */[ - "TODO: Remove Data Unhandled", - param[0], - param[1] - ]); - throw [ - Caml_builtin_exceptions.failure, - "TODO: Remove Data Unhandled" - ]; - case /* Event */3 : - var cache = param[2]; - cache.contents = eventHandler_Unregister(elem, param[0], cache.contents); - return /* () */0; - case /* Style */4 : - return List.fold_left((function (param, param$1) { - return Web_node.setStyleProperty(elem, undefined, param$1[0], null); - }), /* () */0, param[0]); - - } - } -} - -function patchVNodesOnElems_PropertiesApply_RemoveAdd(callbacks, elem, idx, oldProp, newProp) { - patchVNodesOnElems_PropertiesApply_Remove(callbacks, elem, idx, oldProp); - patchVNodesOnElems_PropertiesApply_Add(callbacks, elem, idx, newProp); - return /* () */0; -} - -function patchVNodesOnElems_PropertiesApply_Mutate(_callbacks, elem, _idx, oldProp, _newProp) { - if (typeof _newProp === "number") { - throw [ - Caml_builtin_exceptions.failure, - "This should never be called as all entries through NoProp are gated." - ]; - } else { - switch (_newProp.tag | 0) { - case /* RawProp */0 : - elem[_newProp[0]] = _newProp[1]; - return /* () */0; - case /* Attribute */1 : - return Web_node.setAttributeNsOptional(elem, _newProp[0], _newProp[1], _newProp[2]); - case /* Data */2 : - console.log(/* tuple */[ - "TODO: Mutate Data Unhandled", - _newProp[0], - _newProp[1] - ]); - throw [ - Caml_builtin_exceptions.failure, - "TODO: Mutate Data Unhandled" - ]; - case /* Event */3 : - throw [ - Caml_builtin_exceptions.failure, - "This will never be called because it is gated" - ]; - case /* Style */4 : - if (typeof oldProp === "number") { - throw [ - Caml_builtin_exceptions.failure, - "Passed a non-Style to a new Style as a Mutations while the old Style is not actually a style!" - ]; - } else if (oldProp.tag === /* Style */4) { - return List.fold_left2((function (param, param$1, param$2) { - var nv = param$2[1]; - var nk = param$2[0]; - var ok = param$1[0]; - if (ok === nk) { - if (param$1[1] === nv) { - return /* () */0; - } else { - return Web_node.setStyleProperty(elem, undefined, nk, nv); - } - } else { - Web_node.setStyleProperty(elem, undefined, ok, null); - return Web_node.setStyleProperty(elem, undefined, nk, nv); - } - }), /* () */0, oldProp[0], _newProp[0]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Passed a non-Style to a new Style as a Mutations while the old Style is not actually a style!" - ]; - } - - } - } -} - -function patchVNodesOnElems_PropertiesApply(callbacks, elem, _idx, _oldProperties, _newProperties) { - while(true) { - var newProperties = _newProperties; - var oldProperties = _oldProperties; - var idx = _idx; - if (oldProperties) { - var _oldProp = oldProperties[0]; - if (newProperties) { - if (typeof _oldProp === "number") { - if (typeof newProperties[0] === "number") { - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - - } else { - switch (_oldProp.tag | 0) { - case /* RawProp */0 : - var newProp = newProperties[0]; - if (typeof newProp !== "number" && !newProp.tag) { - if (!(_oldProp[0] === newProp[0] && _oldProp[1] === newProp[1])) { - patchVNodesOnElems_PropertiesApply_Mutate(callbacks, elem, idx, _oldProp, newProp); - } - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - case /* Attribute */1 : - var newProp$1 = newProperties[0]; - if (typeof newProp$1 !== "number" && newProp$1.tag === /* Attribute */1) { - if (!(_oldProp[0] === newProp$1[0] && _oldProp[1] === newProp$1[1] && _oldProp[2] === newProp$1[2])) { - patchVNodesOnElems_PropertiesApply_Mutate(callbacks, elem, idx, _oldProp, newProp$1); - } - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - case /* Data */2 : - var newProp$2 = newProperties[0]; - if (typeof newProp$2 !== "number" && newProp$2.tag === /* Data */2) { - if (!(_oldProp[0] === newProp$2[0] && _oldProp[1] === newProp$2[1])) { - patchVNodesOnElems_PropertiesApply_Mutate(callbacks, elem, idx, _oldProp, newProp$2); - } - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - case /* Event */3 : - var _newProp = newProperties[0]; - if (typeof _newProp !== "number" && _newProp.tag === /* Event */3) { - eventHandler_Mutate(callbacks, elem, _oldProp[0], _newProp[0], _oldProp[1], _newProp[1], _oldProp[2], _newProp[2]); - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - case /* Style */4 : - var newProp$3 = newProperties[0]; - if (typeof newProp$3 !== "number" && newProp$3.tag === /* Style */4) { - if (!Caml_obj.caml_equal(_oldProp[0], newProp$3[0])) { - patchVNodesOnElems_PropertiesApply_Mutate(callbacks, elem, idx, _oldProp, newProp$3); - } - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - - } - } - } else { - return false; - } - patchVNodesOnElems_PropertiesApply_RemoveAdd(callbacks, elem, idx, _oldProp, newProperties[0]); - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } else if (newProperties) { - return false; - } else { - return true; - } - }; -} - -function patchVNodesOnElems_Properties(callbacks, elem, oldProperties, newProperties) { - return patchVNodesOnElems_PropertiesApply(callbacks, elem, 0, oldProperties, newProperties); -} - -function genEmptyProps(length) { - var _lst = /* [] */0; - var _len = length; - while(true) { - var len = _len; - var lst = _lst; - if (len !== 0) { - _len = len - 1 | 0; - _lst = /* :: */[ - /* NoProp */0, - lst - ]; - continue ; - } else { - return lst; - } - }; -} - -function mapEmptyProps(props) { - return List.map((function (param) { - return /* NoProp */0; - }), props); -} - -function patchVNodesOnElems_ReplaceNode(callbacks, elem, elems, idx, param) { - if (param.tag === /* Node */2) { - var newProperties = param[4]; - var oldChild = Caml_array.caml_array_get(elems, idx); - var newChild = Web_document.createElementNsOptional(param[0], param[1]); - var match = patchVNodesOnElems_Properties(callbacks, newChild, List.map((function (param) { - return /* NoProp */0; - }), newProperties), newProperties); - if (match) { - var childChildren = newChild.childNodes; - patchVNodesOnElems(callbacks, newChild, childChildren, 0, /* [] */0, param[5]); - Web_node.insertBefore(elem, newChild, oldChild); - elem.removeChild(oldChild); - return /* () */0; - } else { - throw [ - Caml_builtin_exceptions.match_failure, - /* tuple */[ - "vdom.ml", - 343, - 13 - ] - ]; - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "Node replacement should never be passed anything but a node itself" - ]; - } -} - -function patchVNodesOnElems_CreateElement(_callbacks, _param) { - while(true) { - var param = _param; - var callbacks = _callbacks; - switch (param.tag | 0) { - case /* CommentNode */0 : - var text = param[0]; - return document.createComment(text); - case /* Text */1 : - var text$1 = param[0]; - return document.createTextNode(text$1); - case /* Node */2 : - var newProperties = param[4]; - var newChild = Web_document.createElementNsOptional(param[0], param[1]); - var match = patchVNodesOnElems_Properties(callbacks, newChild, List.map((function (param) { - return /* NoProp */0; - }), newProperties), newProperties); - if (match) { - var childChildren = newChild.childNodes; - patchVNodesOnElems(callbacks, newChild, childChildren, 0, /* [] */0, param[5]); - return newChild; - } else { - throw [ - Caml_builtin_exceptions.match_failure, - /* tuple */[ - "vdom.ml", - 368, - 11 - ] - ]; - } - case /* LazyGen */3 : - var vdom = Curry._1(param[1], /* () */0); - param[2].contents = vdom; - _param = vdom; - continue ; - case /* Tagger */4 : - _param = param[1]; - _callbacks = Curry._1(param[0], callbacks); - continue ; - - } - }; -} - -function patchVNodesOnElems_MutateNode(callbacks, elem, elems, idx, oldNode, newNode) { - if (oldNode.tag === /* Node */2) { - if (newNode.tag === /* Node */2) { - if (oldNode[3] !== newNode[3] || oldNode[1] !== newNode[1]) { - return patchVNodesOnElems_ReplaceNode(callbacks, elem, elems, idx, newNode); - } else { - var child = Caml_array.caml_array_get(elems, idx); - var childChildren = child.childNodes; - if (!patchVNodesOnElems_Properties(callbacks, child, oldNode[4], newNode[4])) { - console.log("VDom: Failed swapping properties because the property list length changed, use `noProp` to swap properties instead, not by altering the list structure. This is a massive inefficiency until this issue is resolved."); - patchVNodesOnElems_ReplaceNode(callbacks, elem, elems, idx, newNode); - } - return patchVNodesOnElems(callbacks, child, childChildren, 0, oldNode[5], newNode[5]); - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "Non-node passed to patchVNodesOnElems_MutateNode" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "Non-node passed to patchVNodesOnElems_MutateNode" - ]; - } -} - -function patchVNodesOnElems(callbacks, elem, elems, _idx, _oldVNodes, _newVNodes) { - while(true) { - var newVNodes = _newVNodes; - var oldVNodes = _oldVNodes; - var idx = _idx; - if (oldVNodes) { - var oldNode = oldVNodes[0]; - switch (oldNode.tag | 0) { - case /* CommentNode */0 : - if (newVNodes) { - var match = newVNodes[0]; - if (!match.tag && oldNode[0] === match[0]) { - _newVNodes = newVNodes[1]; - _oldVNodes = oldVNodes[1]; - _idx = idx + 1 | 0; - continue ; - } - - } - break; - case /* Text */1 : - if (newVNodes) { - var match$1 = newVNodes[0]; - if (match$1.tag === /* Text */1) { - var newText = match$1[0]; - if (oldNode[0] !== newText) { - var child = Caml_array.caml_array_get(elems, idx); - child.nodeValue = newText; - } - _newVNodes = newVNodes[1]; - _oldVNodes = oldVNodes[1]; - _idx = idx + 1 | 0; - continue ; - } - - } - break; - case /* Node */2 : - if (newVNodes) { - var newNode = newVNodes[0]; - if (newNode.tag === /* Node */2) { - var newRest = newVNodes[1]; - var newKey = newNode[2]; - var newTagName = newNode[1]; - var newNamespace = newNode[0]; - var oldRest = oldVNodes[1]; - var oldKey = oldNode[2]; - var oldTagName = oldNode[1]; - var oldNamespace = oldNode[0]; - if (oldKey === newKey && oldKey !== "") { - _newVNodes = newRest; - _oldVNodes = oldRest; - _idx = idx + 1 | 0; - continue ; - } else if (oldKey === "" || newKey === "") { - patchVNodesOnElems_MutateNode(callbacks, elem, elems, idx, oldNode, newNode); - _newVNodes = newRest; - _oldVNodes = oldRest; - _idx = idx + 1 | 0; - continue ; - } else { - var exit = 0; - var exit$1 = 0; - if (oldRest) { - var match$2 = oldRest[0]; - if (match$2.tag === /* Node */2) { - var olderRest = oldRest[1]; - var olderKey = match$2[2]; - var olderTagName = match$2[1]; - var olderNamespace = match$2[0]; - var exit$2 = 0; - if (newRest) { - var match$3 = newRest[0]; - if (match$3.tag === /* Node */2 && olderNamespace === newNamespace && olderTagName === newTagName && olderKey === newKey && oldNamespace === match$3[0] && oldTagName === match$3[1] && oldKey === match$3[2]) { - var firstChild = Caml_array.caml_array_get(elems, idx); - var secondChild = Caml_array.caml_array_get(elems, idx + 1 | 0); - elem.removeChild(secondChild); - Web_node.insertBefore(elem, secondChild, firstChild); - _newVNodes = newRest[1]; - _oldVNodes = olderRest; - _idx = idx + 2 | 0; - continue ; - } else { - exit$2 = 4; - } - } else { - exit$2 = 4; - } - if (exit$2 === 4) { - if (olderNamespace === newNamespace && olderTagName === newTagName && olderKey === newKey) { - var oldChild = Caml_array.caml_array_get(elems, idx); - elem.removeChild(oldChild); - _newVNodes = newRest; - _oldVNodes = olderRest; - _idx = idx + 1 | 0; - continue ; - } else { - exit$1 = 3; - } - } - - } else { - exit$1 = 3; - } - } else { - exit$1 = 3; - } - if (exit$1 === 3) { - if (newRest) { - var match$4 = newRest[0]; - if (match$4.tag === /* Node */2 && oldNamespace === match$4[0] && oldTagName === match$4[1] && oldKey === match$4[2]) { - var oldChild$1 = Caml_array.caml_array_get(elems, idx); - var newChild = patchVNodesOnElems_CreateElement(callbacks, newNode); - Web_node.insertBefore(elem, newChild, oldChild$1); - _newVNodes = newRest; - _idx = idx + 1 | 0; - continue ; - } else { - exit = 2; - } - } else { - exit = 2; - } - } - if (exit === 2) { - patchVNodesOnElems_MutateNode(callbacks, elem, elems, idx, oldNode, newNode); - _newVNodes = newRest; - _oldVNodes = oldRest; - _idx = idx + 1 | 0; - continue ; - } - - } - } - - } - break; - case /* LazyGen */3 : - if (newVNodes) { - var match$5 = newVNodes[0]; - if (match$5.tag === /* LazyGen */3) { - var newRest$1 = newVNodes[1]; - var newCache = match$5[2]; - var newGen = match$5[1]; - var newKey$1 = match$5[0]; - var oldRest$1 = oldVNodes[1]; - var oldCache = oldNode[2]; - var oldKey$1 = oldNode[0]; - if (oldKey$1 === newKey$1) { - newCache.contents = oldCache.contents; - _newVNodes = newRest$1; - _oldVNodes = oldRest$1; - _idx = idx + 1 | 0; - continue ; - } else { - var exit$3 = 0; - var exit$4 = 0; - if (oldRest$1) { - var match$6 = oldRest$1[0]; - if (match$6.tag === /* LazyGen */3) { - var olderRest$1 = oldRest$1[1]; - var olderKey$1 = match$6[0]; - var exit$5 = 0; - if (newRest$1) { - var match$7 = newRest$1[0]; - if (match$7.tag === /* LazyGen */3 && olderKey$1 === newKey$1 && oldKey$1 === match$7[0]) { - var firstChild$1 = Caml_array.caml_array_get(elems, idx); - var secondChild$1 = Caml_array.caml_array_get(elems, idx + 1 | 0); - elem.removeChild(secondChild$1); - Web_node.insertBefore(elem, secondChild$1, firstChild$1); - _newVNodes = newRest$1[1]; - _oldVNodes = olderRest$1; - _idx = idx + 2 | 0; - continue ; - } else { - exit$5 = 4; - } - } else { - exit$5 = 4; - } - if (exit$5 === 4) { - if (olderKey$1 === newKey$1) { - var oldChild$2 = Caml_array.caml_array_get(elems, idx); - elem.removeChild(oldChild$2); - var oldVdom = match$6[2].contents; - newCache.contents = oldVdom; - _newVNodes = newRest$1; - _oldVNodes = olderRest$1; - _idx = idx + 1 | 0; - continue ; - } else { - exit$4 = 3; - } - } - - } else { - exit$4 = 3; - } - } else { - exit$4 = 3; - } - if (exit$4 === 3) { - if (newRest$1) { - var match$8 = newRest$1[0]; - if (match$8.tag === /* LazyGen */3 && match$8[0] === oldKey$1) { - var oldChild$3 = Caml_array.caml_array_get(elems, idx); - var newVdom = Curry._1(newGen, /* () */0); - newCache.contents = newVdom; - var newChild$1 = patchVNodesOnElems_CreateElement(callbacks, newVdom); - Web_node.insertBefore(elem, newChild$1, oldChild$3); - _newVNodes = newRest$1; - _idx = idx + 1 | 0; - continue ; - } else { - exit$3 = 2; - } - } else { - exit$3 = 2; - } - } - if (exit$3 === 2) { - var oldVdom$1 = oldCache.contents; - var newVdom$1 = Curry._1(newGen, /* () */0); - newCache.contents = newVdom$1; - _newVNodes = /* :: */[ - newVdom$1, - newRest$1 - ]; - _oldVNodes = /* :: */[ - oldVdom$1, - oldRest$1 - ]; - continue ; - } - - } - } - - } - break; - case /* Tagger */4 : - _oldVNodes = /* :: */[ - oldNode[1], - oldVNodes[1] - ]; - continue ; - - } - var oldRest$2 = oldVNodes[1]; - if (newVNodes) { - var newNode$1 = newVNodes[0]; - if (newNode$1.tag === /* Tagger */4) { - patchVNodesOnElems(Curry._1(newNode$1[0], callbacks), elem, elems, idx, /* :: */[ - oldNode, - /* [] */0 - ], /* :: */[ - newNode$1[1], - /* [] */0 - ]); - _newVNodes = newVNodes[1]; - _oldVNodes = oldRest$2; - _idx = idx + 1 | 0; - continue ; - } else { - var oldChild$4 = Caml_array.caml_array_get(elems, idx); - var newChild$2 = patchVNodesOnElems_CreateElement(callbacks, newNode$1); - Web_node.insertBefore(elem, newChild$2, oldChild$4); - elem.removeChild(oldChild$4); - _newVNodes = newVNodes[1]; - _oldVNodes = oldRest$2; - _idx = idx + 1 | 0; - continue ; - } - } else { - var child$1 = Caml_array.caml_array_get(elems, idx); - elem.removeChild(child$1); - _newVNodes = /* [] */0; - _oldVNodes = oldRest$2; - continue ; - } - } else if (newVNodes) { - var newChild$3 = patchVNodesOnElems_CreateElement(callbacks, newVNodes[0]); - elem.appendChild(newChild$3); - _newVNodes = newVNodes[1]; - _oldVNodes = /* [] */0; - _idx = idx + 1 | 0; - continue ; - } else { - return /* () */0; - } - }; -} - -function patchVNodesIntoElement(callbacks, elem, oldVNodes, newVNodes) { - var elems = elem.childNodes; - patchVNodesOnElems(callbacks, elem, elems, 0, oldVNodes, newVNodes); - return newVNodes; -} - -function patchVNodeIntoElement(callbacks, elem, oldVNode, newVNode) { - return patchVNodesIntoElement(callbacks, elem, /* :: */[ - oldVNode, - /* [] */0 - ], /* :: */[ - newVNode, - /* [] */0 - ]); -} - -function wrapCallbacks_On(func, param) { - if (typeof param === "number") { - return /* Render */0; - } else if (param.tag) { - return /* RemoveRenderMsg */Block.__(1, [Curry._1(func, param[0])]); - } else { - return /* AddRenderMsg */Block.__(0, [Curry._1(func, param[0])]); - } -} - -function wrapCallbacks(func, callbacks) { - return { - contents: { - enqueue: (function (msg) { - return Curry._1(callbacks.contents.enqueue, Curry._1(func, msg)); - }), - on: (function (smsg) { - return Curry._1(callbacks.contents.on, wrapCallbacks_On(func, smsg)); - }) - } - }; -} - -function map(func, vdom) { - var tagger = function (param) { - return wrapCallbacks(func, param); - }; - return /* Tagger */Block.__(4, [ - tagger, - vdom - ]); -} - -var noProp = /* NoProp */0; - -exports.noNode = noNode; -exports.comment = comment; -exports.text = text; -exports.fullnode = fullnode; -exports.node = node; -exports.lazyGen = lazyGen; -exports.noProp = noProp; -exports.prop = prop; -exports.onCB = onCB; -exports.onMsg = onMsg; -exports.attribute = attribute; -exports.data = data; -exports.style = style; -exports.styles = styles; -exports.renderToHtmlString = renderToHtmlString; -exports.emptyEventHandler = emptyEventHandler; -exports.emptyEventCB = emptyEventCB; -exports.eventHandler = eventHandler; -exports.eventHandler_GetCB = eventHandler_GetCB; -exports.compareEventHandlerTypes = compareEventHandlerTypes; -exports.eventHandler_Register = eventHandler_Register; -exports.eventHandler_Unregister = eventHandler_Unregister; -exports.eventHandler_Mutate = eventHandler_Mutate; -exports.patchVNodesOnElems_PropertiesApply_Add = patchVNodesOnElems_PropertiesApply_Add; -exports.patchVNodesOnElems_PropertiesApply_Remove = patchVNodesOnElems_PropertiesApply_Remove; -exports.patchVNodesOnElems_PropertiesApply_RemoveAdd = patchVNodesOnElems_PropertiesApply_RemoveAdd; -exports.patchVNodesOnElems_PropertiesApply_Mutate = patchVNodesOnElems_PropertiesApply_Mutate; -exports.patchVNodesOnElems_PropertiesApply = patchVNodesOnElems_PropertiesApply; -exports.patchVNodesOnElems_Properties = patchVNodesOnElems_Properties; -exports.genEmptyProps = genEmptyProps; -exports.mapEmptyProps = mapEmptyProps; -exports.patchVNodesOnElems_ReplaceNode = patchVNodesOnElems_ReplaceNode; -exports.patchVNodesOnElems_CreateElement = patchVNodesOnElems_CreateElement; -exports.patchVNodesOnElems_MutateNode = patchVNodesOnElems_MutateNode; -exports.patchVNodesOnElems = patchVNodesOnElems; -exports.patchVNodesIntoElement = patchVNodesIntoElement; -exports.patchVNodeIntoElement = patchVNodeIntoElement; -exports.wrapCallbacks_On = wrapCallbacks_On; -exports.wrapCallbacks = wrapCallbacks; -exports.map = map; -/* No side effect */ diff --git a/lib/js/src-ocaml/web.js b/lib/js/src-ocaml/web.js deleted file mode 100644 index 01fbe05..0000000 --- a/lib/js/src-ocaml/web.js +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Web_node = require("./web_node.js"); -var Web_window = require("./web_window.js"); - -function polyfills(param) { - Web_node.remove_polyfill(/* () */0); - Web_window.requestAnimationFrame_polyfill(/* () */0); - return /* () */0; -} - -var $$Event = /* alias */0; - -var $$Node = /* alias */0; - -var $$Document = /* alias */0; - -var $$Date = /* alias */0; - -var $$Window = /* alias */0; - -var $$Location = /* alias */0; - -var Json = /* alias */0; - -var $$XMLHttpRequest = /* alias */0; - -var $$FormData = /* alias */0; - -exports.$$Event = $$Event; -exports.$$Node = $$Node; -exports.$$Document = $$Document; -exports.$$Date = $$Date; -exports.$$Window = $$Window; -exports.$$Location = $$Location; -exports.Json = Json; -exports.$$XMLHttpRequest = $$XMLHttpRequest; -exports.$$FormData = $$FormData; -exports.polyfills = polyfills; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_date.js b/lib/js/src-ocaml/web_date.js deleted file mode 100644 index 0616b11..0000000 --- a/lib/js/src-ocaml/web_date.js +++ /dev/null @@ -1,10 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function now(param) { - return Date.now(); -} - -exports.now = now; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_document.js b/lib/js/src-ocaml/web_document.js deleted file mode 100644 index def5ddf..0000000 --- a/lib/js/src-ocaml/web_document.js +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function body(param) { - return document.body; -} - -function createElement(typ) { - return document.createElement(typ); -} - -function createElementNS(namespace, key) { - return document.createElementNS(namespace, key); -} - -function createComment(text) { - return document.createComment(text); -} - -function createTextNode(text) { - return document.createTextNode(text); -} - -function getElementById(id) { - return document.getElementById(id); -} - -function createElementNsOptional(namespace, tagName) { - if (namespace === "") { - return document.createElement(tagName); - } else { - return document.createElementNS(namespace, tagName); - } -} - -function $$location(param) { - return document.location; -} - -exports.body = body; -exports.createElement = createElement; -exports.createElementNS = createElementNS; -exports.createComment = createComment; -exports.createTextNode = createTextNode; -exports.getElementById = getElementById; -exports.createElementNsOptional = createElementNsOptional; -exports.$$location = $$location; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_event.js b/lib/js/src-ocaml/web_event.js deleted file mode 100644 index 40fed0f..0000000 --- a/lib/js/src-ocaml/web_event.js +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/src-ocaml/web_formdata.js b/lib/js/src-ocaml/web_formdata.js deleted file mode 100644 index 5c11e71..0000000 --- a/lib/js/src-ocaml/web_formdata.js +++ /dev/null @@ -1,10 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function append(key, value, f) { - return f.append(key, value); -} - -exports.append = append; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_json.js b/lib/js/src-ocaml/web_json.js deleted file mode 100644 index fccb829..0000000 --- a/lib/js/src-ocaml/web_json.js +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Js_json = require("bs-platform/lib/js/js_json.js"); - -function string_of_json($staropt$star, value) { - var indent = $staropt$star !== undefined ? $staropt$star : 2; - if (value !== undefined) { - try { - return JSON.stringify(value, null, indent); - } - catch (exn){ - return ""; - } - } else { - return "undefined"; - } -} - -function of_type(_v, x) { - return x; -} - -var classify = Js_json.classify; - -var test = Js_json.test; - -var decodeString = Js_json.decodeString; - -var decodeNumber = Js_json.decodeNumber; - -var decodeObject = Js_json.decodeObject; - -var decodeArray = Js_json.decodeArray; - -var decodeBoolean = Js_json.decodeBoolean; - -var decodeNull = Js_json.decodeNull; - -var $$null = null; - -exports.classify = classify; -exports.test = test; -exports.decodeString = decodeString; -exports.decodeNumber = decodeNumber; -exports.decodeObject = decodeObject; -exports.decodeArray = decodeArray; -exports.decodeBoolean = decodeBoolean; -exports.decodeNull = decodeNull; -exports.string_of_json = string_of_json; -exports.of_type = of_type; -exports.$$null = $$null; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_location.js b/lib/js/src-ocaml/web_location.js deleted file mode 100644 index 6ab044c..0000000 --- a/lib/js/src-ocaml/web_location.js +++ /dev/null @@ -1,137 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function getHref($$location) { - return $$location.href; -} - -function setHref($$location, value) { - $$location.href = value; - return /* () */0; -} - -function getProtocol($$location) { - return $$location.protocol; -} - -function setProtocol($$location, value) { - $$location.protocol = value; - return /* () */0; -} - -function getHost($$location) { - return $$location.host; -} - -function setHost($$location, value) { - $$location.host = value; - return /* () */0; -} - -function getHostname($$location) { - return $$location.hostname; -} - -function setHostname($$location, value) { - $$location.hostname = value; - return /* () */0; -} - -function getPort($$location) { - return $$location.port; -} - -function setPort($$location, value) { - $$location.port = value; - return /* () */0; -} - -function getPathname($$location) { - return $$location.pathname; -} - -function setPathname($$location, value) { - $$location.pathname = value; - return /* () */0; -} - -function getSearch($$location) { - return $$location.search; -} - -function setSearch($$location, value) { - $$location.search = value; - return /* () */0; -} - -function getHash($$location) { - return $$location.hash; -} - -function setHash($$location, value) { - $$location.hash = value; - return /* () */0; -} - -function getUsername($$location) { - return $$location.username; -} - -function setUsername($$location, value) { - $$location.username = value; - return /* () */0; -} - -function getPassword($$location) { - return $$location.password; -} - -function setPassword($$location, value) { - $$location.password = value; - return /* () */0; -} - -function getOrigin($$location) { - return $$location.origin; -} - -function asRecord($$location) { - return { - href: $$location.href, - protocol: $$location.protocol, - host: $$location.host, - hostname: $$location.hostname, - port: $$location.port, - pathname: $$location.pathname, - search: $$location.search, - hash: $$location.hash, - username: $$location.username, - password: $$location.password, - origin: $$location.origin - }; -} - -exports.getHref = getHref; -exports.setHref = setHref; -exports.getProtocol = getProtocol; -exports.setProtocol = setProtocol; -exports.getHost = getHost; -exports.setHost = setHost; -exports.getHostname = getHostname; -exports.setHostname = setHostname; -exports.getPort = getPort; -exports.setPort = setPort; -exports.getPathname = getPathname; -exports.setPathname = setPathname; -exports.getSearch = getSearch; -exports.setSearch = setSearch; -exports.getHash = getHash; -exports.setHash = setHash; -exports.getUsername = getUsername; -exports.setUsername = setUsername; -exports.getPassword = getPassword; -exports.setPassword = setPassword; -exports.getOrigin = getOrigin; -exports.asRecord = asRecord; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_node.js b/lib/js/src-ocaml/web_node.js deleted file mode 100644 index b80a1a8..0000000 --- a/lib/js/src-ocaml/web_node.js +++ /dev/null @@ -1,141 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function style(n) { - return n.style; -} - -function getStyle(n, key) { - return n.style[key]; -} - -function setStyle(n, key, value) { - n.style[key] = value; - return /* () */0; -} - -function setStyleProperty(n, $staropt$star, key, value) { - var priority = $staropt$star !== undefined ? $staropt$star : false; - var style = n.style; - var match = style.setProperty; - if (match !== undefined) { - return style.setProperty(key, value, priority ? "important" : null); - } else { - return setStyle(n, key, value); - } -} - -function childNodes(n) { - return n.childNodes; -} - -function firstChild(n) { - return n.firstChild; -} - -function appendChild(n, child) { - return n.appendChild(child); -} - -function removeChild(n, child) { - return n.removeChild(child); -} - -function insertBefore(n, child, refNode) { - return n.insertBefore(child, refNode); -} - -function remove(n, child) { - return n.remove(child); -} - -function setAttributeNS(n, namespace, key, value) { - return n.setAttributeNS(namespace, key, value); -} - -function setAttribute(n, key, value) { - return n.setAttribute(key, value); -} - -function setAttributeNsOptional(n, namespace, key, value) { - if (namespace === "") { - return n.setAttribute(key, value); - } else { - return n.setAttributeNS(namespace, key, value); - } -} - -function removeAttributeNS(n, namespace, key) { - return n.removeAttributeNS(namespace, key); -} - -function removeAttribute(n, key) { - return n.removeAttribute(key); -} - -function removeAttributeNsOptional(n, namespace, key) { - if (namespace === "") { - return n.removeAttribute(key); - } else { - return n.removeAttributeNS(namespace, key); - } -} - -function addEventListener(n, typ, listener, options) { - return n.addEventListener(typ, listener, options); -} - -function removeEventListener(n, typ, listener, options) { - return n.removeEventListener(typ, listener, options); -} - -function focus(n) { - return n.focus(); -} - -function set_nodeValue(n, text) { - n.nodeValue = text; - return /* () */0; -} - -function get_nodeValue(n) { - return n.nodeValue; -} - -function remove_polyfill(param) { - return (// remove polyfill - (function() { - if (!('remove' in Element.prototype)) { - Element.prototype.remove = function() { - if (this.parentNode) { - this.parentNode.removeChild(this); - } - }; - }; - }())); -} - -exports.style = style; -exports.getStyle = getStyle; -exports.setStyle = setStyle; -exports.setStyleProperty = setStyleProperty; -exports.childNodes = childNodes; -exports.firstChild = firstChild; -exports.appendChild = appendChild; -exports.removeChild = removeChild; -exports.insertBefore = insertBefore; -exports.remove = remove; -exports.setAttributeNS = setAttributeNS; -exports.setAttribute = setAttribute; -exports.setAttributeNsOptional = setAttributeNsOptional; -exports.removeAttributeNS = removeAttributeNS; -exports.removeAttribute = removeAttribute; -exports.removeAttributeNsOptional = removeAttributeNsOptional; -exports.addEventListener = addEventListener; -exports.removeEventListener = removeEventListener; -exports.focus = focus; -exports.set_nodeValue = set_nodeValue; -exports.get_nodeValue = get_nodeValue; -exports.remove_polyfill = remove_polyfill; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_window.js b/lib/js/src-ocaml/web_window.js deleted file mode 100644 index bb7aa95..0000000 --- a/lib/js/src-ocaml/web_window.js +++ /dev/null @@ -1,90 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function history(param) { - return window.history; -} - -function localStorage(param) { - return window.localStorage; -} - -function $$location(param) { - return window.location; -} - -function requestAnimationFrame(callback) { - return window.requestAnimationFrame(callback); -} - -function cancelAnimationFrame(id) { - return window.cancelAnimationFrame(id); -} - -function $$clearTimeout(id) { - return window.clearTimeout(id); -} - -function $$setInterval(cb, msTime) { - return window.setInterval(cb, msTime); -} - -function $$setTimeout(cb, msTime) { - return window.setTimeout(cb, msTime); -} - -function addEventListener(typ, listener, options) { - return window.addEventListener(typ, listener, options); -} - -function removeEventListener(typ, listener, options) { - return window.removeEventListener(typ, listener, options); -} - -function requestAnimationFrame_polyfill(param) { - return (// requestAnimationFrame polyfill - (function() { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] - || window[vendors[x]+'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - - if (!window.cancelAnimationFrame) - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - }())); -} - -var $$History = /* alias */0; - -var LocalStorage = /* alias */0; - -exports.$$History = $$History; -exports.LocalStorage = LocalStorage; -exports.history = history; -exports.localStorage = localStorage; -exports.$$location = $$location; -exports.requestAnimationFrame = requestAnimationFrame; -exports.cancelAnimationFrame = cancelAnimationFrame; -exports.$$clearTimeout = $$clearTimeout; -exports.$$setInterval = $$setInterval; -exports.$$setTimeout = $$setTimeout; -exports.addEventListener = addEventListener; -exports.removeEventListener = removeEventListener; -exports.requestAnimationFrame_polyfill = requestAnimationFrame_polyfill; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_window_history.js b/lib/js/src-ocaml/web_window_history.js deleted file mode 100644 index 9ca66a6..0000000 --- a/lib/js/src-ocaml/web_window_history.js +++ /dev/null @@ -1,74 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function length($$window) { - var match = $$window.history; - if (match !== undefined) { - return match.length; - } else { - return -1; - } -} - -function back($$window) { - var match = $$window.history; - if (match !== undefined) { - return match.back; - } else { - return /* () */0; - } -} - -function forward($$window) { - var match = $$window.history; - if (match !== undefined) { - return match.forward; - } else { - return /* () */0; - } -} - -function go($$window, to$prime) { - var match = $$window.history; - if (match !== undefined) { - return match.go(to$prime); - } else { - return /* () */0; - } -} - -function pushState($$window, state, title, url) { - var match = $$window.history; - if (match !== undefined) { - return match.pushState(state, title, url); - } else { - return /* () */0; - } -} - -function replaceState($$window, state, title, url) { - var match = $$window.history; - if (match !== undefined) { - return match.replaceState(state, title, url); - } else { - return /* () */0; - } -} - -function state($$window) { - var match = $$window.history; - if (match !== undefined) { - return match.state; - } - -} - -exports.length = length; -exports.back = back; -exports.forward = forward; -exports.go = go; -exports.pushState = pushState; -exports.replaceState = replaceState; -exports.state = state; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_window_localstorage.js b/lib/js/src-ocaml/web_window_localstorage.js deleted file mode 100644 index c2f3af1..0000000 --- a/lib/js/src-ocaml/web_window_localstorage.js +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function length($$window) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.length); - } - -} - -function clear($$window) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.clear()); - } - -} - -function key($$window, idx) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.key(idx)); - } - -} - -function getItem($$window, key) { - var match = $$window.localStorage; - if (match !== undefined) { - try { - return Caml_option.some(match.getItem(key)); - } - catch (exn){ - return ; - } - } - -} - -function removeItem($$window, key) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.removeItem(key)); - } - -} - -function setItem($$window, key, value) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.setItem(key, value)); - } - -} - -exports.length = length; -exports.clear = clear; -exports.key = key; -exports.getItem = getItem; -exports.removeItem = removeItem; -exports.setItem = setItem; -/* No side effect */ diff --git a/lib/js/src-ocaml/web_xmlhttprequest.js b/lib/js/src-ocaml/web_xmlhttprequest.js deleted file mode 100644 index 00eebe4..0000000 --- a/lib/js/src-ocaml/web_xmlhttprequest.js +++ /dev/null @@ -1,924 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var $$Array = require("bs-platform/lib/js/array.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Web_formdata = require("./web_formdata.js"); -var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function abort(x) { - return x.abort(); -} - -function getAllResponseHeaders(x) { - var match = x.getAllResponseHeaders(); - if (match !== null) { - if (match === "") { - return /* Error */Block.__(1, [/* NetworkError */1]); - } else { - return /* Ok */Block.__(0, [match]); - } - } else { - return /* Error */Block.__(1, [/* IncompleteResponse */0]); - } -} - -function getAllResponseHeadersAsList(x) { - var err = getAllResponseHeaders(x); - if (err.tag) { - return err; - } else { - return /* Ok */Block.__(0, [List.map((function (param) { - if (param.length !== 2) { - throw [ - Caml_builtin_exceptions.failure, - "Cannot happen, already checked length" - ]; - } - var key = param[0]; - var value = param[1]; - return /* tuple */[ - key, - value - ]; - }), List.filter((function (a) { - return a.length === 2; - }))($$Array.to_list($$Array.map((function (param) { - return param.split(": ", 2); - }), err[0].split("\r\n")))))]); - } -} - -function getAllResponseHeadersAsDict(x) { - var height = function (param) { - if (param) { - return param[/* h */4]; - } else { - return 0; - } - }; - var create = function (l, x, d, r) { - var hl = height(l); - var hr = height(r); - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - }; - var singleton = function (x, d) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */d, - /* r : Empty */0, - /* h */1 - ]; - }; - var bal = function (l, x, d, r) { - var hl = l ? l[/* h */4] : 0; - var hr = r ? r[/* h */4] : 0; - if (hl > (hr + 2 | 0)) { - if (l) { - var lr = l[/* r */3]; - var ld = l[/* d */2]; - var lv = l[/* v */1]; - var ll = l[/* l */0]; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } else if (lr) { - return create(create(ll, lv, ld, lr[/* l */0]), lr[/* v */1], lr[/* d */2], create(lr[/* r */3], x, d, r)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else if (hr > (hl + 2 | 0)) { - if (r) { - var rr = r[/* r */3]; - var rd = r[/* d */2]; - var rv = r[/* v */1]; - var rl = r[/* l */0]; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } else if (rl) { - return create(create(l, x, d, rl[/* l */0]), rl[/* v */1], rl[/* d */2], create(rl[/* r */3], rv, rd, rr)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - } - }; - var add = function (x, data, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = add(x, data, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */data, - /* r : Empty */0, - /* h */1 - ]; - } - }; - var min_binding = function (_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; - }; - var remove_min_binding = function (param) { - if (param) { - var l = param[/* l */0]; - if (l) { - return bal(remove_min_binding(l), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return param[/* r */3]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.remove_min_elt" - ]; - } - }; - var merge = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var remove = function (x, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return merge(l, r); - } else if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = remove(x, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Empty */0; - } - }; - var update = function (x, f, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - var match = Curry._1(f, Caml_option.some(d)); - if (match !== undefined) { - var data = Caml_option.valFromOption(match); - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else { - return merge(l, r); - } - } else if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = update(x, f, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - var match$1 = Curry._1(f, undefined); - if (match$1 !== undefined) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */Caml_option.valFromOption(match$1), - /* r : Empty */0, - /* h */1 - ]; - } else { - return /* Empty */0; - } - } - }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (param) { - iter(f, param[/* l */0]); - Curry._2(f, param[/* v */1], param[/* d */2]); - _param = param[/* r */3]; - continue ; - } else { - return /* () */0; - } - }; - }; - var map = function (f, param) { - if (param) { - var l$prime = map(f, param[/* l */0]); - var d$prime = Curry._1(f, param[/* d */2]); - var r$prime = map(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */param[/* v */1], - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var mapi = function (f, param) { - if (param) { - var v = param[/* v */1]; - var l$prime = mapi(f, param[/* l */0]); - var d$prime = Curry._2(f, v, param[/* d */2]); - var r$prime = mapi(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */v, - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var fold = function (f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (m) { - _accu = Curry._3(f, m[/* v */1], m[/* d */2], fold(f, m[/* l */0], accu)); - _m = m[/* r */3]; - continue ; - } else { - return accu; - } - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) && for_all(p, param[/* l */0])) { - _param = param[/* r */3]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; - }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) || exists(p, param[/* l */0])) { - return true; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return false; - } - }; - }; - var add_min_binding = function (k, x, param) { - if (param) { - return bal(add_min_binding(k, x, param[/* l */0]), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return singleton(k, x); - } - }; - var add_max_binding = function (k, x, param) { - if (param) { - return bal(param[/* l */0], param[/* v */1], param[/* d */2], add_max_binding(k, x, param[/* r */3])); - } else { - return singleton(k, x); - } - }; - var join = function (l, v, d, r) { - if (l) { - if (r) { - var rh = r[/* h */4]; - var lh = l[/* h */4]; - if (lh > (rh + 2 | 0)) { - return bal(l[/* l */0], l[/* v */1], l[/* d */2], join(l[/* r */3], v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r[/* l */0]), r[/* v */1], r[/* d */2], r[/* r */3]); - } else { - return create(l, v, d, r); - } - } else { - return add_max_binding(v, d, l); - } - } else { - return add_min_binding(v, d, r); - } - }; - var concat = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var concat_or_join = function (t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); - } - }; - var split = function (x, param) { - if (param) { - var r = param[/* r */3]; - var d = param[/* d */2]; - var v = param[/* v */1]; - var l = param[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return /* tuple */[ - l, - Caml_option.some(d), - r - ]; - } else if (c < 0) { - var match = split(x, l); - return /* tuple */[ - match[0], - match[1], - join(match[2], v, d, r) - ]; - } else { - var match$1 = split(x, r); - return /* tuple */[ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - undefined, - /* Empty */0 - ]; - } - }; - var merge$1 = function (f, s1, s2) { - if (s1) { - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1[/* l */0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[/* d */2]), match[1]), merge$1(f, s1[/* r */3], match[2])); - } - - } else if (!s2) { - return /* Empty */0; - } - if (s2) { - var v2 = s2[/* v */1]; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2[/* l */0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[/* d */2])), merge$1(f, match$1[2], s2[/* r */3])); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "map.ml", - 393, - 10 - ] - ]; - } - }; - var union = function (f, s1, s2) { - if (s1) { - if (s2) { - var d2 = s2[/* d */2]; - var v2 = s2[/* v */1]; - var d1 = s1[/* d */2]; - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= s2[/* h */4]) { - var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1[/* l */0], match[0]); - var r = union(f, s1[/* r */3], match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } - } else { - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2[/* l */0]); - var r$1 = union(f, match$1[2], s2[/* r */3]); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); - } else { - return join(l$1, v2, d2, r$1); - } - } - } else { - return s1; - } - } else { - return s2; - } - }; - var filter = function (p, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var l$prime = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$prime = filter(p, r); - if (pvd) { - if (l === l$prime && r === r$prime) { - return m; - } else { - return join(l$prime, v, d, r$prime); - } - } else { - return concat(l$prime, r$prime); - } - } else { - return /* Empty */0; - } - }; - var partition = function (p, param) { - if (param) { - var d = param[/* d */2]; - var v = param[/* v */1]; - var match = partition(p, param[/* l */0]); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param[/* r */3]); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return /* tuple */[ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return /* tuple */[ - concat(lt, rt), - join(lf, v, d, rf) - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - /* Empty */0 - ]; - } - }; - var cardinal = function (param) { - if (param) { - return (cardinal(param[/* l */0]) + 1 | 0) + cardinal(param[/* r */3]) | 0; - } else { - return 0; - } - }; - var bindings_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[/* l */0]; - _accu = /* :: */[ - /* tuple */[ - param[/* v */1], - param[/* d */2] - ], - bindings_aux(accu, param[/* r */3]) - ]; - continue ; - } else { - return accu; - } - }; - }; - var err = getAllResponseHeadersAsList(x); - if (err.tag) { - return err; - } else { - var insert = function (d, param) { - return add(param[0], param[1], d); - }; - return /* Ok */Block.__(0, [List.fold_left(insert, /* Empty */0, err[0])]); - } -} - -function getResponseHeader(key, x) { - return Caml_option.null_to_opt(x.getResponse(key)); -} - -function open_(method$prime, url, $staropt$star, $staropt$star$1, $staropt$star$2, x) { - var async = $staropt$star !== undefined ? $staropt$star : true; - var user = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - var password = $staropt$star$2 !== undefined ? $staropt$star$2 : ""; - return x.open(method$prime, url, async, user, password); -} - -function overrideMimeType(mimetype, x) { - return x.overrideMimeType(mimetype); -} - -function send(body, x) { - if (typeof body === "number") { - if (body === /* EmptyBody */0) { - return x.send(); - } else { - return x.send(null); - } - } else { - switch (body.tag | 0) { - case /* FormListBody */2 : - var form = List.fold_left((function (f, param) { - Web_formdata.append(param[0], param[1], f); - return f; - }), new FormData(), body[0]); - return x.send(form); - case /* StringBody */0 : - case /* FormDataBody */1 : - case /* DocumentBody */3 : - return x.send(body[0]); - - } - } -} - -function setRequestHeader(header, value, x) { - return x.setRequestHeader(header, value); -} - -function set_onreadystatechange(cb, x) { - x.onreadystatechange = cb; - return /* () */0; -} - -function get_onreadystatechange(x) { - return x.onreadystatechange; -} - -function readyState(x) { - var i = x.readyState; - if (i > 4 || i < 0) { - var s = "Invalid return from 'readystate' of: " + String(i); - throw [ - Caml_builtin_exceptions.failure, - s - ]; - } else { - return i; - } -} - -function set_responseType(typ, x) { - if (typeof typ === "number") { - switch (typ) { - case /* StringResponseType */0 : - x.responseType = ""; - return /* () */0; - case /* ArrayBufferResponseType */1 : - x.responseType = "arraybuffer"; - return /* () */0; - case /* BlobResponseType */2 : - x.responseType = "blob"; - return /* () */0; - case /* DocumentResponseType */3 : - x.responseType = "document"; - return /* () */0; - case /* JsonResponseType */4 : - x.responseType = "json"; - return /* () */0; - case /* TextResponseType */5 : - x.responseType = "text"; - return /* () */0; - - } - } else { - x.responseType = typ[0]; - return /* () */0; - } -} - -function get_responseType(x) { - var s = x.responseType; - switch (s) { - case "" : - return /* StringResponseType */0; - case "arraybuffer" : - return /* ArrayBufferResponseType */1; - case "blob" : - return /* BlobResponseType */2; - case "document" : - return /* DocumentResponseType */3; - case "json" : - return /* JsonResponseType */4; - case "text" : - return /* TextResponseType */5; - default: - return /* RawResponseType */[s]; - } -} - -function get_response(x) { - var match = x.response; - if (match !== null) { - var match$1 = get_responseType(x); - if (typeof match$1 === "number") { - switch (match$1) { - case /* StringResponseType */0 : - return /* StringResponse */Block.__(0, [match]); - case /* ArrayBufferResponseType */1 : - return /* ArrayBufferResponse */Block.__(1, [match]); - case /* BlobResponseType */2 : - return /* BlobResponse */Block.__(2, [match]); - case /* DocumentResponseType */3 : - return /* DocumentResponse */Block.__(3, [match]); - case /* JsonResponseType */4 : - return /* JsonResponse */Block.__(4, [match]); - case /* TextResponseType */5 : - return /* TextResponse */Block.__(5, [match]); - - } - } else { - return /* RawResponse */Block.__(6, [ - match$1[0], - match - ]); - } - } else { - return /* NoResponse */0; - } -} - -function get_responseText(x) { - return x.responseText; -} - -function get_responseURL(x) { - return x.responseURL; -} - -function get_responseXML(x) { - return Caml_option.null_to_opt(x.responseXML); -} - -function get_status(x) { - return x.status; -} - -function get_statusText(x) { - return x.statusText; -} - -function set_timeout(t, x) { - x.timeout = t; - return /* () */0; -} - -function get_timeout(x) { - return x.timeout; -} - -function set_withCredentials(b, x) { - x.withCredentials = b; - return /* () */0; -} - -function get_withCredentials(x) { - return x.withCredentials; -} - -function set_onabort(cb, x) { - x.onabort = cb; - return /* () */0; -} - -function get_onabort(x) { - return x.onabort; -} - -function set_onerror(cb, x) { - x.onerror = cb; - return /* () */0; -} - -function get_onerror(x) { - return x.onerror; -} - -function set_onload(cb, x) { - x.onload = cb; - return /* () */0; -} - -function get_onload(x) { - return x.onload; -} - -function set_onloadstart(cb, x) { - x.onloadstart = cb; - return /* () */0; -} - -function get_onloadstart(x) { - return x.onloadstart; -} - -function set_onprogress(cb, x) { - x.onprogress = cb; - return /* () */0; -} - -function get_onprogress(x) { - return x.onprogress; -} - -function set_ontimeout(cb, x) { - x.ontimeout = cb; - return /* () */0; -} - -function get_ontimeout(x) { - return x.ontimeout; -} - -function set_onloadend(cb, x) { - x.onloadend = cb; - return /* () */0; -} - -function get_onloadend(x) { - return x.onloadend; -} - -exports.abort = abort; -exports.getAllResponseHeaders = getAllResponseHeaders; -exports.getAllResponseHeadersAsList = getAllResponseHeadersAsList; -exports.getAllResponseHeadersAsDict = getAllResponseHeadersAsDict; -exports.getResponseHeader = getResponseHeader; -exports.open_ = open_; -exports.overrideMimeType = overrideMimeType; -exports.send = send; -exports.setRequestHeader = setRequestHeader; -exports.set_onreadystatechange = set_onreadystatechange; -exports.get_onreadystatechange = get_onreadystatechange; -exports.readyState = readyState; -exports.set_responseType = set_responseType; -exports.get_responseType = get_responseType; -exports.get_response = get_response; -exports.get_responseText = get_responseText; -exports.get_responseURL = get_responseURL; -exports.get_responseXML = get_responseXML; -exports.get_status = get_status; -exports.get_statusText = get_statusText; -exports.set_timeout = set_timeout; -exports.get_timeout = get_timeout; -exports.set_withCredentials = set_withCredentials; -exports.get_withCredentials = get_withCredentials; -exports.set_onabort = set_onabort; -exports.get_onabort = get_onabort; -exports.set_onerror = set_onerror; -exports.get_onerror = get_onerror; -exports.set_onload = set_onload; -exports.get_onload = get_onload; -exports.set_onloadstart = set_onloadstart; -exports.get_onloadstart = get_onloadstart; -exports.set_onprogress = set_onprogress; -exports.get_onprogress = get_onprogress; -exports.set_ontimeout = set_ontimeout; -exports.get_ontimeout = get_ontimeout; -exports.set_onloadend = set_onloadend; -exports.get_onloadend = get_onloadend; -/* No side effect */ diff --git a/lib/js/test-ocaml/app_test_client.js b/lib/js/test-ocaml/app_test_client.js deleted file mode 100644 index 30269de..0000000 --- a/lib/js/test-ocaml/app_test_client.js +++ /dev/null @@ -1,28080 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Test_client = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) { - var match = parentNode.firstChild; - if (match !== null) { - parentNode.removeChild(match); - } - - }; - return /* () */0; - }; - var oldSub = { - contents: /* NoSub */0 - }; - var handleSubscriptionChange = function (model) { - var newSub = Curry._1(subscriptions, model); - oldSub.contents = Tea_sub.run(callbacks, callbacks, oldSub.contents, newSub); - return /* () */0; - }; - var handlerStartup = function (param) { - clearPnode(/* () */0); - Tea_cmd.run(callbacks, initCmd); - handleSubscriptionChange(latestModel.contents); - nextFrameID.contents = -1; - doRender(16); - return /* () */0; - }; - var render_string = function (model) { - return Vdom.renderToHtmlString(Curry._1(view, model)); - }; - var handler = function (model, msg) { - var match = Curry._2(update, model, msg); - var newModel = match[0]; - latestModel.contents = newModel; - Tea_cmd.run(callbacks, match[1]); - scheduleRender(/* () */0); - handleSubscriptionChange(newModel); - return newModel; - }; - var handlerShutdown = function (cmd) { - nextFrameID.contents = undefined; - Tea_cmd.run(callbacks, cmd); - oldSub.contents = Tea_sub.run(callbacks, callbacks, oldSub.contents, /* NoSub */0); - priorRenderedVdom.contents = /* [] */0; - clearPnode(/* () */0); - return /* () */0; - }; - return { - startup: handlerStartup, - render_string: render_string, - handleMsg: handler, - shutdown: handlerShutdown - }; - }); - } else { - return (function (callbacks) { - var oldSub = { - contents: /* NoSub */0 - }; - var handleSubscriptionChange = function (model) { - var newSub = Curry._1(subscriptions, model); - oldSub.contents = Tea_sub.run(callbacks, callbacks, oldSub.contents, newSub); - return /* () */0; - }; - return { - startup: (function (param) { - Tea_cmd.run(callbacks, initCmd); - handleSubscriptionChange(initModel); - return /* () */0; - }), - render_string: (function (model) { - return Vdom.renderToHtmlString(Curry._1(view, model)); - }), - handleMsg: (function (model, msg) { - var match = Curry._2(update, model, msg); - var newModel = match[0]; - Tea_cmd.run(callbacks, match[1]); - handleSubscriptionChange(newModel); - return newModel; - }), - shutdown: (function (cmd) { - Tea_cmd.run(callbacks, cmd); - oldSub.contents = Tea_sub.run(callbacks, callbacks, oldSub.contents, /* NoSub */0); - return /* () */0; - }) - }; - }); - } -} - -function program(param, pnode, flags) { - Web.polyfills(/* () */0); - var match = Curry._1(param.init, flags); - var initModel = match[0]; - var opnode = (pnode == null) ? undefined : Caml_option.some(pnode); - var pumpInterface = programLoop(param.update, param.view, param.subscriptions, initModel, match[1], opnode); - return programStateWrapper(initModel, pumpInterface, param.shutdown); -} - -function standardProgram(param, pnode, args) { - return program({ - init: param.init, - update: param.update, - view: param.view, - subscriptions: param.subscriptions, - shutdown: (function (_model) { - return /* NoCmd */0; - }) - }, pnode, args); -} - -function beginnerProgram(param, pnode, param$1) { - var update = param.update; - var model = param.model; - return standardProgram({ - init: (function (param) { - return /* tuple */[ - model, - /* NoCmd */0 - ]; - }), - update: (function (model, msg) { - return /* tuple */[ - Curry._2(update, model, msg), - /* NoCmd */0 - ]; - }), - view: param.view, - subscriptions: (function (_model) { - return /* NoSub */0; - }) - }, pnode, /* () */0); -} - -var map = Vdom.map; - -exports.programStateWrapper = programStateWrapper; -exports.programLoop = programLoop; -exports.program = program; -exports.standardProgram = standardProgram; -exports.beginnerProgram = beginnerProgram; -exports.map = map; -/* No side effect */ - -},{"./tea_cmd.js":2,"./tea_sub.js":12,"./vdom.js":14,"./web.js":15,"bs-platform/lib/js/caml_builtin_exceptions.js":40,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61}],2:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); - -function batch(cmds) { - return /* Batch */Block.__(1, [cmds]); -} - -function call(call$1) { - return /* EnqueueCall */Block.__(2, [call$1]); -} - -function fnMsg(fnMsg$1) { - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - return Curry._1(callbacks.contents.enqueue, Curry._1(fnMsg$1, /* () */0)); - })]); -} - -function msg(msg$1) { - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - return Curry._1(callbacks.contents.enqueue, msg$1); - })]); -} - -function run(_callbacks, _param) { - while(true) { - var param = _param; - var callbacks = _callbacks; - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* Mapper */0 : - var subCallbacks = Curry._1(param[0], callbacks); - _param = param[1]; - _callbacks = subCallbacks; - continue ; - case /* Batch */1 : - return List.fold_left((function(callbacks){ - return function (param, cmd) { - return run(callbacks, cmd); - } - }(callbacks)), /* () */0, param[0]); - case /* EnqueueCall */2 : - return Curry._1(param[0], callbacks); - - } - } - }; -} - -function map(func, cmd) { - var mapper = function (param) { - return Vdom.wrapCallbacks(func, param); - }; - return /* Mapper */Block.__(0, [ - mapper, - cmd - ]); -} - -var none = /* NoCmd */0; - -exports.none = none; -exports.batch = batch; -exports.call = call; -exports.fnMsg = fnMsg; -exports.msg = msg; -exports.run = run; -exports.map = map; -/* No side effect */ - -},{"./vdom.js":14,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61}],3:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Printf = require("bs-platform/lib/js/printf.js"); -var $$String = require("bs-platform/lib/js/string.js"); -var Tea_app = require("./tea_app.js"); -var Tea_cmd = require("./tea_cmd.js"); -var Tea_sub = require("./tea_sub.js"); -var Tea_html2 = require("./tea_html2.js"); -var Tea_navigation = require("./tea_navigation.js"); - -function client_msg(msg) { - return /* ClientMsg */Block.__(0, [msg]); -} - -function debug(string_of_msg, update, view, subscriptions, shutdown) { - var init_debug = function (param) { - return /* tuple */[ - { - history: /* :: */[ - /* tuple */[ - "_init_", - param[0] - ], - /* [] */0 - ], - state: /* Running */0, - show_details: false - }, - Tea_cmd.map(client_msg, param[1]) - ]; - }; - var update$prime = function (model, param) { - if (typeof param === "number") { - if (param === /* TogglePaused */0) { - var match = model.state; - if (match) { - return /* tuple */[ - { - history: model.history, - state: /* Running */0, - show_details: model.show_details - }, - /* NoCmd */0 - ]; - } else { - return /* tuple */[ - { - history: model.history, - state: /* Paused */[0], - show_details: model.show_details - }, - /* NoCmd */0 - ]; - } - } else { - return /* tuple */[ - { - history: model.history, - state: model.state, - show_details: !model.show_details - }, - /* NoCmd */0 - ]; - } - } else if (param.tag) { - return /* tuple */[ - { - history: model.history, - state: /* Paused */[param[0]], - show_details: model.show_details - }, - /* NoCmd */0 - ]; - } else if (model.state === /* Running */0) { - var msg = param[0]; - var match$1 = List.hd(model.history); - var match$2 = Curry._2(update, match$1[1], msg); - var dmodel$prime_history = /* :: */[ - /* tuple */[ - Curry._1(string_of_msg, msg), - match$2[0] - ], - model.history - ]; - var dmodel$prime_state = model.state; - var dmodel$prime_show_details = model.show_details; - var dmodel$prime = { - history: dmodel$prime_history, - state: dmodel$prime_state, - show_details: dmodel$prime_show_details - }; - return /* tuple */[ - dmodel$prime, - Tea_cmd.map(client_msg, match$2[1]) - ]; - } else { - return /* tuple */[ - model, - /* NoCmd */0 - ]; - } - }; - var view_styles = function (param) { - var rule = function (selector, properties) { - return /* Text */Block.__(1, [Curry._2(Printf.sprintf(/* Format */[ - /* String */Block.__(2, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - " {", - /* String */Block.__(2, [ - /* No_padding */0, - /* Char_literal */Block.__(12, [ - /* "}" */125, - /* End_of_format */0 - ]) - ]) - ]) - ]), - "%s {%s}" - ]), selector, $$String.concat(";", List.map((function (param) { - return param[0] + (":" + param[1]); - }), properties)))]); - }; - return Tea_html2.node(undefined, "style", undefined, undefined, /* [] */0, /* :: */[ - rule("#debug.paused", /* :: */[ - /* tuple */[ - "position", - "fixed" - ], - /* :: */[ - /* tuple */[ - "top", - "0" - ], - /* :: */[ - /* tuple */[ - "left", - "0" - ], - /* :: */[ - /* tuple */[ - "width", - "100%" - ], - /* :: */[ - /* tuple */[ - "height", - "100%" - ], - /* :: */[ - /* tuple */[ - "pointer-events", - "all" - ], - /* :: */[ - /* tuple */[ - "background-color", - "rgba(0,0,0,.1)" - ], - /* :: */[ - /* tuple */[ - "box-shadow", - "inset 0 0 10px #333" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav", /* :: */[ - /* tuple */[ - "position", - "fixed" - ], - /* :: */[ - /* tuple */[ - "max-width", - "50%" - ], - /* :: */[ - /* tuple */[ - "bottom", - "0" - ], - /* :: */[ - /* tuple */[ - "right", - "6px" - ], - /* :: */[ - /* tuple */[ - "border-radius", - "4px 4px 0 0" - ], - /* :: */[ - /* tuple */[ - "background-color", - "#444" - ], - /* :: */[ - /* tuple */[ - "color", - "#fff" - ], - /* :: */[ - /* tuple */[ - "font-family", - "monospace" - ], - /* :: */[ - /* tuple */[ - "box-shadow", - "0 0 10px #333" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug.paused nav", /* :: */[ - /* tuple */[ - "height", - "50%" - ], - /* :: */[ - /* tuple */[ - "padding-bottom", - "2em" - ], - /* [] */0 - ] - ]), - /* :: */[ - rule("#debug nav .toggle", /* :: */[ - /* tuple */[ - "padding", - "6px" - ], - /* :: */[ - /* tuple */[ - "padding-left", - "9px" - ], - /* :: */[ - /* tuple */[ - "cursor", - "pointer" - ], - /* :: */[ - /* tuple */[ - "min-width", - "24ch" - ], - /* :: */[ - /* tuple */[ - "text-align", - "center" - ], - /* :: */[ - /* tuple */[ - "border-left", - "3px solid #333" - ], - /* :: */[ - /* tuple */[ - "border-radius", - "4px 4px 0 0" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .toggle:before", /* :: */[ - /* tuple */[ - "content", - "' '" - ], - /* :: */[ - /* tuple */[ - "position", - "absolute" - ], - /* :: */[ - /* tuple */[ - "left", - "0" - ], - /* :: */[ - /* tuple */[ - "top", - "0" - ], - /* :: */[ - /* tuple */[ - "width", - ".5ch" - ], - /* :: */[ - /* tuple */[ - "height", - "1.8ch" - ], - /* :: */[ - /* tuple */[ - "margin", - "1.2ch" - ], - /* :: */[ - /* tuple */[ - "border", - "solid #fff" - ], - /* :: */[ - /* tuple */[ - "border-width", - "0 .5ch" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug.paused nav .toggle:before", /* :: */[ - /* tuple */[ - "border-color", - "transparent" - ], - /* :: */[ - /* tuple */[ - "border-left-color", - "#fff" - ], - /* :: */[ - /* tuple */[ - "border-width", - "1ch" - ], - /* :: */[ - /* tuple */[ - "width", - "0" - ], - /* :: */[ - /* tuple */[ - "height", - "0" - ], - /* [] */0 - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .history", /* :: */[ - /* tuple */[ - "margin", - "0" - ], - /* :: */[ - /* tuple */[ - "padding", - "0" - ], - /* :: */[ - /* tuple */[ - "height", - "100%" - ], - /* :: */[ - /* tuple */[ - "overflow-y", - "auto" - ], - /* :: */[ - /* tuple */[ - "list-style", - "none" - ], - /* [] */0 - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .history li", /* :: */[ - /* tuple */[ - "margin", - "0" - ], - /* :: */[ - /* tuple */[ - "padding", - "0.2ch" - ], - /* :: */[ - /* tuple */[ - "border-left", - "3px solid #333" - ], - /* [] */0 - ] - ] - ]), - /* :: */[ - rule("#debug nav .history li.selected", /* :: */[ - /* tuple */[ - "background-color", - "#333" - ], - /* [] */0 - ]), - /* :: */[ - rule("#debug nav .history span.details", /* :: */[ - /* tuple */[ - "display", - "inline-block" - ], - /* :: */[ - /* tuple */[ - "cursor", - "pointer" - ], - /* :: */[ - /* tuple */[ - "width", - "1ch" - ], - /* :: */[ - /* tuple */[ - "margin", - "0 1ch" - ], - /* :: */[ - /* tuple */[ - "vertical-align", - "super" - ], - /* [] */0 - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .history li.selected span.details:after", /* :: */[ - /* tuple */[ - "content", - "'\\2026'" - ], - /* [] */0 - ]), - /* :: */[ - rule("#debug nav .history li.selected.show", /* :: */[ - /* tuple */[ - "border-left", - "3px solid white" - ], - /* [] */0 - ]), - /* :: */[ - rule("#debug nav .history span.message", /* :: */[ - /* tuple */[ - "display", - "inline-block" - ], - /* :: */[ - /* tuple */[ - "cursor", - "pointer" - ], - /* :: */[ - /* tuple */[ - "white-space", - "nowrap" - ], - /* :: */[ - /* tuple */[ - "overflow", - "hidden" - ], - /* :: */[ - /* tuple */[ - "text-overflow", - "ellipsis" - ], - /* :: */[ - /* tuple */[ - "width", - "calc(100% - 75px)" - ], - /* [] */0 - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug nav .history span.index", /* :: */[ - /* tuple */[ - "display", - "inline-block" - ], - /* :: */[ - /* tuple */[ - "min-width", - "3ch" - ], - /* :: */[ - /* tuple */[ - "margin", - "0 1ch" - ], - /* :: */[ - /* tuple */[ - "color", - "#aaa" - ], - /* :: */[ - /* tuple */[ - "text-align", - "right" - ], - /* :: */[ - /* tuple */[ - "float", - "right" - ], - /* [] */0 - ] - ] - ] - ] - ] - ]), - /* :: */[ - rule("#debug aside.details", /* :: */[ - /* tuple */[ - "position", - "absolute" - ], - /* :: */[ - /* tuple */[ - "width", - "40ch" - ], - /* :: */[ - /* tuple */[ - "top", - "0" - ], - /* :: */[ - /* tuple */[ - "bottom", - "0" - ], - /* :: */[ - /* tuple */[ - "right", - "100%" - ], - /* :: */[ - /* tuple */[ - "margin-right", - "1.5ch" - ], - /* :: */[ - /* tuple */[ - "overflow", - "scroll" - ], - /* :: */[ - /* tuple */[ - "background-color", - "#fff" - ], - /* :: */[ - /* tuple */[ - "color", - "#000" - ], - /* :: */[ - /* tuple */[ - "box-shadow", - "0 0 10px #333" - ], - /* :: */[ - /* tuple */[ - "border-radius", - "4px 4px 0 0" - ], - /* :: */[ - /* tuple */[ - "border", - "2px solid #333" - ], - /* :: */[ - /* tuple */[ - "padding", - "1ch" - ], - /* :: */[ - /* tuple */[ - "white-space", - "pre" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ]), - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ]); - }; - var view_details = function (model) { - var format = (function (v) { - var formatRecord = function (data, labels) { - return data.reduce( - function (acc, cur, index) { - acc[labels[index]] = formatValue(cur) - return acc - }, {}) - } - var listToArray = function (data) { - var result = [] - var cur = data - while (typeof cur !== "number") { - result.push(formatValue(cur[0])) - cur = cur[1] - } - return result - } - var formatVariant = function (data, recordVariant) { - if (recordVariant === "::") { - return listToArray(data) - } - else { - return formatRecord(data, [recordVariant]) - } - } - var formatValue = function (x) { - var recordLabels, recordVariant, recordModule, recordPolyVar - if (x == null) { - return null - } - else if ((recordLabels = x[Symbol.for('BsRecord')]) !== undefined) { - return formatRecord(x, recordLabels) - } - else if ((recordModule = x[Symbol.for('BsLocalModule')]) !== undefined) { - return formatRecord(x, recordModule) - } - else if ((recordVariant = x[Symbol.for('BsVariant')]) !== undefined) { - return formatVariant(x, recordVariant) - } - else if ((recordPolyVar = x[Symbol.for('BsPolyVar')]) !== undefined) { - return x[1] - } - else if (Array.isArray(x)) { - // tuple - return x.map(formatValue) - } - else { - // scalar - return x - } - } - return JSON.stringify(formatValue(v), null, 2); - }); - return Tea_html2.aside(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("details"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [format(model)]), - /* [] */0 - ]); - }; - var view_history = function (model, selected_index) { - var count = List.length(model.history); - return Tea_html2.ul(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("history"), - /* [] */0 - ], List.mapi((function (i, param) { - var selected = i === selected_index; - return Tea_html2.li(undefined, undefined, /* :: */[ - Tea_html2.Events.onClick(/* SelectHistoryItem */Block.__(1, [i])), - /* :: */[ - Tea_html2.Attributes.classList(/* :: */[ - /* tuple */[ - "selected", - selected - ], - /* :: */[ - /* tuple */[ - "show", - selected && model.show_details - ], - /* [] */0 - ] - ]), - /* [] */0 - ] - ], /* :: */[ - Tea_html2.span(undefined, undefined, /* :: */[ - Tea_html2.Attributes.classList(/* :: */[ - /* tuple */[ - "details", - true - ], - /* :: */[ - /* tuple */[ - "show", - true - ], - /* [] */0 - ] - ]), - selected ? /* :: */[ - Tea_html2.Events.onClick(/* ToggleDetails */1), - /* :: */[ - Tea_html2.Attributes.title("toggle details"), - /* [] */0 - ] - ] : /* :: */[ - Tea_html2.Attributes.noProp, - /* :: */[ - Tea_html2.Attributes.noProp, - /* [] */0 - ] - ] - ], /* :: */[ - selected && model.show_details ? view_details(param[1]) : Tea_html2.noNode, - /* [] */0 - ]), - /* :: */[ - Tea_html2.span(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("message"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [param[0]]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.span(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("index"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(count - i | 0)]), - /* [] */0 - ]), - /* [] */0 - ] - ] - ]); - }), model.history)); - }; - var view$prime = function (model) { - var match = model.state; - var match$1; - if (match) { - var index = match[0]; - match$1 = /* tuple */[ - index, - List.nth(model.history, index)[1], - true - ]; - } else { - match$1 = /* tuple */[ - 0, - List.hd(model.history)[1], - false - ]; - } - var paused = match$1[2]; - var history_count = List.length(model.history); - var vnode = Curry._1(view, match$1[1]); - return Tea_html2.div(undefined, undefined, /* [] */0, /* :: */[ - Vdom.map(client_msg, vnode), - /* :: */[ - Tea_html2.div(undefined, undefined, /* :: */[ - Tea_html2.Attributes.id("debug"), - /* :: */[ - Tea_html2.Attributes.classList(/* :: */[ - /* tuple */[ - "paused", - paused - ], - /* [] */0 - ]), - /* [] */0 - ] - ], /* :: */[ - view_styles(/* () */0), - /* :: */[ - Tea_html2.nav(undefined, undefined, /* [] */0, /* :: */[ - Tea_html2.div(undefined, undefined, /* :: */[ - Tea_html2.Attributes.class$prime("toggle"), - /* :: */[ - Tea_html2.Events.onClick(/* TogglePaused */0), - /* :: */[ - paused ? Tea_html2.Attributes.title("click to resume") : Tea_html2.Attributes.title("click to pause"), - /* [] */0 - ] - ] - ], /* :: */[ - /* Text */Block.__(1, [Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */Block.__(11, [ - "Explore History (", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* Char_literal */Block.__(12, [ - /* ")" */41, - /* End_of_format */0 - ]) - ]) - ]), - "Explore History (%d)" - ]), history_count)]), - /* [] */0 - ]), - /* :: */[ - paused ? view_history(model, match$1[0]) : Tea_html2.noNode, - /* [] */0 - ] - ]), - /* [] */0 - ] - ]), - /* [] */0 - ] - ]); - }; - var subscriptions$prime = function (model) { - return Tea_sub.map(client_msg, Curry._1(subscriptions, List.hd(model.history)[1])); - }; - var shutdown$prime = function (model) { - return Tea_cmd.map(client_msg, Curry._1(shutdown, List.hd(model.history)[1])); - }; - return /* tuple */[ - init_debug, - update$prime, - view$prime, - subscriptions$prime, - shutdown$prime - ]; -} - -function debug_program(string_of_msg, param) { - var init = param.init; - var match = debug(string_of_msg, param.update, param.view, param.subscriptions, param.shutdown); - var init_debug = match[0]; - return { - init: (function (flags) { - return Curry._1(init_debug, Curry._1(init, flags)); - }), - update: match[1], - view: match[2], - subscriptions: match[3], - shutdown: match[4] - }; -} - -function debug_navigation_program(string_of_msg, param) { - var init = param.init; - var match = debug(string_of_msg, param.update, param.view, param.subscriptions, param.shutdown); - var init_debug = match[0]; - return { - init: (function (flags, $$location) { - return Curry._1(init_debug, Curry._2(init, flags, $$location)); - }), - update: match[1], - view: match[2], - subscriptions: match[3], - shutdown: match[4] - }; -} - -function beginnerProgram(param, string_of_msg, pnode, flags) { - var update = param.update; - var model = param.model; - var debugged = debug_program(string_of_msg, { - init: (function (param) { - return /* tuple */[ - model, - /* NoCmd */0 - ]; - }), - update: (function (model, msg) { - return /* tuple */[ - Curry._2(update, model, msg), - /* NoCmd */0 - ]; - }), - view: param.view, - subscriptions: (function (_model) { - return /* NoSub */0; - }), - shutdown: (function (_model) { - return /* NoCmd */0; - }) - }); - return Tea_app.program(debugged, pnode, flags); -} - -function standardProgram(param, string_of_msg, pnode, flags) { - var debugged = debug_program(string_of_msg, { - init: param.init, - update: param.update, - view: param.view, - subscriptions: param.subscriptions, - shutdown: (function (_model) { - return /* NoCmd */0; - }) - }); - return Tea_app.program(debugged, pnode, flags); -} - -function program(param, string_of_msg, pnode, flags) { - var debugged = debug_program(string_of_msg, { - init: param.init, - update: param.update, - view: param.view, - subscriptions: param.subscriptions, - shutdown: param.shutdown - }); - return Tea_app.program(debugged, pnode, flags); -} - -function navigationProgram(location_to_msg, param, string_of_msg, pnode, flags) { - var $$location = function ($$location$1) { - return /* ClientMsg */Block.__(0, [Curry._1(location_to_msg, $$location$1)]); - }; - var debugged = debug_navigation_program(string_of_msg, { - init: param.init, - update: param.update, - view: param.view, - subscriptions: param.subscriptions, - shutdown: param.shutdown - }); - return Tea_navigation.navigationProgram($$location, debugged)(pnode, flags); -} - -exports.client_msg = client_msg; -exports.debug = debug; -exports.debug_program = debug_program; -exports.debug_navigation_program = debug_navigation_program; -exports.beginnerProgram = beginnerProgram; -exports.standardProgram = standardProgram; -exports.program = program; -exports.navigationProgram = navigationProgram; -/* Tea_html2 Not a pure module */ - -},{"./tea_app.js":1,"./tea_cmd.js":2,"./tea_html2.js":6,"./tea_navigation.js":10,"./tea_sub.js":12,"./vdom.js":14,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61,"bs-platform/lib/js/printf.js":63,"bs-platform/lib/js/string.js":64}],4:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_sub = require("./tea_sub.js"); -var Tea_task = require("./tea_task.js"); -var Web_window_localstorage = require("./web_window_localstorage.js"); - -function render_event($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var enableCall = function (callbacks) { - Curry._1(callbacks.on, /* AddRenderMsg */Block.__(0, [msg])); - return (function (param) { - return Curry._1(callbacks.on, /* RemoveRenderMsg */Block.__(1, [msg])); - }); - }; - return Tea_sub.registration(key, enableCall); -} - -var length = /* Task */[(function (cb) { - var match = Web_window_localstorage.length(window); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; - -var clear = /* Task */[(function (cb) { - var match = Web_window_localstorage.clear(window); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; - -function clearCmd(param) { - return Tea_task.attemptOpt((function (param) { - return ; - }), clear); -} - -function key(idx) { - return /* Task */[(function (cb) { - var match = Web_window_localstorage.key(window, idx); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; -} - -function getItem(key) { - return /* Task */[(function (cb) { - var match = Web_window_localstorage.getItem(window, key); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; -} - -function removeItem(key) { - return /* Task */[(function (cb) { - var match = Web_window_localstorage.removeItem(window, key); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [match])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; -} - -function removeItemCmd(key) { - return Tea_task.attemptOpt((function (param) { - return ; - }), removeItem(key)); -} - -function setItem(key, value) { - return /* Task */[(function (cb) { - var match = Web_window_localstorage.setItem(window, key, value); - if (match !== undefined) { - return Curry._1(cb, /* Ok */Block.__(0, [/* () */0])); - } else { - return Curry._1(cb, /* Error */Block.__(1, ["localStorage is not available"])); - } - })]; -} - -function setItemCmd(key, value) { - return Tea_task.attemptOpt((function (param) { - return ; - }), setItem(key, value)); -} - -var LocalStorage = { - length: length, - clear: clear, - clearCmd: clearCmd, - key: key, - getItem: getItem, - removeItem: removeItem, - removeItemCmd: removeItemCmd, - setItem: setItem, - setItemCmd: setItemCmd -}; - -exports.render_event = render_event; -exports.LocalStorage = LocalStorage; -/* No side effect */ - -},{"./tea_sub.js":12,"./tea_task.js":13,"./web_window_localstorage.js":23,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/curry.js":58}],5:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var $$String = require("bs-platform/lib/js/string.js"); -var Tea_app = require("./tea_app.js"); -var Tea_json = require("./tea_json.js"); -var Tea_result = require("./tea_result.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function text(str) { - return /* Text */Block.__(1, [str]); -} - -var lazy1 = Vdom.lazyGen; - -function node($staropt$star, tagName, $staropt$star$1, $staropt$star$2, props, nodes) { - var namespace = $staropt$star !== undefined ? $staropt$star : ""; - var key = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - var unique = $staropt$star$2 !== undefined ? $staropt$star$2 : ""; - return Vdom.fullnode(namespace, tagName, key, unique, props, nodes); -} - -function br(props) { - return Vdom.fullnode("", "br", "br", "br", props, /* [] */0); -} - -function br$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "br", key, unique, props, nodes); -} - -function div($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "div", key, unique, props, nodes); -} - -function span($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "span", key, unique, props, nodes); -} - -function p($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "p", key, unique, props, nodes); -} - -function pre($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "pre", key, unique, props, nodes); -} - -function a($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "a", key, unique, props, nodes); -} - -function section($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "section", key, unique, props, nodes); -} - -function header($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "header", key, unique, props, nodes); -} - -function footer($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "footer", key, unique, props, nodes); -} - -function h1($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h1", key, unique, props, nodes); -} - -function h2($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h2", key, unique, props, nodes); -} - -function h3($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h3", key, unique, props, nodes); -} - -function h4($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h4", key, unique, props, nodes); -} - -function h5($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h5", key, unique, props, nodes); -} - -function h6($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h6", key, unique, props, nodes); -} - -function i($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "i", key, unique, props, nodes); -} - -function strong($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "strong", key, unique, props, nodes); -} - -function button($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "button", key, unique, props, nodes); -} - -function input$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "input", key, unique, props, nodes); -} - -function textarea($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "textarea", key, unique, props, nodes); -} - -function label($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "label", key, unique, props, nodes); -} - -function ul($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ul", key, unique, props, nodes); -} - -function ol($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ol", key, unique, props, nodes); -} - -function li($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "li", key, unique, props, nodes); -} - -function table($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "table", key, unique, props, nodes); -} - -function thead($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "thead", key, unique, props, nodes); -} - -function tfoot($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tfoot", key, unique, props, nodes); -} - -function tbody($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tbody", key, unique, props, nodes); -} - -function th($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "th", key, unique, props, nodes); -} - -function tr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tr", key, unique, props, nodes); -} - -function td($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "td", key, unique, props, nodes); -} - -function progress($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "progress", key, unique, props, nodes); -} - -function img($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "img", key, unique, props, nodes); -} - -function select($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "select", key, unique, props, nodes); -} - -function option$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "option", key, unique, props, nodes); -} - -function form($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "form", key, unique, props, nodes); -} - -function nav($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "nav", key, unique, props, nodes); -} - -function main($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "main", key, unique, props, nodes); -} - -function aside($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "aside", key, unique, props, nodes); -} - -function article($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "article", key, unique, props, nodes); -} - -function details($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "details", key, unique, props, nodes); -} - -function figcaption($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "figcaption", key, unique, props, nodes); -} - -function figure($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "figure", key, unique, props, nodes); -} - -function mark($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "mark", key, unique, props, nodes); -} - -function summary($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "summary", key, unique, props, nodes); -} - -function time($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "time", key, unique, props, nodes); -} - -function hr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "hr", key, unique, props, nodes); -} - -function blockquote($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "blockquote", key, unique, props, nodes); -} - -function code($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "code", key, unique, props, nodes); -} - -function em($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "em", key, unique, props, nodes); -} - -function b($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "b", key, unique, props, nodes); -} - -function u($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "u", key, unique, props, nodes); -} - -function sub($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "sub", key, unique, props, nodes); -} - -function sup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "sup", key, unique, props, nodes); -} - -function dl($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dl", key, unique, props, nodes); -} - -function dt($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dt", key, unique, props, nodes); -} - -function dd($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dd", key, unique, props, nodes); -} - -function iframe($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "iframe", key, unique, props, nodes); -} - -function canvas($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "canvas", key, unique, props, nodes); -} - -function address($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "address", key, unique, props, nodes); -} - -function caption($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "caption", key, unique, props, nodes); -} - -function colgroup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "colgroup", key, unique, props, nodes); -} - -function col($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "col", key, unique, props, nodes); -} - -function fieldset($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "fieldset", key, unique, props, nodes); -} - -function legend($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "legend", key, unique, props, nodes); -} - -function datalist($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "datalist", key, unique, props, nodes); -} - -function optgroup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "optgroup", key, unique, props, nodes); -} - -function output($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "output", key, unique, props, nodes); -} - -function meter($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "meter", key, unique, props, nodes); -} - -function audio($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "audio", key, unique, props, nodes); -} - -function video($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "video", key, unique, props, nodes); -} - -function source($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "source", key, unique, props, nodes); -} - -function track($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "track", key, unique, props, nodes); -} - -function embed($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "embed", key, unique, props, nodes); -} - -function object$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "object", key, unique, props, nodes); -} - -function param($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "param", key, unique, props, nodes); -} - -function ins($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ins", key, unique, props, nodes); -} - -function del($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "del", key, unique, props, nodes); -} - -function small($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "small", key, unique, props, nodes); -} - -function cite($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "cite", key, unique, props, nodes); -} - -function dfn($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dfn", key, unique, props, nodes); -} - -function abbr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "abbr", key, unique, props, nodes); -} - -function var$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "var", key, unique, props, nodes); -} - -function samp($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "samp", key, unique, props, nodes); -} - -function kbd($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "kbd", key, unique, props, nodes); -} - -function s($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "s", key, unique, props, nodes); -} - -function q($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "q", key, unique, props, nodes); -} - -function rt($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "rt", key, unique, props, nodes); -} - -function bdi($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "bdi", key, unique, props, nodes); -} - -function bdo($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "bdo", key, unique, props, nodes); -} - -function wbr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "wbr", key, unique, props, nodes); -} - -function menuitem($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "menuitem", key, unique, props, nodes); -} - -function menu($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "menu", key, unique, props, nodes); -} - -function id(str) { - return /* RawProp */Block.__(0, [ - "id", - str - ]); -} - -function href(str) { - return /* Attribute */Block.__(1, [ - "", - "href", - str - ]); -} - -function src(str) { - return /* Attribute */Block.__(1, [ - "", - "src", - str - ]); -} - -function title(str) { - return /* Attribute */Block.__(1, [ - "", - "title", - str - ]); -} - -function class$prime(name) { - return /* RawProp */Block.__(0, [ - "className", - name - ]); -} - -function classList(classes) { - var name = $$String.concat(" ", List.map((function (param) { - return param[0]; - }), List.filter((function (param) { - return param[1]; - }))(classes))); - return /* RawProp */Block.__(0, [ - "className", - name - ]); -} - -function type$prime(typ) { - return /* RawProp */Block.__(0, [ - "type", - typ - ]); -} - -var style = Vdom.style; - -function styles(s) { - return /* Style */Block.__(4, [s]); -} - -function placeholder(str) { - return /* RawProp */Block.__(0, [ - "placeholder", - str - ]); -} - -function autofocus(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "autofocus", - "autofocus" - ]); - } else { - return /* NoProp */0; - } -} - -function value(str) { - return /* RawProp */Block.__(0, [ - "value", - str - ]); -} - -function name(str) { - return /* RawProp */Block.__(0, [ - "name", - str - ]); -} - -function checked(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "checked", - "checked" - ]); - } else { - return /* NoProp */0; - } -} - -function for$prime(str) { - return /* RawProp */Block.__(0, [ - "htmlFor", - str - ]); -} - -function hidden(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "hidden", - "hidden" - ]); - } else { - return /* NoProp */0; - } -} - -function target(t) { - return /* RawProp */Block.__(0, [ - "target", - t - ]); -} - -function action(a) { - return /* RawProp */Block.__(0, [ - "action", - a - ]); -} - -function method$prime(m) { - return /* RawProp */Block.__(0, [ - "method", - m - ]); -} - -var onCB = Vdom.onCB; - -var onMsg = Vdom.onMsg; - -function onInputOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("input", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.value; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onInput($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onInputOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onChangeOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("change", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.value; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onChange($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onChangeOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onClick(msg) { - return Vdom.onMsg("click", msg); -} - -function onDoubleClick(msg) { - return Vdom.onMsg("dblclick", msg); -} - -function onBlur(msg) { - return Vdom.onMsg("blur", msg); -} - -function onFocus(msg) { - return Vdom.onMsg("focus", msg); -} - -function onCheckOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("change", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.checked; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onCheck($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onCheckOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onMouseDown(msg) { - return Vdom.onMsg("mousedown", msg); -} - -function onMouseUp(msg) { - return Vdom.onMsg("mouseup", msg); -} - -function onMouseEnter(msg) { - return Vdom.onMsg("mouseenter", msg); -} - -function onMouseLeave(msg) { - return Vdom.onMsg("mouseleave", msg); -} - -function onMouseOver(msg) { - return Vdom.onMsg("mouseover", msg); -} - -function onMouseOut(msg) { - return Vdom.onMsg("mouseout", msg); -} - -var defaultOptions = { - stopPropagation: false, - preventDefault: false -}; - -function onWithOptions(key, eventName, options, decoder) { - return Vdom.onCB(eventName, key, (function ($$event) { - if (options.stopPropagation) { - $$event.stopPropagation(); - } - if (options.preventDefault) { - $$event.preventDefault(); - } - return Tea_result.result_to_option(Tea_json.Decoder.decodeEvent(decoder, $$event)); - })); -} - -function on(key, eventName, decoder) { - return onWithOptions(key, eventName, defaultOptions, decoder); -} - -var targetValue = Tea_json.Decoder.at(/* :: */[ - "target", - /* :: */[ - "value", - /* [] */0 - ] - ], Tea_json.Decoder.string); - -var targetChecked = Tea_json.Decoder.at(/* :: */[ - "target", - /* :: */[ - "checked", - /* [] */0 - ] - ], Tea_json.Decoder.bool); - -var keyCode = Tea_json.Decoder.field("keyCode", Tea_json.Decoder.$$int); - -function max(value) { - return /* Attribute */Block.__(1, [ - "", - "max", - value - ]); -} - -function min(value) { - return /* Attribute */Block.__(1, [ - "", - "min", - value - ]); -} - -function step(value) { - return /* Attribute */Block.__(1, [ - "", - "step", - value - ]); -} - -function disabled(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "disabled", - "true" - ]); - } else { - return /* NoProp */0; - } -} - -function selected(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "selected", - "true" - ]); - } else { - return /* NoProp */0; - } -} - -function acceptCharset(c) { - return /* Attribute */Block.__(1, [ - "", - "accept-charset", - c - ]); -} - -function rel(value) { - return /* Attribute */Block.__(1, [ - "", - "rel", - value - ]); -} - -var Attributes = { - max: max, - min: min, - step: step, - disabled: disabled, - selected: selected, - acceptCharset: acceptCharset, - rel: rel -}; - -var Cmds = /* alias */0; - -var map = Tea_app.map; - -var noNode = Vdom.noNode; - -var noProp = /* NoProp */0; - -exports.Cmds = Cmds; -exports.map = map; -exports.noNode = noNode; -exports.text = text; -exports.lazy1 = lazy1; -exports.node = node; -exports.br = br; -exports.br$prime = br$prime; -exports.div = div; -exports.span = span; -exports.p = p; -exports.pre = pre; -exports.a = a; -exports.section = section; -exports.header = header; -exports.footer = footer; -exports.h1 = h1; -exports.h2 = h2; -exports.h3 = h3; -exports.h4 = h4; -exports.h5 = h5; -exports.h6 = h6; -exports.i = i; -exports.strong = strong; -exports.button = button; -exports.input$prime = input$prime; -exports.textarea = textarea; -exports.label = label; -exports.ul = ul; -exports.ol = ol; -exports.li = li; -exports.table = table; -exports.thead = thead; -exports.tfoot = tfoot; -exports.tbody = tbody; -exports.th = th; -exports.tr = tr; -exports.td = td; -exports.progress = progress; -exports.img = img; -exports.select = select; -exports.option$prime = option$prime; -exports.form = form; -exports.nav = nav; -exports.main = main; -exports.aside = aside; -exports.article = article; -exports.details = details; -exports.figcaption = figcaption; -exports.figure = figure; -exports.mark = mark; -exports.summary = summary; -exports.time = time; -exports.hr = hr; -exports.blockquote = blockquote; -exports.code = code; -exports.em = em; -exports.b = b; -exports.u = u; -exports.sub = sub; -exports.sup = sup; -exports.dl = dl; -exports.dt = dt; -exports.dd = dd; -exports.iframe = iframe; -exports.canvas = canvas; -exports.address = address; -exports.caption = caption; -exports.colgroup = colgroup; -exports.col = col; -exports.fieldset = fieldset; -exports.legend = legend; -exports.datalist = datalist; -exports.optgroup = optgroup; -exports.output = output; -exports.meter = meter; -exports.audio = audio; -exports.video = video; -exports.source = source; -exports.track = track; -exports.embed = embed; -exports.object$prime = object$prime; -exports.param = param; -exports.ins = ins; -exports.del = del; -exports.small = small; -exports.cite = cite; -exports.dfn = dfn; -exports.abbr = abbr; -exports.var$prime = var$prime; -exports.samp = samp; -exports.kbd = kbd; -exports.s = s; -exports.q = q; -exports.rt = rt; -exports.bdi = bdi; -exports.bdo = bdo; -exports.wbr = wbr; -exports.menuitem = menuitem; -exports.menu = menu; -exports.noProp = noProp; -exports.id = id; -exports.href = href; -exports.src = src; -exports.title = title; -exports.class$prime = class$prime; -exports.classList = classList; -exports.type$prime = type$prime; -exports.style = style; -exports.styles = styles; -exports.placeholder = placeholder; -exports.autofocus = autofocus; -exports.value = value; -exports.name = name; -exports.checked = checked; -exports.for$prime = for$prime; -exports.hidden = hidden; -exports.target = target; -exports.action = action; -exports.method$prime = method$prime; -exports.onCB = onCB; -exports.onMsg = onMsg; -exports.onInputOpt = onInputOpt; -exports.onInput = onInput; -exports.onChangeOpt = onChangeOpt; -exports.onChange = onChange; -exports.onClick = onClick; -exports.onDoubleClick = onDoubleClick; -exports.onBlur = onBlur; -exports.onFocus = onFocus; -exports.onCheckOpt = onCheckOpt; -exports.onCheck = onCheck; -exports.onMouseDown = onMouseDown; -exports.onMouseUp = onMouseUp; -exports.onMouseEnter = onMouseEnter; -exports.onMouseLeave = onMouseLeave; -exports.onMouseOver = onMouseOver; -exports.onMouseOut = onMouseOut; -exports.defaultOptions = defaultOptions; -exports.onWithOptions = onWithOptions; -exports.on = on; -exports.targetValue = targetValue; -exports.targetChecked = targetChecked; -exports.keyCode = keyCode; -exports.Attributes = Attributes; -/* targetValue Not a pure module */ - -},{"./tea_app.js":1,"./tea_json.js":8,"./tea_result.js":11,"./vdom.js":14,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61,"bs-platform/lib/js/string.js":64}],6:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Bytes = require("bs-platform/lib/js/bytes.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var $$String = require("bs-platform/lib/js/string.js"); -var Tea_app = require("./tea_app.js"); -var Tea_html = require("./tea_html.js"); -var Tea_json = require("./tea_json.js"); -var Caml_bytes = require("bs-platform/lib/js/caml_bytes.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function text(str) { - return /* Text */Block.__(1, [str]); -} - -function node($staropt$star, tagName, $staropt$star$1, $staropt$star$2, props, nodes) { - var namespace = $staropt$star !== undefined ? $staropt$star : ""; - var key = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - var unique = $staropt$star$2 !== undefined ? $staropt$star$2 : ""; - return Vdom.fullnode(namespace, tagName, key, unique, props, nodes); -} - -var lazy1 = Vdom.lazyGen; - -function h1($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h1", key, unique, props, nodes); -} - -function h2($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h2", key, unique, props, nodes); -} - -function h3($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h3", key, unique, props, nodes); -} - -function h4($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h4", key, unique, props, nodes); -} - -function h5($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h5", key, unique, props, nodes); -} - -function h6($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "h6", key, unique, props, nodes); -} - -function div($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "div", key, unique, props, nodes); -} - -function p($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "p", key, unique, props, nodes); -} - -function hr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "hr", key, unique, props, nodes); -} - -function pre($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "pre", key, unique, props, nodes); -} - -function blockquote($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "blockquote", key, unique, props, nodes); -} - -function span($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "span", key, unique, props, nodes); -} - -function a($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "a", key, unique, props, nodes); -} - -function code($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "code", key, unique, props, nodes); -} - -function em($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "em", key, unique, props, nodes); -} - -function strong($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "strong", key, unique, props, nodes); -} - -function i($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "i", key, unique, props, nodes); -} - -function b($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "b", key, unique, props, nodes); -} - -function u($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "u", key, unique, props, nodes); -} - -function sub($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "sub", key, unique, props, nodes); -} - -function sup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "sup", key, unique, props, nodes); -} - -function br(props) { - return Vdom.fullnode("", "br", "br", "br", props, /* [] */0); -} - -function br$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "br", key, unique, props, nodes); -} - -function ol($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ol", key, unique, props, nodes); -} - -function ul($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ul", key, unique, props, nodes); -} - -function li($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "li", key, unique, props, nodes); -} - -function dl($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dl", key, unique, props, nodes); -} - -function dt($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dt", key, unique, props, nodes); -} - -function dd($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dd", key, unique, props, nodes); -} - -function img($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "img", key, unique, props, nodes); -} - -function iframe($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "iframe", key, unique, props, nodes); -} - -function canvas($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "canvas", key, unique, props, nodes); -} - -function math($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "math", key, unique, props, nodes); -} - -function form($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "form", key, unique, props, nodes); -} - -function input$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "input", key, unique, props, nodes); -} - -function textarea($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "textarea", key, unique, props, nodes); -} - -function button($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "button", key, unique, props, nodes); -} - -function select($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "select", key, unique, props, nodes); -} - -function option$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "option", key, unique, props, nodes); -} - -function optgroup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "optgroup", key, unique, props, nodes); -} - -function label($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "label", key, unique, props, nodes); -} - -function fieldset($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "fieldset", key, unique, props, nodes); -} - -function legend($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "legend", key, unique, props, nodes); -} - -function section($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "section", key, unique, props, nodes); -} - -function nav($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "nav", key, unique, props, nodes); -} - -function article($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "article", key, unique, props, nodes); -} - -function aside($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "aside", key, unique, props, nodes); -} - -function header($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "header", key, unique, props, nodes); -} - -function footer($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "footer", key, unique, props, nodes); -} - -function address($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "address", key, unique, props, nodes); -} - -function main($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "main", key, unique, props, nodes); -} - -function body($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "body", key, unique, props, nodes); -} - -function figure($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "figure", key, unique, props, nodes); -} - -function figcaption($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "figcaption", key, unique, props, nodes); -} - -function table($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "table", key, unique, props, nodes); -} - -function caption($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "caption", key, unique, props, nodes); -} - -function colgroup($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "colgroup", key, unique, props, nodes); -} - -function col($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "col", key, unique, props, nodes); -} - -function tbody($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tbody", key, unique, props, nodes); -} - -function thead($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "thead", key, unique, props, nodes); -} - -function tfoot($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tfoot", key, unique, props, nodes); -} - -function tr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "tr", key, unique, props, nodes); -} - -function th($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "th", key, unique, props, nodes); -} - -function td($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "td", key, unique, props, nodes); -} - -function datalist($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "datalist", key, unique, props, nodes); -} - -function keygen($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "keygen", key, unique, props, nodes); -} - -function output($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "output", key, unique, props, nodes); -} - -function progress($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "progress", key, unique, props, nodes); -} - -function meter($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "meter", key, unique, props, nodes); -} - -function audio($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "audio", key, unique, props, nodes); -} - -function video($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "video", key, unique, props, nodes); -} - -function source($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "source", key, unique, props, nodes); -} - -function track($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "track", key, unique, props, nodes); -} - -function embed($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "embed", key, unique, props, nodes); -} - -function object$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "object", key, unique, props, nodes); -} - -function param($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "param", key, unique, props, nodes); -} - -function ins($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ins", key, unique, props, nodes); -} - -function del($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "del", key, unique, props, nodes); -} - -function small($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "small", key, unique, props, nodes); -} - -function cite($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "cite", key, unique, props, nodes); -} - -function dfn($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "dfn", key, unique, props, nodes); -} - -function abbr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "abbr", key, unique, props, nodes); -} - -function time($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "time", key, unique, props, nodes); -} - -function var$prime($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "var", key, unique, props, nodes); -} - -function samp($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "samp", key, unique, props, nodes); -} - -function kbd($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "kbd", key, unique, props, nodes); -} - -function s($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "s", key, unique, props, nodes); -} - -function q($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "q", key, unique, props, nodes); -} - -function mark($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "mark", key, unique, props, nodes); -} - -function ruby($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "ruby", key, unique, props, nodes); -} - -function rt($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "rt", key, unique, props, nodes); -} - -function rp($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "rp", key, unique, props, nodes); -} - -function bdi($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "bdi", key, unique, props, nodes); -} - -function bdo($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "bdo", key, unique, props, nodes); -} - -function wbr($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "wbr", key, unique, props, nodes); -} - -function details($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "details", key, unique, props, nodes); -} - -function summary($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "summary", key, unique, props, nodes); -} - -function menuitem($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "menuitem", key, unique, props, nodes); -} - -function menu($staropt$star, $staropt$star$1, props, nodes) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "menu", key, unique, props, nodes); -} - -function meta($staropt$star, $staropt$star$1, props) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "meta", key, unique, props, /* [] */0); -} - -function style($staropt$star, $staropt$star$1, props, content) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "style", key, unique, props, /* :: */[ - /* Text */Block.__(1, [content]), - /* [] */0 - ]); -} - -function title($staropt$star, $staropt$star$1, props, content) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "title", key, unique, props, /* :: */[ - /* Text */Block.__(1, [content]), - /* [] */0 - ]); -} - -function link($staropt$star, $staropt$star$1, props) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - var unique = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - return Vdom.fullnode("", "link", key, unique, props, /* [] */0); -} - -var style$1 = Vdom.style; - -function styles(s) { - return /* Style */Block.__(4, [s]); -} - -function class$prime(name) { - return /* RawProp */Block.__(0, [ - "className", - name - ]); -} - -function classList(classes) { - var name = $$String.concat(" ", List.map((function (param) { - return param[0]; - }), List.filter((function (param) { - return param[1]; - }))(classes))); - return /* RawProp */Block.__(0, [ - "className", - name - ]); -} - -function id(str) { - return /* RawProp */Block.__(0, [ - "id", - str - ]); -} - -function title$1(str) { - return /* Attribute */Block.__(1, [ - "", - "title", - str - ]); -} - -function hidden(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "hidden", - "hidden" - ]); - } else { - return /* NoProp */0; - } -} - -function type$prime(typ) { - return /* RawProp */Block.__(0, [ - "type", - typ - ]); -} - -function value(str) { - return /* RawProp */Block.__(0, [ - "value", - str - ]); -} - -function defaultValue(str) { - return /* RawProp */Block.__(0, [ - "defaultValue", - str - ]); -} - -function checked(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "checked", - "checked" - ]); - } else { - return /* NoProp */0; - } -} - -function placeholder(str) { - return /* RawProp */Block.__(0, [ - "placeholder", - str - ]); -} - -function selected(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "selected", - "true" - ]); - } else { - return /* NoProp */0; - } -} - -function accept(c) { - return /* Attribute */Block.__(1, [ - "", - "accept", - c - ]); -} - -function acceptCharset(c) { - return /* Attribute */Block.__(1, [ - "", - "accept-charset", - c - ]); -} - -function action(a) { - return /* RawProp */Block.__(0, [ - "action", - a - ]); -} - -function autocomplete(b) { - return /* RawProp */Block.__(0, [ - "autocomplete", - b ? "on" : "off" - ]); -} - -function autofocus(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "autofocus", - "autofocus" - ]); - } else { - return /* NoProp */0; - } -} - -function disabled(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "disabled", - "true" - ]); - } else { - return /* NoProp */0; - } -} - -function enctype(encoding) { - return /* Attribute */Block.__(1, [ - "", - "enctype", - encoding - ]); -} - -function formaction(url) { - return /* Attribute */Block.__(1, [ - "", - "formaction", - url - ]); -} - -function list(value) { - return /* Attribute */Block.__(1, [ - "", - "list", - value - ]); -} - -function minlength(n) { - return /* Attribute */Block.__(1, [ - "", - "minlength", - String(n) - ]); -} - -function maxlength(n) { - return /* Attribute */Block.__(1, [ - "", - "maxlength", - String(n) - ]); -} - -function method$prime(m) { - return /* RawProp */Block.__(0, [ - "method", - m - ]); -} - -function multiple(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "multiple", - "multiple" - ]); - } else { - return /* NoProp */0; - } -} - -function name(str) { - return /* RawProp */Block.__(0, [ - "name", - str - ]); -} - -function novalidate(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "novalidate", - "novalidate" - ]); - } else { - return /* NoProp */0; - } -} - -function pattern(p) { - return /* RawProp */Block.__(0, [ - "pattern", - p - ]); -} - -function readonly(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "readonly", - "readonly" - ]); - } else { - return /* NoProp */0; - } -} - -function required(b) { - if (b) { - return /* Attribute */Block.__(1, [ - "", - "required", - "required" - ]); - } else { - return /* NoProp */0; - } -} - -function size(n) { - return /* Attribute */Block.__(1, [ - "", - "size", - String(n) - ]); -} - -function for$prime(str) { - return /* RawProp */Block.__(0, [ - "htmlFor", - str - ]); -} - -function form$1(value) { - return /* Attribute */Block.__(1, [ - "", - "form", - value - ]); -} - -function max(value) { - return /* Attribute */Block.__(1, [ - "", - "max", - value - ]); -} - -function min(value) { - return /* Attribute */Block.__(1, [ - "", - "min", - value - ]); -} - -function step(value) { - return /* Attribute */Block.__(1, [ - "", - "step", - value - ]); -} - -function cols(n) { - return /* Attribute */Block.__(1, [ - "", - "cols", - String(n) - ]); -} - -function rows(n) { - return /* Attribute */Block.__(1, [ - "", - "rows", - String(n) - ]); -} - -function wrap(value) { - return /* RawProp */Block.__(0, [ - "wrap", - value - ]); -} - -function href(str) { - return /* Attribute */Block.__(1, [ - "", - "href", - str - ]); -} - -function target(t) { - return /* RawProp */Block.__(0, [ - "target", - t - ]); -} - -function download(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "download", - "" - ]); - } else { - return /* NoProp */0; - } -} - -function downloadAs(name) { - return /* RawProp */Block.__(0, [ - "download", - name - ]); -} - -function hreflang(code) { - return /* RawProp */Block.__(0, [ - "hreflang", - code - ]); -} - -function media(value) { - return /* Attribute */Block.__(1, [ - "", - "media", - value - ]); -} - -function ping(url) { - return /* RawProp */Block.__(0, [ - "ping", - url - ]); -} - -function rel(value) { - return /* Attribute */Block.__(1, [ - "", - "rel", - value - ]); -} - -function ismap(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "ismap", - "ismap" - ]); - } else { - return /* NoProp */0; - } -} - -function usemap(name) { - return /* RawProp */Block.__(0, [ - "usemap", - name - ]); -} - -function shape(value) { - return /* RawProp */Block.__(0, [ - "shape", - value - ]); -} - -function coords(value) { - return /* RawProp */Block.__(0, [ - "coords", - value - ]); -} - -function src(str) { - return /* Attribute */Block.__(1, [ - "", - "src", - str - ]); -} - -function height(n) { - return /* Attribute */Block.__(1, [ - "", - "height", - String(n) - ]); -} - -function width(n) { - return /* Attribute */Block.__(1, [ - "", - "width", - String(n) - ]); -} - -function alt(value) { - return /* RawProp */Block.__(0, [ - "alt", - value - ]); -} - -function autoplay(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "autoplay", - "autoplay" - ]); - } else { - return /* NoProp */0; - } -} - -function controls(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "controls", - "controls" - ]); - } else { - return /* NoProp */0; - } -} - -function loop(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "loop", - "loop" - ]); - } else { - return /* NoProp */0; - } -} - -function preload(value) { - return /* RawProp */Block.__(0, [ - "preload", - value - ]); -} - -function poster(url) { - return /* RawProp */Block.__(0, [ - "poster", - url - ]); -} - -function $$default(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "default", - "default" - ]); - } else { - return /* NoProp */0; - } -} - -function kind(value) { - return /* RawProp */Block.__(0, [ - "kind", - value - ]); -} - -function srclang(code) { - return /* RawProp */Block.__(0, [ - "srclang", - code - ]); -} - -function sandbox(value) { - return /* RawProp */Block.__(0, [ - "sandbox", - value - ]); -} - -function seamless(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "seamless", - "seamless" - ]); - } else { - return /* NoProp */0; - } -} - -function srcdoc(value) { - return /* RawProp */Block.__(0, [ - "srcdoc", - value - ]); -} - -function reversed(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "reversed", - "reversed" - ]); - } else { - return /* NoProp */0; - } -} - -function start(n) { - return /* RawProp */Block.__(0, [ - "start", - String(n) - ]); -} - -function colspan(n) { - return /* Attribute */Block.__(1, [ - "", - "colspan", - String(n) - ]); -} - -function rowspan(n) { - return /* Attribute */Block.__(1, [ - "", - "rowspan", - String(n) - ]); -} - -function headers(value) { - return /* RawProp */Block.__(0, [ - "headers", - value - ]); -} - -function scope(value) { - return /* RawProp */Block.__(0, [ - "scope", - value - ]); -} - -function align(value) { - return /* RawProp */Block.__(0, [ - "align", - value - ]); -} - -function async(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "async", - "async" - ]); - } else { - return /* NoProp */0; - } -} - -function charset(value) { - return /* Attribute */Block.__(1, [ - "", - "charset", - value - ]); -} - -function content(value) { - return /* Attribute */Block.__(1, [ - "", - "content", - value - ]); -} - -function defer(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "defer", - "defer" - ]); - } else { - return /* NoProp */0; - } -} - -function httpEquiv(value) { - return /* RawProp */Block.__(0, [ - "http-equiv", - value - ]); -} - -function language(value) { - return /* RawProp */Block.__(0, [ - "language", - value - ]); -} - -function scoped(value) { - return /* RawProp */Block.__(0, [ - "scoped", - value - ]); -} - -function accesskey(ch) { - return /* RawProp */Block.__(0, [ - "accesskey", - Caml_bytes.bytes_to_string(Bytes.make(1, ch)) - ]); -} - -function contenteditable(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "contenteditable", - "contenteditable" - ]); - } else { - return /* NoProp */0; - } -} - -function contextmenu(id) { - return /* Attribute */Block.__(1, [ - "", - "contextmenu", - id - ]); -} - -function dir(value) { - return /* RawProp */Block.__(0, [ - "dir", - value - ]); -} - -function draggable(value) { - return /* Attribute */Block.__(1, [ - "", - "draggable", - value - ]); -} - -function dropzone(value) { - return /* RawProp */Block.__(0, [ - "dropzone", - value - ]); -} - -function itemprop(value) { - return /* Attribute */Block.__(1, [ - "", - "itemprop", - value - ]); -} - -function lang(code) { - return /* RawProp */Block.__(0, [ - "lang", - code - ]); -} - -function spellcheck(b) { - if (b) { - return /* RawProp */Block.__(0, [ - "spellcheck", - "spellcheck" - ]); - } else { - return /* NoProp */0; - } -} - -function tabindex(n) { - return /* Attribute */Block.__(1, [ - "", - "tabindex", - String(n) - ]); -} - -function challenge(value) { - return /* Attribute */Block.__(1, [ - "", - "challenge", - value - ]); -} - -function keytype(value) { - return /* RawProp */Block.__(0, [ - "keytype", - value - ]); -} - -function cite$1(url) { - return /* RawProp */Block.__(0, [ - "cite", - url - ]); -} - -function datetime(value) { - return /* Attribute */Block.__(1, [ - "", - "datetime", - value - ]); -} - -function pubdate(value) { - return /* Attribute */Block.__(1, [ - "", - "pubdate", - value - ]); -} - -function manifest(value) { - return /* Attribute */Block.__(1, [ - "", - "manifest", - value - ]); -} - -var Attributes = { - noProp: /* NoProp */0, - style: style$1, - styles: styles, - class$prime: class$prime, - classList: classList, - id: id, - title: title$1, - hidden: hidden, - type$prime: type$prime, - value: value, - defaultValue: defaultValue, - checked: checked, - placeholder: placeholder, - selected: selected, - accept: accept, - acceptCharset: acceptCharset, - action: action, - autocomplete: autocomplete, - autofocus: autofocus, - disabled: disabled, - enctype: enctype, - formaction: formaction, - list: list, - minlength: minlength, - maxlength: maxlength, - method$prime: method$prime, - multiple: multiple, - name: name, - novalidate: novalidate, - pattern: pattern, - readonly: readonly, - required: required, - size: size, - for$prime: for$prime, - form: form$1, - max: max, - min: min, - step: step, - cols: cols, - rows: rows, - wrap: wrap, - href: href, - target: target, - download: download, - downloadAs: downloadAs, - hreflang: hreflang, - media: media, - ping: ping, - rel: rel, - ismap: ismap, - usemap: usemap, - shape: shape, - coords: coords, - src: src, - height: height, - width: width, - alt: alt, - autoplay: autoplay, - controls: controls, - loop: loop, - preload: preload, - poster: poster, - $$default: $$default, - kind: kind, - srclang: srclang, - sandbox: sandbox, - seamless: seamless, - srcdoc: srcdoc, - reversed: reversed, - start: start, - colspan: colspan, - rowspan: rowspan, - headers: headers, - scope: scope, - align: align, - async: async, - charset: charset, - content: content, - defer: defer, - httpEquiv: httpEquiv, - language: language, - scoped: scoped, - accesskey: accesskey, - contenteditable: contenteditable, - contextmenu: contextmenu, - dir: dir, - draggable: draggable, - dropzone: dropzone, - itemprop: itemprop, - lang: lang, - spellcheck: spellcheck, - tabindex: tabindex, - challenge: challenge, - keytype: keytype, - cite: cite$1, - datetime: datetime, - pubdate: pubdate, - manifest: manifest -}; - -var onCB = Vdom.onCB; - -var onMsg = Vdom.onMsg; - -function preventDefaultOn($staropt$star, eventName, decoder) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Tea_html.onWithOptions(key, eventName, { - stopPropagation: Tea_html.defaultOptions.stopPropagation, - preventDefault: true - }, decoder); -} - -function onClick(msg) { - return Vdom.onMsg("click", msg); -} - -function onDoubleClick(msg) { - return Vdom.onMsg("dblclick", msg); -} - -function onMouseDown(msg) { - return Vdom.onMsg("mousedown", msg); -} - -function onMouseUp(msg) { - return Vdom.onMsg("mouseup", msg); -} - -function onMouseEnter(msg) { - return Vdom.onMsg("mouseenter", msg); -} - -function onMouseLeave(msg) { - return Vdom.onMsg("mouseleave", msg); -} - -function onMouseOver(msg) { - return Vdom.onMsg("mouseover", msg); -} - -function onMouseOut(msg) { - return Vdom.onMsg("mouseout", msg); -} - -function onInputOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("input", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.value; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onInput($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onInputOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onCheckOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("change", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.checked; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onCheck($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onCheckOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onChangeOpt($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return Vdom.onCB("change", key, (function (ev) { - var match = ev.target; - if (match !== undefined) { - var match$1 = match.value; - if (match$1 !== undefined) { - return Curry._1(msg, match$1); - } else { - return ; - } - } - - })); -} - -function onChange($staropt$star, msg) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return onChangeOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); - })); -} - -function onSubmit(msg) { - return preventDefaultOn(undefined, "submit", Tea_json.Decoder.succeed(msg)); -} - -function onBlur(msg) { - return Vdom.onMsg("blur", msg); -} - -function onFocus(msg) { - return Vdom.onMsg("focus", msg); -} - -var Events = { - onCB: onCB, - onMsg: onMsg, - on: Tea_html.on, - onWithOptions: Tea_html.onWithOptions, - defaultOptions: Tea_html.defaultOptions, - targetValue: Tea_html.targetValue, - targetChecked: Tea_html.targetChecked, - keyCode: Tea_html.keyCode, - preventDefaultOn: preventDefaultOn, - onClick: onClick, - onDoubleClick: onDoubleClick, - onMouseDown: onMouseDown, - onMouseUp: onMouseUp, - onMouseEnter: onMouseEnter, - onMouseLeave: onMouseLeave, - onMouseOver: onMouseOver, - onMouseOut: onMouseOut, - onInputOpt: onInputOpt, - onInput: onInput, - onCheckOpt: onCheckOpt, - onCheck: onCheck, - onChangeOpt: onChangeOpt, - onChange: onChange, - onSubmit: onSubmit, - onBlur: onBlur, - onFocus: onFocus -}; - -var Cmds = /* alias */0; - -var map = Tea_app.map; - -var noNode = Vdom.noNode; - -exports.Cmds = Cmds; -exports.map = map; -exports.text = text; -exports.node = node; -exports.noNode = noNode; -exports.lazy1 = lazy1; -exports.h1 = h1; -exports.h2 = h2; -exports.h3 = h3; -exports.h4 = h4; -exports.h5 = h5; -exports.h6 = h6; -exports.div = div; -exports.p = p; -exports.hr = hr; -exports.pre = pre; -exports.blockquote = blockquote; -exports.span = span; -exports.a = a; -exports.code = code; -exports.em = em; -exports.strong = strong; -exports.i = i; -exports.b = b; -exports.u = u; -exports.sub = sub; -exports.sup = sup; -exports.br = br; -exports.br$prime = br$prime; -exports.ol = ol; -exports.ul = ul; -exports.li = li; -exports.dl = dl; -exports.dt = dt; -exports.dd = dd; -exports.img = img; -exports.iframe = iframe; -exports.canvas = canvas; -exports.math = math; -exports.form = form; -exports.input$prime = input$prime; -exports.textarea = textarea; -exports.button = button; -exports.select = select; -exports.option$prime = option$prime; -exports.optgroup = optgroup; -exports.label = label; -exports.fieldset = fieldset; -exports.legend = legend; -exports.section = section; -exports.nav = nav; -exports.article = article; -exports.aside = aside; -exports.header = header; -exports.footer = footer; -exports.address = address; -exports.main = main; -exports.body = body; -exports.figure = figure; -exports.figcaption = figcaption; -exports.table = table; -exports.caption = caption; -exports.colgroup = colgroup; -exports.col = col; -exports.tbody = tbody; -exports.thead = thead; -exports.tfoot = tfoot; -exports.tr = tr; -exports.th = th; -exports.td = td; -exports.datalist = datalist; -exports.keygen = keygen; -exports.output = output; -exports.progress = progress; -exports.meter = meter; -exports.audio = audio; -exports.video = video; -exports.source = source; -exports.track = track; -exports.embed = embed; -exports.object$prime = object$prime; -exports.param = param; -exports.ins = ins; -exports.del = del; -exports.small = small; -exports.cite = cite; -exports.dfn = dfn; -exports.abbr = abbr; -exports.time = time; -exports.var$prime = var$prime; -exports.samp = samp; -exports.kbd = kbd; -exports.s = s; -exports.q = q; -exports.mark = mark; -exports.ruby = ruby; -exports.rt = rt; -exports.rp = rp; -exports.bdi = bdi; -exports.bdo = bdo; -exports.wbr = wbr; -exports.details = details; -exports.summary = summary; -exports.menuitem = menuitem; -exports.menu = menu; -exports.meta = meta; -exports.style = style; -exports.title = title; -exports.link = link; -exports.Attributes = Attributes; -exports.Events = Events; -/* Tea_html Not a pure module */ - -},{"./tea_app.js":1,"./tea_html.js":5,"./tea_json.js":8,"./vdom.js":14,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/bytes.js":38,"bs-platform/lib/js/caml_bytes.js":41,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61,"bs-platform/lib/js/string.js":64}],7:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_json = require("./tea_json.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); -var Web_xmlhttprequest = require("./web_xmlhttprequest.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function string_of_error(param) { - if (typeof param === "number") { - switch (param) { - case /* Timeout */0 : - return "Timeout"; - case /* NetworkError */1 : - return "Unknown network error"; - case /* Aborted */2 : - return "Request aborted"; - - } - } else { - switch (param.tag | 0) { - case /* BadUrl */0 : - return "Bad Url: " + param[0]; - case /* BadStatus */1 : - return "Bad Status: " + param[0].url; - case /* BadPayload */2 : - return "Bad Payload: " + param[1].url; - - } - } -} - -var emptyRequestEvents = { - onreadystatechange: undefined, - onprogress: undefined -}; - -function expectStringResponse(func) { - return /* Expect */[ - /* TextResponseType */5, - (function (param) { - var body = param.body; - if (typeof body === "number" || body.tag !== /* TextResponse */5) { - return /* Error */Block.__(1, ["Non-text response returned"]); - } else { - return Curry._1(func, body[0]); - } - }) - ]; -} - -var expectString = expectStringResponse((function (resString) { - return /* Ok */Block.__(0, [resString]); - })); - -function request(rawRequest) { - return /* Request */[ - rawRequest, - undefined - ]; -} - -function getString(url) { - return /* Request */[ - { - "method'": "GET", - headers: /* [] */0, - url: url, - body: /* EmptyBody */0, - expect: expectString, - timeout: undefined, - withCredentials: false - }, - undefined - ]; -} - -function toTask(param) { - var request = param[0]; - var height = function (param) { - if (param) { - return param[/* h */4]; - } else { - return 0; - } - }; - var create = function (l, x, d, r) { - var hl = height(l); - var hr = height(r); - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - }; - var singleton = function (x, d) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */d, - /* r : Empty */0, - /* h */1 - ]; - }; - var bal = function (l, x, d, r) { - var hl = l ? l[/* h */4] : 0; - var hr = r ? r[/* h */4] : 0; - if (hl > (hr + 2 | 0)) { - if (l) { - var lr = l[/* r */3]; - var ld = l[/* d */2]; - var lv = l[/* v */1]; - var ll = l[/* l */0]; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } else if (lr) { - return create(create(ll, lv, ld, lr[/* l */0]), lr[/* v */1], lr[/* d */2], create(lr[/* r */3], x, d, r)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else if (hr > (hl + 2 | 0)) { - if (r) { - var rr = r[/* r */3]; - var rd = r[/* d */2]; - var rv = r[/* v */1]; - var rl = r[/* l */0]; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } else if (rl) { - return create(create(l, x, d, rl[/* l */0]), rl[/* v */1], rl[/* d */2], create(rl[/* r */3], rv, rd, rr)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - } - }; - var add = function (x, data, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = add(x, data, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */data, - /* r : Empty */0, - /* h */1 - ]; - } - }; - var min_binding = function (_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; - }; - var remove_min_binding = function (param) { - if (param) { - var l = param[/* l */0]; - if (l) { - return bal(remove_min_binding(l), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return param[/* r */3]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.remove_min_elt" - ]; - } - }; - var merge = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var remove = function (x, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return merge(l, r); - } else if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = remove(x, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Empty */0; - } - }; - var update = function (x, f, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - var match = Curry._1(f, Caml_option.some(d)); - if (match !== undefined) { - var data = Caml_option.valFromOption(match); - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else { - return merge(l, r); - } - } else if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = update(x, f, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - var match$1 = Curry._1(f, undefined); - if (match$1 !== undefined) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */Caml_option.valFromOption(match$1), - /* r : Empty */0, - /* h */1 - ]; - } else { - return /* Empty */0; - } - } - }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (param) { - iter(f, param[/* l */0]); - Curry._2(f, param[/* v */1], param[/* d */2]); - _param = param[/* r */3]; - continue ; - } else { - return /* () */0; - } - }; - }; - var map = function (f, param) { - if (param) { - var l$prime = map(f, param[/* l */0]); - var d$prime = Curry._1(f, param[/* d */2]); - var r$prime = map(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */param[/* v */1], - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var mapi = function (f, param) { - if (param) { - var v = param[/* v */1]; - var l$prime = mapi(f, param[/* l */0]); - var d$prime = Curry._2(f, v, param[/* d */2]); - var r$prime = mapi(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */v, - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var fold = function (f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (m) { - _accu = Curry._3(f, m[/* v */1], m[/* d */2], fold(f, m[/* l */0], accu)); - _m = m[/* r */3]; - continue ; - } else { - return accu; - } - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) && for_all(p, param[/* l */0])) { - _param = param[/* r */3]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; - }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) || exists(p, param[/* l */0])) { - return true; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return false; - } - }; - }; - var add_min_binding = function (k, x, param) { - if (param) { - return bal(add_min_binding(k, x, param[/* l */0]), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return singleton(k, x); - } - }; - var add_max_binding = function (k, x, param) { - if (param) { - return bal(param[/* l */0], param[/* v */1], param[/* d */2], add_max_binding(k, x, param[/* r */3])); - } else { - return singleton(k, x); - } - }; - var join = function (l, v, d, r) { - if (l) { - if (r) { - var rh = r[/* h */4]; - var lh = l[/* h */4]; - if (lh > (rh + 2 | 0)) { - return bal(l[/* l */0], l[/* v */1], l[/* d */2], join(l[/* r */3], v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r[/* l */0]), r[/* v */1], r[/* d */2], r[/* r */3]); - } else { - return create(l, v, d, r); - } - } else { - return add_max_binding(v, d, l); - } - } else { - return add_min_binding(v, d, r); - } - }; - var concat = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var concat_or_join = function (t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); - } - }; - var split = function (x, param) { - if (param) { - var r = param[/* r */3]; - var d = param[/* d */2]; - var v = param[/* v */1]; - var l = param[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return /* tuple */[ - l, - Caml_option.some(d), - r - ]; - } else if (c < 0) { - var match = split(x, l); - return /* tuple */[ - match[0], - match[1], - join(match[2], v, d, r) - ]; - } else { - var match$1 = split(x, r); - return /* tuple */[ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - undefined, - /* Empty */0 - ]; - } - }; - var merge$1 = function (f, s1, s2) { - if (s1) { - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1[/* l */0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[/* d */2]), match[1]), merge$1(f, s1[/* r */3], match[2])); - } - - } else if (!s2) { - return /* Empty */0; - } - if (s2) { - var v2 = s2[/* v */1]; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2[/* l */0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[/* d */2])), merge$1(f, match$1[2], s2[/* r */3])); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "map.ml", - 393, - 10 - ] - ]; - } - }; - var union = function (f, s1, s2) { - if (s1) { - if (s2) { - var d2 = s2[/* d */2]; - var v2 = s2[/* v */1]; - var d1 = s1[/* d */2]; - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= s2[/* h */4]) { - var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1[/* l */0], match[0]); - var r = union(f, s1[/* r */3], match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } - } else { - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2[/* l */0]); - var r$1 = union(f, match$1[2], s2[/* r */3]); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); - } else { - return join(l$1, v2, d2, r$1); - } - } - } else { - return s1; - } - } else { - return s2; - } - }; - var filter = function (p, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var l$prime = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$prime = filter(p, r); - if (pvd) { - if (l === l$prime && r === r$prime) { - return m; - } else { - return join(l$prime, v, d, r$prime); - } - } else { - return concat(l$prime, r$prime); - } - } else { - return /* Empty */0; - } - }; - var partition = function (p, param) { - if (param) { - var d = param[/* d */2]; - var v = param[/* v */1]; - var match = partition(p, param[/* l */0]); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param[/* r */3]); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return /* tuple */[ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return /* tuple */[ - concat(lt, rt), - join(lf, v, d, rf) - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - /* Empty */0 - ]; - } - }; - var cardinal = function (param) { - if (param) { - return (cardinal(param[/* l */0]) + 1 | 0) + cardinal(param[/* r */3]) | 0; - } else { - return 0; - } - }; - var bindings_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[/* l */0]; - _accu = /* :: */[ - /* tuple */[ - param[/* v */1], - param[/* d */2] - ], - bindings_aux(accu, param[/* r */3]) - ]; - continue ; - } else { - return accu; - } - }; - }; - var expect = request.expect; - var responseToResult = expect[1]; - var typ = expect[0]; - var withCredentials = request.withCredentials; - var timeout = request.timeout; - var body = request.body; - var url = request.url; - var headers = request.headers; - var method$prime = request["method'"]; - return /* Task */[(function (cb) { - var enqResError = function (result) { - var partial_arg = /* Error */Block.__(1, [result]); - return (function (param) { - return Curry._1(cb, partial_arg); - }); - }; - var enqResOk = function (result) { - var partial_arg = /* Ok */Block.__(0, [result]); - return (function (param) { - return Curry._1(cb, partial_arg); - }); - }; - var xhr = new XMLHttpRequest(); - var partial_arg = /* Error */Block.__(1, [/* NetworkError */1]); - var cb$1 = function (param) { - return Curry._1(cb, partial_arg); - }; - xhr.onerror = cb$1; - var partial_arg$1 = /* Error */Block.__(1, [/* Timeout */0]); - var cb$2 = function (param) { - return Curry._1(cb, partial_arg$1); - }; - xhr.ontimeout = cb$2; - var partial_arg$2 = /* Error */Block.__(1, [/* Aborted */2]); - var cb$3 = function (param) { - return Curry._1(cb, partial_arg$2); - }; - xhr.onabort = cb$3; - var cb$4 = function (_ev) { - var match = Web_xmlhttprequest.getAllResponseHeadersAsDict(xhr); - var headers; - headers = match.tag ? /* Empty */0 : match[0]; - var response_url = xhr.responseURL; - var response_status = { - code: xhr.status, - message: xhr.statusText - }; - var response_body = Web_xmlhttprequest.get_response(xhr); - var response = { - url: response_url, - status: response_status, - headers: headers, - body: response_body - }; - if (response_status.code < 200 || 300 <= response_status.code) { - return enqResError(/* BadStatus */Block.__(1, [response]))(/* () */0); - } else { - var match$1 = Curry._1(responseToResult, response); - if (match$1.tag) { - return enqResError(/* BadPayload */Block.__(2, [ - match$1[0], - response - ]))(/* () */0); - } else { - return enqResOk(match$1[0])(/* () */0); - } - } - }; - xhr.onload = cb$4; - try { - Web_xmlhttprequest.open_(method$prime, url, undefined, undefined, undefined, xhr); - } - catch (exn){ - enqResError(/* BadUrl */Block.__(0, [url]))(/* () */0); - } - var setHeader = function (param) { - return Web_xmlhttprequest.setRequestHeader(param[0], param[1], xhr); - }; - List.iter(setHeader, headers); - Web_xmlhttprequest.set_responseType(typ, xhr); - if (timeout !== undefined) { - xhr.timeout = timeout; - } - xhr.withCredentials = withCredentials; - Web_xmlhttprequest.send(body, xhr); - return /* () */0; - })]; -} - -function send(resultToMessage, param) { - var maybeEvents = param[1]; - var request = param[0]; - var height = function (param) { - if (param) { - return param[/* h */4]; - } else { - return 0; - } - }; - var create = function (l, x, d, r) { - var hl = height(l); - var hr = height(r); - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - }; - var singleton = function (x, d) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */d, - /* r : Empty */0, - /* h */1 - ]; - }; - var bal = function (l, x, d, r) { - var hl = l ? l[/* h */4] : 0; - var hr = r ? r[/* h */4] : 0; - if (hl > (hr + 2 | 0)) { - if (l) { - var lr = l[/* r */3]; - var ld = l[/* d */2]; - var lv = l[/* v */1]; - var ll = l[/* l */0]; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } else if (lr) { - return create(create(ll, lv, ld, lr[/* l */0]), lr[/* v */1], lr[/* d */2], create(lr[/* r */3], x, d, r)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else if (hr > (hl + 2 | 0)) { - if (r) { - var rr = r[/* r */3]; - var rd = r[/* d */2]; - var rv = r[/* v */1]; - var rl = r[/* l */0]; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } else if (rl) { - return create(create(l, x, d, rl[/* l */0]), rl[/* v */1], rl[/* d */2], create(rl[/* r */3], rv, rd, rr)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - } - }; - var add = function (x, data, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = add(x, data, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */data, - /* r : Empty */0, - /* h */1 - ]; - } - }; - var min_binding = function (_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; - }; - var remove_min_binding = function (param) { - if (param) { - var l = param[/* l */0]; - if (l) { - return bal(remove_min_binding(l), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return param[/* r */3]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.remove_min_elt" - ]; - } - }; - var merge = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var remove = function (x, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return merge(l, r); - } else if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = remove(x, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Empty */0; - } - }; - var update = function (x, f, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - var match = Curry._1(f, Caml_option.some(d)); - if (match !== undefined) { - var data = Caml_option.valFromOption(match); - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else { - return merge(l, r); - } - } else if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = update(x, f, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - var match$1 = Curry._1(f, undefined); - if (match$1 !== undefined) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */Caml_option.valFromOption(match$1), - /* r : Empty */0, - /* h */1 - ]; - } else { - return /* Empty */0; - } - } - }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (param) { - iter(f, param[/* l */0]); - Curry._2(f, param[/* v */1], param[/* d */2]); - _param = param[/* r */3]; - continue ; - } else { - return /* () */0; - } - }; - }; - var map = function (f, param) { - if (param) { - var l$prime = map(f, param[/* l */0]); - var d$prime = Curry._1(f, param[/* d */2]); - var r$prime = map(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */param[/* v */1], - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var mapi = function (f, param) { - if (param) { - var v = param[/* v */1]; - var l$prime = mapi(f, param[/* l */0]); - var d$prime = Curry._2(f, v, param[/* d */2]); - var r$prime = mapi(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */v, - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var fold = function (f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (m) { - _accu = Curry._3(f, m[/* v */1], m[/* d */2], fold(f, m[/* l */0], accu)); - _m = m[/* r */3]; - continue ; - } else { - return accu; - } - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) && for_all(p, param[/* l */0])) { - _param = param[/* r */3]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; - }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) || exists(p, param[/* l */0])) { - return true; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return false; - } - }; - }; - var add_min_binding = function (k, x, param) { - if (param) { - return bal(add_min_binding(k, x, param[/* l */0]), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return singleton(k, x); - } - }; - var add_max_binding = function (k, x, param) { - if (param) { - return bal(param[/* l */0], param[/* v */1], param[/* d */2], add_max_binding(k, x, param[/* r */3])); - } else { - return singleton(k, x); - } - }; - var join = function (l, v, d, r) { - if (l) { - if (r) { - var rh = r[/* h */4]; - var lh = l[/* h */4]; - if (lh > (rh + 2 | 0)) { - return bal(l[/* l */0], l[/* v */1], l[/* d */2], join(l[/* r */3], v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r[/* l */0]), r[/* v */1], r[/* d */2], r[/* r */3]); - } else { - return create(l, v, d, r); - } - } else { - return add_max_binding(v, d, l); - } - } else { - return add_min_binding(v, d, r); - } - }; - var concat = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var concat_or_join = function (t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); - } - }; - var split = function (x, param) { - if (param) { - var r = param[/* r */3]; - var d = param[/* d */2]; - var v = param[/* v */1]; - var l = param[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return /* tuple */[ - l, - Caml_option.some(d), - r - ]; - } else if (c < 0) { - var match = split(x, l); - return /* tuple */[ - match[0], - match[1], - join(match[2], v, d, r) - ]; - } else { - var match$1 = split(x, r); - return /* tuple */[ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - undefined, - /* Empty */0 - ]; - } - }; - var merge$1 = function (f, s1, s2) { - if (s1) { - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1[/* l */0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[/* d */2]), match[1]), merge$1(f, s1[/* r */3], match[2])); - } - - } else if (!s2) { - return /* Empty */0; - } - if (s2) { - var v2 = s2[/* v */1]; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2[/* l */0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[/* d */2])), merge$1(f, match$1[2], s2[/* r */3])); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "map.ml", - 393, - 10 - ] - ]; - } - }; - var union = function (f, s1, s2) { - if (s1) { - if (s2) { - var d2 = s2[/* d */2]; - var v2 = s2[/* v */1]; - var d1 = s1[/* d */2]; - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= s2[/* h */4]) { - var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1[/* l */0], match[0]); - var r = union(f, s1[/* r */3], match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } - } else { - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2[/* l */0]); - var r$1 = union(f, match$1[2], s2[/* r */3]); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); - } else { - return join(l$1, v2, d2, r$1); - } - } - } else { - return s1; - } - } else { - return s2; - } - }; - var filter = function (p, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var l$prime = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$prime = filter(p, r); - if (pvd) { - if (l === l$prime && r === r$prime) { - return m; - } else { - return join(l$prime, v, d, r$prime); - } - } else { - return concat(l$prime, r$prime); - } - } else { - return /* Empty */0; - } - }; - var partition = function (p, param) { - if (param) { - var d = param[/* d */2]; - var v = param[/* v */1]; - var match = partition(p, param[/* l */0]); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param[/* r */3]); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return /* tuple */[ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return /* tuple */[ - concat(lt, rt), - join(lf, v, d, rf) - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - /* Empty */0 - ]; - } - }; - var cardinal = function (param) { - if (param) { - return (cardinal(param[/* l */0]) + 1 | 0) + cardinal(param[/* r */3]) | 0; - } else { - return 0; - } - }; - var bindings_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[/* l */0]; - _accu = /* :: */[ - /* tuple */[ - param[/* v */1], - param[/* d */2] - ], - bindings_aux(accu, param[/* r */3]) - ]; - continue ; - } else { - return accu; - } - }; - }; - var expect = request.expect; - var responseToResult = expect[1]; - var typ = expect[0]; - var withCredentials = request.withCredentials; - var timeout = request.timeout; - var body = request.body; - var url = request.url; - var headers = request.headers; - var method$prime = request["method'"]; - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - var enqRes = function (result, _ev) { - return Curry._1(callbacks.contents.enqueue, Curry._1(resultToMessage, result)); - }; - var enqResError = function (result) { - var partial_arg = /* Error */Block.__(1, [result]); - return (function (param) { - return enqRes(partial_arg, param); - }); - }; - var enqResOk = function (result) { - var partial_arg = /* Ok */Block.__(0, [result]); - return (function (param) { - return enqRes(partial_arg, param); - }); - }; - var xhr = new XMLHttpRequest(); - if (maybeEvents !== undefined) { - var match = maybeEvents; - var mayCB = function (thenDo, param) { - if (param !== undefined) { - return Curry._1(thenDo, Curry._1(param, callbacks)); - } else { - return /* () */0; - } - }; - mayCB((function (param) { - xhr.onreadystatechange = param; - return /* () */0; - }), match.onreadystatechange); - mayCB((function (param) { - xhr.onprogress = param; - return /* () */0; - }), match.onprogress); - } - var partial_arg = /* Error */Block.__(1, [/* NetworkError */1]); - var cb = function (param) { - return enqRes(partial_arg, param); - }; - xhr.onerror = cb; - var partial_arg$1 = /* Error */Block.__(1, [/* Timeout */0]); - var cb$1 = function (param) { - return enqRes(partial_arg$1, param); - }; - xhr.ontimeout = cb$1; - var partial_arg$2 = /* Error */Block.__(1, [/* Aborted */2]); - var cb$2 = function (param) { - return enqRes(partial_arg$2, param); - }; - xhr.onabort = cb$2; - var cb$3 = function (_ev) { - var match = Web_xmlhttprequest.getAllResponseHeadersAsDict(xhr); - var headers; - headers = match.tag ? /* Empty */0 : match[0]; - var response_url = xhr.responseURL; - var response_status = { - code: xhr.status, - message: xhr.statusText - }; - var response_body = Web_xmlhttprequest.get_response(xhr); - var response = { - url: response_url, - status: response_status, - headers: headers, - body: response_body - }; - if (response_status.code < 200 || 300 <= response_status.code) { - return enqResError(/* BadStatus */Block.__(1, [response]))(/* () */0); - } else { - var match$1 = Curry._1(responseToResult, response); - if (match$1.tag) { - return enqResError(/* BadPayload */Block.__(2, [ - match$1[0], - response - ]))(/* () */0); - } else { - return enqResOk(match$1[0])(/* () */0); - } - } - }; - xhr.onload = cb$3; - try { - Web_xmlhttprequest.open_(method$prime, url, undefined, undefined, undefined, xhr); - } - catch (exn){ - enqResError(/* BadUrl */Block.__(0, [url]))(/* () */0); - } - var setHeader = function (param) { - return Web_xmlhttprequest.setRequestHeader(param[0], param[1], xhr); - }; - List.iter(setHeader, headers); - Web_xmlhttprequest.set_responseType(typ, xhr); - if (timeout !== undefined) { - xhr.timeout = timeout; - } - xhr.withCredentials = withCredentials; - Web_xmlhttprequest.send(body, xhr); - return /* () */0; - })]); -} - -function encodeUri(str) { - return encodeURIComponent(str); -} - -function decodeUri(str) { - try { - return decodeURIComponent(str); - } - catch (exn){ - return ; - } -} - -function track(toMessage, param) { - var events = param[1]; - var onprogress = (function (callbacks, ev) { - var match = Tea_json.Decoder.decodeValue(Tea_json.Decoder.field("lengthComputable", Tea_json.Decoder.bool), ev); - var lengthComputable; - lengthComputable = match.tag ? false : match[0]; - if (lengthComputable) { - var decoder = Tea_json.Decoder.map2((function (bytes, bytesExpected) { - return { - bytes: bytes, - bytesExpected: bytesExpected - }; - }), Tea_json.Decoder.field("loaded", Tea_json.Decoder.$$int), Tea_json.Decoder.field("total", Tea_json.Decoder.$$int)); - var match$1 = Tea_json.Decoder.decodeValue(decoder, ev); - if (match$1.tag) { - return /* () */0; - } else { - return Curry._1(callbacks.contents.enqueue, Curry._1(toMessage, match$1[0])); - } - } else { - return 0; - } - }); - var events$1 = events !== undefined ? events : emptyRequestEvents; - return /* Request */[ - param[0], - { - onreadystatechange: events$1.onreadystatechange, - onprogress: onprogress - } - ]; -} - -var Progress_emptyProgress = { - bytes: 0, - bytesExpected: 0 -}; - -var Progress = { - emptyProgress: Progress_emptyProgress, - track: track -}; - -exports.string_of_error = string_of_error; -exports.emptyRequestEvents = emptyRequestEvents; -exports.expectStringResponse = expectStringResponse; -exports.expectString = expectString; -exports.request = request; -exports.getString = getString; -exports.toTask = toTask; -exports.send = send; -exports.encodeUri = encodeUri; -exports.decodeUri = decodeUri; -exports.Progress = Progress; -/* expectString Not a pure module */ - -},{"./tea_json.js":8,"./web_xmlhttprequest.js":24,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_builtin_exceptions.js":40,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/caml_primitive.js":51,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61}],8:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var $$Array = require("bs-platform/lib/js/array.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Js_dict = require("bs-platform/lib/js/js_dict.js"); -var Web_json = require("./web_json.js"); -var Caml_array = require("bs-platform/lib/js/caml_array.js"); -var Pervasives = require("bs-platform/lib/js/pervasives.js"); -var Tea_result = require("./tea_result.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); -var Caml_exceptions = require("bs-platform/lib/js/caml_exceptions.js"); -var Caml_js_exceptions = require("bs-platform/lib/js/caml_js_exceptions.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function height(param) { - if (param) { - return param[/* h */4]; - } else { - return 0; - } -} - -function create(l, x, d, r) { - var hl = height(l); - var hr = height(r); - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; -} - -function singleton(x, d) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */d, - /* r : Empty */0, - /* h */1 - ]; -} - -function bal(l, x, d, r) { - var hl = l ? l[/* h */4] : 0; - var hr = r ? r[/* h */4] : 0; - if (hl > (hr + 2 | 0)) { - if (l) { - var lr = l[/* r */3]; - var ld = l[/* d */2]; - var lv = l[/* v */1]; - var ll = l[/* l */0]; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } else if (lr) { - return create(create(ll, lv, ld, lr[/* l */0]), lr[/* v */1], lr[/* d */2], create(lr[/* r */3], x, d, r)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else if (hr > (hl + 2 | 0)) { - if (r) { - var rr = r[/* r */3]; - var rd = r[/* d */2]; - var rv = r[/* v */1]; - var rl = r[/* l */0]; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } else if (rl) { - return create(create(l, x, d, rl[/* l */0]), rl[/* v */1], rl[/* d */2], create(rl[/* r */3], rv, rd, rr)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - } -} - -function is_empty(param) { - if (param) { - return false; - } else { - return true; - } -} - -function add(x, data, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = add(x, data, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */data, - /* r : Empty */0, - /* h */1 - ]; - } -} - -function find(x, _param) { - while(true) { - var param = _param; - if (param) { - var c = Caml_primitive.caml_string_compare(x, param[/* v */1]); - if (c === 0) { - return param[/* d */2]; - } else { - _param = c < 0 ? param[/* l */0] : param[/* r */3]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function find_first(f, _param) { - while(true) { - var param = _param; - if (param) { - var v = param[/* v */1]; - if (Curry._1(f, v)) { - var _v0 = v; - var _d0 = param[/* d */2]; - var f$1 = f; - var _param$1 = param[/* l */0]; - while(true) { - var param$1 = _param$1; - var d0 = _d0; - var v0 = _v0; - if (param$1) { - var v$1 = param$1[/* v */1]; - if (Curry._1(f$1, v$1)) { - _param$1 = param$1[/* l */0]; - _d0 = param$1[/* d */2]; - _v0 = v$1; - continue ; - } else { - _param$1 = param$1[/* r */3]; - continue ; - } - } else { - return /* tuple */[ - v0, - d0 - ]; - } - }; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function find_first_opt(f, _param) { - while(true) { - var param = _param; - if (param) { - var v = param[/* v */1]; - if (Curry._1(f, v)) { - var _v0 = v; - var _d0 = param[/* d */2]; - var f$1 = f; - var _param$1 = param[/* l */0]; - while(true) { - var param$1 = _param$1; - var d0 = _d0; - var v0 = _v0; - if (param$1) { - var v$1 = param$1[/* v */1]; - if (Curry._1(f$1, v$1)) { - _param$1 = param$1[/* l */0]; - _d0 = param$1[/* d */2]; - _v0 = v$1; - continue ; - } else { - _param$1 = param$1[/* r */3]; - continue ; - } - } else { - return /* tuple */[ - v0, - d0 - ]; - } - }; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return ; - } - }; -} - -function find_last(f, _param) { - while(true) { - var param = _param; - if (param) { - var v = param[/* v */1]; - if (Curry._1(f, v)) { - var _v0 = v; - var _d0 = param[/* d */2]; - var f$1 = f; - var _param$1 = param[/* r */3]; - while(true) { - var param$1 = _param$1; - var d0 = _d0; - var v0 = _v0; - if (param$1) { - var v$1 = param$1[/* v */1]; - if (Curry._1(f$1, v$1)) { - _param$1 = param$1[/* r */3]; - _d0 = param$1[/* d */2]; - _v0 = v$1; - continue ; - } else { - _param$1 = param$1[/* l */0]; - continue ; - } - } else { - return /* tuple */[ - v0, - d0 - ]; - } - }; - } else { - _param = param[/* l */0]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function find_last_opt(f, _param) { - while(true) { - var param = _param; - if (param) { - var v = param[/* v */1]; - if (Curry._1(f, v)) { - var _v0 = v; - var _d0 = param[/* d */2]; - var f$1 = f; - var _param$1 = param[/* r */3]; - while(true) { - var param$1 = _param$1; - var d0 = _d0; - var v0 = _v0; - if (param$1) { - var v$1 = param$1[/* v */1]; - if (Curry._1(f$1, v$1)) { - _param$1 = param$1[/* r */3]; - _d0 = param$1[/* d */2]; - _v0 = v$1; - continue ; - } else { - _param$1 = param$1[/* l */0]; - continue ; - } - } else { - return /* tuple */[ - v0, - d0 - ]; - } - }; - } else { - _param = param[/* l */0]; - continue ; - } - } else { - return ; - } - }; -} - -function find_opt(x, _param) { - while(true) { - var param = _param; - if (param) { - var c = Caml_primitive.caml_string_compare(x, param[/* v */1]); - if (c === 0) { - return Caml_option.some(param[/* d */2]); - } else { - _param = c < 0 ? param[/* l */0] : param[/* r */3]; - continue ; - } - } else { - return ; - } - }; -} - -function mem(x, _param) { - while(true) { - var param = _param; - if (param) { - var c = Caml_primitive.caml_string_compare(x, param[/* v */1]); - if (c === 0) { - return true; - } else { - _param = c < 0 ? param[/* l */0] : param[/* r */3]; - continue ; - } - } else { - return false; - } - }; -} - -function min_binding(_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function min_binding_opt(_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - return ; - } - }; -} - -function max_binding(_param) { - while(true) { - var param = _param; - if (param) { - var r = param[/* r */3]; - if (r) { - _param = r; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function max_binding_opt(_param) { - while(true) { - var param = _param; - if (param) { - var r = param[/* r */3]; - if (r) { - _param = r; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - return ; - } - }; -} - -function remove_min_binding(param) { - if (param) { - var l = param[/* l */0]; - if (l) { - return bal(remove_min_binding(l), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return param[/* r */3]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.remove_min_elt" - ]; - } -} - -function merge(t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } -} - -function remove(x, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return merge(l, r); - } else if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = remove(x, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Empty */0; - } -} - -function update(x, f, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - var match = Curry._1(f, Caml_option.some(d)); - if (match !== undefined) { - var data = Caml_option.valFromOption(match); - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else { - return merge(l, r); - } - } else if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = update(x, f, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - var match$1 = Curry._1(f, undefined); - if (match$1 !== undefined) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */Caml_option.valFromOption(match$1), - /* r : Empty */0, - /* h */1 - ]; - } else { - return /* Empty */0; - } - } -} - -function iter(f, _param) { - while(true) { - var param = _param; - if (param) { - iter(f, param[/* l */0]); - Curry._2(f, param[/* v */1], param[/* d */2]); - _param = param[/* r */3]; - continue ; - } else { - return /* () */0; - } - }; -} - -function map(f, param) { - if (param) { - var l$prime = map(f, param[/* l */0]); - var d$prime = Curry._1(f, param[/* d */2]); - var r$prime = map(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */param[/* v */1], - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } -} - -function mapi(f, param) { - if (param) { - var v = param[/* v */1]; - var l$prime = mapi(f, param[/* l */0]); - var d$prime = Curry._2(f, v, param[/* d */2]); - var r$prime = mapi(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */v, - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } -} - -function fold(f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (m) { - _accu = Curry._3(f, m[/* v */1], m[/* d */2], fold(f, m[/* l */0], accu)); - _m = m[/* r */3]; - continue ; - } else { - return accu; - } - }; -} - -function for_all(p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) && for_all(p, param[/* l */0])) { - _param = param[/* r */3]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; -} - -function exists(p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) || exists(p, param[/* l */0])) { - return true; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return false; - } - }; -} - -function add_min_binding(k, x, param) { - if (param) { - return bal(add_min_binding(k, x, param[/* l */0]), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return singleton(k, x); - } -} - -function add_max_binding(k, x, param) { - if (param) { - return bal(param[/* l */0], param[/* v */1], param[/* d */2], add_max_binding(k, x, param[/* r */3])); - } else { - return singleton(k, x); - } -} - -function join(l, v, d, r) { - if (l) { - if (r) { - var rh = r[/* h */4]; - var lh = l[/* h */4]; - if (lh > (rh + 2 | 0)) { - return bal(l[/* l */0], l[/* v */1], l[/* d */2], join(l[/* r */3], v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r[/* l */0]), r[/* v */1], r[/* d */2], r[/* r */3]); - } else { - return create(l, v, d, r); - } - } else { - return add_max_binding(v, d, l); - } - } else { - return add_min_binding(v, d, r); - } -} - -function concat(t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } -} - -function concat_or_join(t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); - } -} - -function split(x, param) { - if (param) { - var r = param[/* r */3]; - var d = param[/* d */2]; - var v = param[/* v */1]; - var l = param[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return /* tuple */[ - l, - Caml_option.some(d), - r - ]; - } else if (c < 0) { - var match = split(x, l); - return /* tuple */[ - match[0], - match[1], - join(match[2], v, d, r) - ]; - } else { - var match$1 = split(x, r); - return /* tuple */[ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - undefined, - /* Empty */0 - ]; - } -} - -function merge$1(f, s1, s2) { - if (s1) { - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1[/* l */0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[/* d */2]), match[1]), merge$1(f, s1[/* r */3], match[2])); - } - - } else if (!s2) { - return /* Empty */0; - } - if (s2) { - var v2 = s2[/* v */1]; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2[/* l */0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[/* d */2])), merge$1(f, match$1[2], s2[/* r */3])); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "map.ml", - 393, - 10 - ] - ]; - } -} - -function union(f, s1, s2) { - if (s1) { - if (s2) { - var d2 = s2[/* d */2]; - var v2 = s2[/* v */1]; - var d1 = s1[/* d */2]; - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= s2[/* h */4]) { - var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1[/* l */0], match[0]); - var r = union(f, s1[/* r */3], match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } - } else { - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2[/* l */0]); - var r$1 = union(f, match$1[2], s2[/* r */3]); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); - } else { - return join(l$1, v2, d2, r$1); - } - } - } else { - return s1; - } - } else { - return s2; - } -} - -function filter(p, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var l$prime = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$prime = filter(p, r); - if (pvd) { - if (l === l$prime && r === r$prime) { - return m; - } else { - return join(l$prime, v, d, r$prime); - } - } else { - return concat(l$prime, r$prime); - } - } else { - return /* Empty */0; - } -} - -function partition(p, param) { - if (param) { - var d = param[/* d */2]; - var v = param[/* v */1]; - var match = partition(p, param[/* l */0]); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param[/* r */3]); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return /* tuple */[ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return /* tuple */[ - concat(lt, rt), - join(lf, v, d, rf) - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - /* Empty */0 - ]; - } -} - -function cons_enum(_m, _e) { - while(true) { - var e = _e; - var m = _m; - if (m) { - _e = /* More */[ - m[/* v */1], - m[/* d */2], - m[/* r */3], - e - ]; - _m = m[/* l */0]; - continue ; - } else { - return e; - } - }; -} - -function compare(cmp, m1, m2) { - var _e1 = cons_enum(m1, /* End */0); - var _e2 = cons_enum(m2, /* End */0); - while(true) { - var e2 = _e2; - var e1 = _e1; - if (e1) { - if (e2) { - var c = Caml_primitive.caml_string_compare(e1[0], e2[0]); - if (c !== 0) { - return c; - } else { - var c$1 = Curry._2(cmp, e1[1], e2[1]); - if (c$1 !== 0) { - return c$1; - } else { - _e2 = cons_enum(e2[2], e2[3]); - _e1 = cons_enum(e1[2], e1[3]); - continue ; - } - } - } else { - return 1; - } - } else if (e2) { - return -1; - } else { - return 0; - } - }; -} - -function equal(cmp, m1, m2) { - var _e1 = cons_enum(m1, /* End */0); - var _e2 = cons_enum(m2, /* End */0); - while(true) { - var e2 = _e2; - var e1 = _e1; - if (e1) { - if (e2 && Caml_primitive.caml_string_compare(e1[0], e2[0]) === 0 && Curry._2(cmp, e1[1], e2[1])) { - _e2 = cons_enum(e2[2], e2[3]); - _e1 = cons_enum(e1[2], e1[3]); - continue ; - } else { - return false; - } - } else if (e2) { - return false; - } else { - return true; - } - }; -} - -function cardinal(param) { - if (param) { - return (cardinal(param[/* l */0]) + 1 | 0) + cardinal(param[/* r */3]) | 0; - } else { - return 0; - } -} - -function bindings_aux(_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[/* l */0]; - _accu = /* :: */[ - /* tuple */[ - param[/* v */1], - param[/* d */2] - ], - bindings_aux(accu, param[/* r */3]) - ]; - continue ; - } else { - return accu; - } - }; -} - -function bindings(s) { - return bindings_aux(/* [] */0, s); -} - -var ObjectDict = { - empty: /* Empty */0, - is_empty: is_empty, - mem: mem, - add: add, - update: update, - singleton: singleton, - remove: remove, - merge: merge$1, - union: union, - compare: compare, - equal: equal, - iter: iter, - fold: fold, - for_all: for_all, - exists: exists, - filter: filter, - partition: partition, - cardinal: cardinal, - bindings: bindings, - min_binding: min_binding, - min_binding_opt: min_binding_opt, - max_binding: max_binding, - max_binding_opt: max_binding_opt, - choose: min_binding, - choose_opt: min_binding_opt, - split: split, - find: find, - find_opt: find_opt, - find_first: find_first, - find_first_opt: find_first_opt, - find_last: find_last, - find_last_opt: find_last_opt, - map: map, - mapi: mapi -}; - -var ParseFail = Caml_exceptions.create("Tea_json.Decoder.ParseFail"); - -var string = /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag) { - return /* Error */Block.__(1, ["Non-string value"]); - } else { - return /* Ok */Block.__(0, [match[0]]); - } - })]; - -var $$int = /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONNumber */1) { - return /* Error */Block.__(1, ["Non-int value"]); - } else { - var n = match[0]; - if (n > Pervasives.min_int && n < Pervasives.max_int) { - return /* Ok */Block.__(0, [n | 0]); - } else { - return /* Error */Block.__(1, ["number out of int range"]); - } - } - })]; - -var $$float = /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONNumber */1) { - return /* Error */Block.__(1, ["Non-float-value"]); - } else { - return /* Ok */Block.__(0, [match[0]]); - } - })]; - -var bool = /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number") { - switch (match) { - case /* JSONFalse */0 : - return /* Ok */Block.__(0, [false]); - case /* JSONTrue */1 : - return /* Ok */Block.__(0, [true]); - case /* JSONNull */2 : - return /* Error */Block.__(1, ["Non-boolean value"]); - - } - } else { - return /* Error */Block.__(1, ["Non-boolean value"]); - } - })]; - -function $$null(v) { - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" && match >= 2) { - return /* Ok */Block.__(0, [v]); - } else { - return /* Error */Block.__(1, ["Non-null value"]); - } - })]; -} - -function list(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONArray */3) { - return /* Error */Block.__(1, ["Non-list value"]); - } else { - var parse = function (v) { - var match = Curry._1(decoder, v); - if (match.tag) { - throw [ - ParseFail, - match[0] - ]; - } else { - return match[0]; - } - }; - try { - return /* Ok */Block.__(0, [List.map(parse, $$Array.to_list(match[0]))]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, ["list -> " + exn[1]]); - } else { - throw exn; - } - } - } - })]; -} - -function array(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONArray */3) { - return /* Error */Block.__(1, ["Non-array value"]); - } else { - var parse = function (v) { - var match = Curry._1(decoder, v); - if (match.tag) { - throw [ - ParseFail, - match[0] - ]; - } else { - return match[0]; - } - }; - try { - return /* Ok */Block.__(0, [$$Array.map(parse, match[0])]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, ["array -> " + exn[1]]); - } else { - throw exn; - } - } - } - })]; -} - -function keyValuePairs(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONObject */2) { - return /* Error */Block.__(1, ["Non-keyValuePair value"]); - } else { - var o = match[0]; - var keys = Object.keys(o); - var parse = function (k, l) { - var match = Js_dict.get(o, k); - if (match !== undefined) { - var match$1 = Curry._1(decoder, Caml_option.valFromOption(match)); - if (match$1.tag) { - throw [ - ParseFail, - match$1[0] - ]; - } else { - return /* :: */[ - /* tuple */[ - k, - match$1[0] - ], - l - ]; - } - } else { - throw [ - ParseFail, - "Key is undefined: " + k - ]; - } - }; - try { - return /* Ok */Block.__(0, [$$Array.fold_right(parse, keys, /* [] */0)]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, ["Invalid keyValuePair parsing: " + exn[1]]); - } else { - throw exn; - } - } - } - })]; -} - -function dict(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONObject */2) { - return /* Error */Block.__(1, ["Non-dict value"]); - } else { - var o = match[0]; - var keys = Object.keys(o); - var parse = function (k, d) { - var match = Js_dict.get(o, k); - if (match !== undefined) { - var match$1 = Curry._1(decoder, Caml_option.valFromOption(match)); - if (match$1.tag) { - throw [ - ParseFail, - match$1[0] - ]; - } else { - return add(k, match$1[0], d); - } - } else { - throw [ - ParseFail, - "Key is undefined: " + k - ]; - } - }; - try { - return /* Ok */Block.__(0, [$$Array.fold_right(parse, keys, /* Empty */0)]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, ["Invalid dict parsing: " + exn[1]]); - } else { - throw exn; - } - } - } - })]; -} - -function field(key, param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONObject */2) { - return /* Error */Block.__(1, ["Non-fieldable value"]); - } else { - var match$1 = Js_dict.get(match[0], key); - if (match$1 !== undefined) { - var o = Curry._1(decoder, Caml_option.valFromOption(match$1)); - if (o.tag) { - return /* Error */Block.__(1, ["field `" + (key + ("` -> " + o[0]))]); - } else { - return o; - } - } else { - return /* Error */Block.__(1, ["Field Value is undefined: " + key]); - } - } - })]; -} - -function at(fields, dec) { - return List.fold_right(field, fields, dec); -} - -function index(idx, param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Web_json.classify(value); - if (typeof match === "number" || match.tag !== /* JSONArray */3) { - return /* Error */Block.__(1, ["Non-array value"]); - } else { - var a = match[0]; - if (idx < 0 || idx > a.length) { - return /* Error */Block.__(1, ["Array index out of range: " + String(idx)]); - } else { - return Curry._1(decoder, Caml_array.caml_array_get(a, idx)); - } - } - })]; -} - -function maybe(param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder, value); - if (match.tag) { - return /* Ok */Block.__(0, [undefined]); - } else { - return /* Ok */Block.__(0, [Caml_option.some(match[0])]); - } - })]; -} - -function oneOf(decoders) { - return /* Decoder */[(function (value) { - var parse = function (v, _param) { - while(true) { - var param = _param; - if (param) { - var rest = param[1]; - try { - var ok = Curry._1(param[0][0], v); - if (ok.tag) { - return parse(v, rest); - } else { - return ok; - } - } - catch (exn){ - _param = rest; - continue ; - } - } else { - return /* Error */Block.__(1, ["No one-of's matched"]); - } - }; - }; - return parse(value, decoders); - })]; -} - -function map$1(mapper, param) { - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - if (match.tag) { - return /* Error */Block.__(1, ["map " + match[0]]); - } else { - return /* Ok */Block.__(0, [Curry._1(mapper, match[0])]); - } - })]; -} - -function map2(mapper, param, param$1) { - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - if (!match.tag && !match$1.tag) { - return /* Ok */Block.__(0, [Curry._2(mapper, match[0], match$1[0])]); - } - var match$2 = Tea_result.error_of_first(match, match$1); - if (match$2 !== undefined) { - return /* Error */Block.__(1, ["map2 -> " + match$2]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map3(mapper, param, param$1, param$2) { - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - if (!match.tag && !match$1.tag && !match$2.tag) { - return /* Ok */Block.__(0, [Curry._3(mapper, match[0], match$1[0], match$2[0])]); - } - var match$3 = Tea_result.first(match$2, Tea_result.first(match$1, match)); - if (match$3.tag) { - return /* Error */Block.__(1, ["map3 -> " + match$3[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map4(mapper, param, param$1, param$2, param$3) { - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag) { - return /* Ok */Block.__(0, [Curry._4(mapper, match[0], match$1[0], match$2[0], match$3[0])]); - } - var match$4 = Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match))); - if (match$4.tag) { - return /* Error */Block.__(1, ["map4 -> " + match$4[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map5(mapper, param, param$1, param$2, param$3, param$4) { - var decoder5 = param$4[0]; - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - var match$4 = Curry._1(decoder5, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag && !match$4.tag) { - return /* Ok */Block.__(0, [Curry._5(mapper, match[0], match$1[0], match$2[0], match$3[0], match$4[0])]); - } - var match$5 = Tea_result.first(match$4, Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match)))); - if (match$5.tag) { - return /* Error */Block.__(1, ["map5 -> " + match$5[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map6(mapper, param, param$1, param$2, param$3, param$4, param$5) { - var decoder6 = param$5[0]; - var decoder5 = param$4[0]; - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - var match$4 = Curry._1(decoder5, value); - var match$5 = Curry._1(decoder6, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag && !match$4.tag && !match$5.tag) { - return /* Ok */Block.__(0, [Curry._6(mapper, match[0], match$1[0], match$2[0], match$3[0], match$4[0], match$5[0])]); - } - var match$6 = Tea_result.first(match$5, Tea_result.first(match$4, Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match))))); - if (match$6.tag) { - return /* Error */Block.__(1, ["map6 -> " + match$6[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map7(mapper, param, param$1, param$2, param$3, param$4, param$5, param$6) { - var decoder7 = param$6[0]; - var decoder6 = param$5[0]; - var decoder5 = param$4[0]; - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - var match$4 = Curry._1(decoder5, value); - var match$5 = Curry._1(decoder6, value); - var match$6 = Curry._1(decoder7, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag && !match$4.tag && !match$5.tag && !match$6.tag) { - return /* Ok */Block.__(0, [Curry._7(mapper, match[0], match$1[0], match$2[0], match$3[0], match$4[0], match$5[0], match$6[0])]); - } - var match$7 = Tea_result.first(match$6, Tea_result.first(match$5, Tea_result.first(match$4, Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match)))))); - if (match$7.tag) { - return /* Error */Block.__(1, ["map7 -> " + match$7[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function map8(mapper, param, param$1, param$2, param$3, param$4, param$5, param$6, param$7) { - var decoder8 = param$7[0]; - var decoder7 = param$6[0]; - var decoder6 = param$5[0]; - var decoder5 = param$4[0]; - var decoder4 = param$3[0]; - var decoder3 = param$2[0]; - var decoder2 = param$1[0]; - var decoder1 = param[0]; - return /* Decoder */[(function (value) { - var match = Curry._1(decoder1, value); - var match$1 = Curry._1(decoder2, value); - var match$2 = Curry._1(decoder3, value); - var match$3 = Curry._1(decoder4, value); - var match$4 = Curry._1(decoder5, value); - var match$5 = Curry._1(decoder6, value); - var match$6 = Curry._1(decoder7, value); - var match$7 = Curry._1(decoder8, value); - if (!match.tag && !match$1.tag && !match$2.tag && !match$3.tag && !match$4.tag && !match$5.tag && !match$6.tag && !match$7.tag) { - return /* Ok */Block.__(0, [Curry._8(mapper, match[0], match$1[0], match$2[0], match$3[0], match$4[0], match$5[0], match$6[0], match$7[0])]); - } - var match$8 = Tea_result.first(match$7, Tea_result.first(match$6, Tea_result.first(match$5, Tea_result.first(match$4, Tea_result.first(match$3, Tea_result.first(match$2, Tea_result.first(match$1, match))))))); - if (match$8.tag) { - return /* Error */Block.__(1, ["map8 -> " + match$8[0]]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Impossible case" - ]; - } - })]; -} - -function succeed(v) { - return /* Decoder */[(function (_value) { - return /* Ok */Block.__(0, [v]); - })]; -} - -function fail(e) { - return /* Decoder */[(function (_value) { - return /* Error */Block.__(1, [e]); - })]; -} - -var value = /* Decoder */[(function (value) { - return /* Ok */Block.__(0, [value]); - })]; - -function andThen(func, param) { - var decoder = param[0]; - return /* Decoder */[(function (value) { - var err = Curry._1(decoder, value); - if (err.tag) { - return err; - } else { - var match = Curry._1(func, err[0]); - return Curry._1(match[0], value); - } - })]; -} - -function lazy_(func) { - return andThen(func, /* Decoder */[(function (_value) { - return /* Ok */Block.__(0, [/* () */0]); - })]); -} - -function nullable(decoder) { - return oneOf(/* :: */[ - $$null(undefined), - /* :: */[ - map$1((function (v) { - return Caml_option.some(v); - }), decoder), - /* [] */0 - ] - ]); -} - -function decodeValue(param, value) { - try { - return Curry._1(param[0], value); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, [exn[1]]); - } else { - return /* Error */Block.__(1, ["Unknown JSON parsing error"]); - } - } -} - -function decodeEvent(param, value) { - try { - return Curry._1(param[0], value); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === ParseFail) { - return /* Error */Block.__(1, [exn[1]]); - } else { - return /* Error */Block.__(1, ["Unknown JSON parsing error"]); - } - } -} - -function decodeString(decoder, string) { - try { - var value = JSON.parse(string); - return decodeValue(decoder, value); - } - catch (exn){ - return /* Error */Block.__(1, ["Invalid JSON string"]); - } -} - -var Decoder = { - ObjectDict: ObjectDict, - ParseFail: ParseFail, - string: string, - $$int: $$int, - $$float: $$float, - bool: bool, - $$null: $$null, - list: list, - array: array, - keyValuePairs: keyValuePairs, - dict: dict, - field: field, - at: at, - index: index, - maybe: maybe, - oneOf: oneOf, - map: map$1, - map2: map2, - map3: map3, - map4: map4, - map5: map5, - map6: map6, - map7: map7, - map8: map8, - succeed: succeed, - fail: fail, - value: value, - andThen: andThen, - lazy_: lazy_, - nullable: nullable, - decodeValue: decodeValue, - decodeEvent: decodeEvent, - decodeString: decodeString -}; - -function encode(indentLevel, value) { - return Web_json.string_of_json(indentLevel, value); -} - -function string$1(v) { - return v; -} - -function $$int$1(v) { - return v; -} - -function $$float$1(v) { - return v; -} - -function bool$1(v) { - return v; -} - -function object_(v) { - var aux = function (o, param) { - o[param[0]] = param[1]; - return o; - }; - return List.fold_left(aux, { }, v); -} - -function array$1(v) { - return v; -} - -var list$1 = $$Array.of_list; - -var Encoder = { - encode: encode, - string: string$1, - $$int: $$int$1, - $$float: $$float$1, - bool: bool$1, - $$null: Web_json.$$null, - object_: object_, - array: array$1, - list: list$1 -}; - -exports.Decoder = Decoder; -exports.Encoder = Encoder; -/* No side effect */ - -},{"./tea_result.js":11,"./web_json.js":18,"bs-platform/lib/js/array.js":35,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_array.js":39,"bs-platform/lib/js/caml_builtin_exceptions.js":40,"bs-platform/lib/js/caml_exceptions.js":42,"bs-platform/lib/js/caml_js_exceptions.js":48,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/caml_primitive.js":51,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/js_dict.js":59,"bs-platform/lib/js/list.js":61,"bs-platform/lib/js/pervasives.js":62}],9:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_sub = require("./tea_sub.js"); -var Tea_json = require("./tea_json.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -var position = Tea_json.Decoder.map2((function (x, y) { - return { - x: x, - y: y - }; - }), Tea_json.Decoder.field("pageX", Tea_json.Decoder.$$int), Tea_json.Decoder.field("pageY", Tea_json.Decoder.$$int)); - -function registerGlobal(name, key, tagger) { - var enableCall = function (callbacks_base) { - var callbacks = { - contents: callbacks_base - }; - var fn = function (ev) { - var match = Tea_json.Decoder.decodeEvent(position, ev); - if (match.tag) { - return ; - } else { - return Caml_option.some(Curry._1(tagger, match[0])); - } - }; - var handler = /* EventHandlerCallback */Block.__(0, [ - key, - fn - ]); - var elem = document; - var cache = Vdom.eventHandler_Register(callbacks, elem, name, handler); - return (function (param) { - Vdom.eventHandler_Unregister(elem, name, cache); - return /* () */0; - }); - }; - return Tea_sub.registration(key, enableCall); -} - -function clicks($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return registerGlobal("click", key, tagger); -} - -function moves($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return registerGlobal("mousemove", key, tagger); -} - -function downs($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return registerGlobal("mousedown", key, tagger); -} - -function ups($staropt$star, tagger) { - var key = $staropt$star !== undefined ? $staropt$star : ""; - return registerGlobal("mouseup", key, tagger); -} - -exports.position = position; -exports.registerGlobal = registerGlobal; -exports.clicks = clicks; -exports.moves = moves; -exports.downs = downs; -exports.ups = ups; -/* position Not a pure module */ - -},{"./tea_json.js":8,"./tea_sub.js":12,"./vdom.js":14,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/curry.js":58}],10:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_app = require("./tea_app.js"); -var Tea_sub = require("./tea_sub.js"); -var Web_window = require("./web_window.js"); -var Web_location = require("./web_location.js"); -var Web_window_history = require("./web_window_history.js"); - -function getLocation(param) { - return Web_location.asRecord(document.location); -} - -var notifier = { - contents: undefined -}; - -function notifyUrlChange(param) { - var match = notifier.contents; - if (match !== undefined) { - var $$location = Web_location.asRecord(document.location); - Curry._1(match, $$location); - return /* () */0; - } else { - return /* () */0; - } -} - -function subscribe(tagger) { - var enableCall = function (callbacks) { - var notifyHandler = function ($$location) { - return Curry._1(callbacks.enqueue, Curry._1(tagger, $$location)); - }; - notifier.contents = notifyHandler; - var handler = function (_event) { - return notifyUrlChange(/* () */0); - }; - Web_window.addEventListener("popstate", handler, false); - return (function (param) { - return Web_window.removeEventListener("popstate", handler, false); - }); - }; - return Tea_sub.registration("navigation", enableCall); -} - -function replaceState(url) { - Web_window_history.replaceState(window, JSON.parse("{}"), "", url); - return /* () */0; -} - -function pushState(url) { - Web_window_history.pushState(window, JSON.parse("{}"), "", url); - return /* () */0; -} - -function modifyUrl(url) { - return /* EnqueueCall */Block.__(2, [(function (_enqueue) { - replaceState(url); - notifyUrlChange(/* () */0); - return /* () */0; - })]); -} - -function newUrl(url) { - return /* EnqueueCall */Block.__(2, [(function (_enqueue) { - pushState(url); - notifyUrlChange(/* () */0); - return /* () */0; - })]); -} - -function go(step) { - return /* EnqueueCall */Block.__(2, [(function (_enqueue) { - Web_window_history.go(window, step); - notifyUrlChange(/* () */0); - return /* () */0; - })]); -} - -function back(step) { - return go(-step | 0); -} - -var forward = go; - -function navigationProgram(locationToMessage, stuff) { - var init = function (flag) { - return Curry._2(stuff.init, flag, Web_location.asRecord(document.location)); - }; - var subscriptions = function (model) { - return /* Batch */Block.__(0, [/* :: */[ - subscribe(locationToMessage), - /* :: */[ - Curry._1(stuff.subscriptions, model), - /* [] */0 - ] - ]]); - }; - var partial_arg_update = stuff.update; - var partial_arg_view = stuff.view; - var partial_arg_shutdown = stuff.shutdown; - var partial_arg = { - init: init, - update: partial_arg_update, - view: partial_arg_view, - subscriptions: subscriptions, - shutdown: partial_arg_shutdown - }; - return (function (param, param$1) { - return Tea_app.program(partial_arg, param, param$1); - }); -} - -exports.getLocation = getLocation; -exports.notifier = notifier; -exports.notifyUrlChange = notifyUrlChange; -exports.subscribe = subscribe; -exports.replaceState = replaceState; -exports.pushState = pushState; -exports.modifyUrl = modifyUrl; -exports.newUrl = newUrl; -exports.go = go; -exports.back = back; -exports.forward = forward; -exports.navigationProgram = navigationProgram; -/* No side effect */ - -},{"./tea_app.js":1,"./tea_sub.js":12,"./web_location.js":19,"./web_window.js":21,"./web_window_history.js":22,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/curry.js":58}],11:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function result_to_option(param) { - if (param.tag) { - return ; - } else { - return Caml_option.some(param[0]); - } -} - -function option_of_result(param) { - if (param.tag) { - return ; - } else { - return Caml_option.some(param[0]); - } -} - -function ok(param) { - if (param.tag) { - return ; - } else { - return Caml_option.some(param[0]); - } -} - -function error(param) { - if (param.tag) { - return Caml_option.some(param[0]); - } - -} - -function last_of(_param) { - while(true) { - var param = _param; - if (param) { - var tl = param[1]; - var last = param[0]; - if (tl && !last.tag) { - _param = tl; - continue ; - } else { - return last; - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "`Tea.Result.do` must never be passed the empty list" - ]; - } - }; -} - -function accumulate(param) { - if (param) { - var tl = param[1]; - var last = param[0]; - if (tl) { - if (last.tag) { - return last; - } else { - var e = accumulate(tl); - if (e.tag) { - return e; - } else { - return /* Ok */Block.__(0, [/* :: */[ - last[0], - e[0] - ]]); - } - } - } else if (last.tag) { - return last; - } else { - return /* Ok */Block.__(0, [/* :: */[ - last[0], - /* [] */0 - ]]); - } - } else { - return /* Ok */Block.__(0, [/* [] */0]); - } -} - -function first(fst, e) { - if (e.tag) { - return e; - } else { - return fst; - } -} - -function error_of_any(_param) { - while(true) { - var param = _param; - if (param) { - var hd = param[0]; - if (hd.tag) { - return Caml_option.some(hd[0]); - } else { - _param = param[1]; - continue ; - } - } else { - return ; - } - }; -} - -function error_of_first(fst, param) { - if (param.tag) { - return Caml_option.some(param[0]); - } else { - return error(fst); - } -} - -exports.result_to_option = result_to_option; -exports.option_of_result = option_of_result; -exports.ok = ok; -exports.error = error; -exports.last_of = last_of; -exports.accumulate = accumulate; -exports.first = first; -exports.error_of_any = error_of_any; -exports.error_of_first = error_of_first; -/* No side effect */ - -},{"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_builtin_exceptions.js":40,"bs-platform/lib/js/caml_option.js":50}],12:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("./vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); - -function batch(subs) { - return /* Batch */Block.__(0, [subs]); -} - -function registration(key, enableCall) { - return /* Registration */Block.__(1, [ - key, - (function (callbacks) { - return Curry._1(enableCall, callbacks.contents); - }), - { - contents: undefined - } - ]); -} - -function map(msgMapper, sub) { - var func = function (callbacks) { - return Vdom.wrapCallbacks(msgMapper, callbacks); - }; - return /* Mapper */Block.__(2, [ - func, - sub - ]); -} - -function mapFunc(func, sub) { - return /* Mapper */Block.__(2, [ - func, - sub - ]); -} - -function run(oldCallbacks, newCallbacks, oldSub, newSub) { - var enable = function (_callbacks, _param) { - while(true) { - var param = _param; - var callbacks = _callbacks; - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* Batch */0 : - var subs = param[0]; - if (subs) { - return List.iter((function(callbacks){ - return function (param) { - return enable(callbacks, param); - } - }(callbacks)), subs); - } else { - return /* () */0; - } - case /* Registration */1 : - param[2].contents = Curry._1(param[1], callbacks); - return /* () */0; - case /* Mapper */2 : - var subCallbacks = Curry._1(param[0], callbacks); - _param = param[1]; - _callbacks = subCallbacks; - continue ; - - } - } - }; - }; - var disable = function (_callbacks, _param) { - while(true) { - var param = _param; - var callbacks = _callbacks; - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* Batch */0 : - var subs = param[0]; - if (subs) { - return List.iter((function(callbacks){ - return function (param) { - return disable(callbacks, param); - } - }(callbacks)), subs); - } else { - return /* () */0; - } - case /* Registration */1 : - var diCB = param[2]; - var match = diCB.contents; - if (match !== undefined) { - diCB.contents = undefined; - return Curry._1(match, /* () */0); - } else { - return /* () */0; - } - case /* Mapper */2 : - var subCallbacks = Curry._1(param[0], callbacks); - _param = param[1]; - _callbacks = subCallbacks; - continue ; - - } - } - }; - }; - if (typeof oldSub === "number") { - if (typeof newSub === "number") { - return newSub; - } - - } else { - switch (oldSub.tag | 0) { - case /* Batch */0 : - if (typeof newSub !== "number" && !newSub.tag) { - var aux = function (_oldList, _newList) { - while(true) { - var newList = _newList; - var oldList = _oldList; - if (oldList) { - var oldRest = oldList[1]; - var oldSubSub = oldList[0]; - if (newList) { - run(oldCallbacks, newCallbacks, oldSubSub, newList[0]); - _newList = newList[1]; - _oldList = oldRest; - continue ; - } else { - disable(oldCallbacks, oldSubSub); - _newList = /* [] */0; - _oldList = oldRest; - continue ; - } - } else if (newList) { - enable(newCallbacks, newList[0]); - _newList = newList[1]; - _oldList = /* [] */0; - continue ; - } else { - return /* () */0; - } - }; - }; - aux(oldSub[0], newSub[0]); - return newSub; - } - break; - case /* Registration */1 : - if (typeof newSub !== "number" && newSub.tag === /* Registration */1 && oldSub[0] === newSub[0]) { - newSub[2].contents = oldSub[2].contents; - return newSub; - } - break; - case /* Mapper */2 : - if (typeof newSub !== "number" && newSub.tag === /* Mapper */2) { - var olderCallbacks = Curry._1(oldSub[0], oldCallbacks); - var newerCallbacks = Curry._1(newSub[0], newCallbacks); - run(olderCallbacks, newerCallbacks, oldSub[1], newSub[1]); - return newSub; - } - break; - - } - } - disable(oldCallbacks, oldSub); - enable(newCallbacks, newSub); - return newSub; -} - -var none = /* NoSub */0; - -exports.none = none; -exports.batch = batch; -exports.registration = registration; -exports.map = map; -exports.mapFunc = mapFunc; -exports.run = run; -/* No side effect */ - -},{"./vdom.js":14,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61}],13:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function nothing(param) { - return /* () */0; -} - -function performOpt(toOptionalMessage, param) { - var task = param[0]; - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - return Curry._1(task, (function (param) { - if (param.tag) { - throw [ - Caml_builtin_exceptions.failure, - "ERROR: Task perfom returned error of never! Should not happen!" - ]; - } else { - var match = Curry._1(toOptionalMessage, param[0]); - if (match !== undefined) { - return Curry._1(callbacks.contents.enqueue, Caml_option.valFromOption(match)); - } else { - return /* () */0; - } - } - })); - })]); -} - -function perform(toMessage, task) { - return performOpt((function (v) { - return Caml_option.some(Curry._1(toMessage, v)); - }), task); -} - -function attemptOpt(resultToOptionalMessage, param) { - var task = param[0]; - return /* EnqueueCall */Block.__(2, [(function (callbacks) { - return Curry._1(task, (function (value) { - var match = Curry._1(resultToOptionalMessage, value); - if (match !== undefined) { - return Curry._1(callbacks.contents.enqueue, Caml_option.valFromOption(match)); - } else { - return /* () */0; - } - })); - })]); -} - -function attempt(resultToMessage, task) { - return attemptOpt((function (v) { - return Caml_option.some(Curry._1(resultToMessage, v)); - }), task); -} - -function ignore(task) { - return attemptOpt((function (param) { - return ; - }), task); -} - -function succeed(value) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; -} - -function fail(value) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [value])); - })]; -} - -function nativeBinding(func) { - return /* Task */[func]; -} - -function andThen(fn, param) { - var task = param[0]; - return /* Task */[(function (cb) { - return Curry._1(task, (function (err) { - if (err.tag) { - return Curry._1(cb, err); - } else { - var match = Curry._1(fn, err[0]); - return Curry._1(match[0], cb); - } - })); - })]; -} - -function onError(fn, param) { - var task = param[0]; - return /* Task */[(function (cb) { - return Curry._1(task, (function (ok) { - if (ok.tag) { - var match = Curry._1(fn, ok[0]); - return Curry._1(match[0], cb); - } else { - return Curry._1(cb, ok); - } - })); - })]; -} - -function fromResult(param) { - if (param.tag) { - var value = param[0]; - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [value])); - })]; - } else { - var value$1 = param[0]; - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value$1])); - })]; - } -} - -function mapError(func, task) { - return onError((function (e) { - var value = Curry._1(func, e); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [value])); - })]; - }), task); -} - -function toOption(task) { - return onError((function (param) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [undefined])); - })]; - }), andThen((function (v) { - var value = Caml_option.some(v); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task)); -} - -function map(func, task1) { - return andThen((function (v1) { - var value = Curry._1(func, v1); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task1); -} - -function map2(func, task1, task2) { - return andThen((function (v1) { - return andThen((function (v2) { - var value = Curry._2(func, v1, v2); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task2); - }), task1); -} - -function map3(func, task1, task2, task3) { - return andThen((function (v1) { - return andThen((function (v2) { - return andThen((function (v3) { - var value = Curry._3(func, v1, v2, v3); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task3); - }), task2); - }), task1); -} - -function map4(func, task1, task2, task3, task4) { - return andThen((function (v1) { - return andThen((function (v2) { - return andThen((function (v3) { - return andThen((function (v4) { - var value = Curry._4(func, v1, v2, v3, v4); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task4); - }), task3); - }), task2); - }), task1); -} - -function map5(func, task1, task2, task3, task4, task5) { - return andThen((function (v1) { - return andThen((function (v2) { - return andThen((function (v3) { - return andThen((function (v4) { - return andThen((function (v5) { - var value = Curry._5(func, v1, v2, v3, v4, v5); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task5); - }), task4); - }), task3); - }), task2); - }), task1); -} - -function map6(func, task1, task2, task3, task4, task5, task6) { - return andThen((function (v1) { - return andThen((function (v2) { - return andThen((function (v3) { - return andThen((function (v4) { - return andThen((function (v5) { - return andThen((function (v6) { - var value = Curry._6(func, v1, v2, v3, v4, v5, v6); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), task6); - }), task5); - }), task4); - }), task3); - }), task2); - }), task1); -} - -function sequence(param) { - if (param) { - return map2((function (l, r) { - return /* :: */[ - l, - r - ]; - }), param[0], sequence(param[1])); - } else { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [/* [] */0])); - })]; - } -} - -var testing_deop = { - contents: true -}; - -function testing(param) { - var doTest = function (expected, param) { - return Curry._1(param[0], (function (v) { - if (Caml_obj.caml_equal(v, expected)) { - console.log(/* tuple */[ - "Passed:", - expected, - v - ]); - return /* () */0; - } else { - console.log(/* tuple */[ - "FAILED:", - expected, - v - ]); - return /* () */0; - } - })); - }; - var s = /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [42])); - })]; - doTest(/* Ok */Block.__(0, [42]), s); - var f = /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [86])); - })]; - doTest(/* Error */Block.__(1, [86]), f); - var r = function (param) { - if (testing_deop.contents) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [42])); - })]; - } else { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [3.14])); - })]; - } - }; - var a1 = andThen((function (n) { - var value = n + 2 | 0; - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [2])); - })]); - doTest(/* Ok */Block.__(0, [4]), a1); - var a2 = andThen((function (n) { - var value = String(n); - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [2])); - })]); - doTest(/* Ok */Block.__(0, ["2"]), a2); - var m1 = map((function (prim) { - return Math.sqrt(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [9])); - })]); - doTest(/* Ok */Block.__(0, [3]), m1); - var m2 = map2((function (prim, prim$1) { - return prim + prim$1 | 0; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [9])); - })], /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [3])); - })]); - doTest(/* Ok */Block.__(0, [12]), m2); - var m3 = map((function (prim) { - return String(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [9])); - })]); - doTest(/* Ok */Block.__(0, ["9"]), m3); - var s0 = sequence(/* :: */[ - /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [1])); - })], - /* :: */[ - /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [2])); - })], - /* [] */0 - ] - ]); - doTest(/* Ok */Block.__(0, [/* :: */[ - 1, - /* :: */[ - 2, - /* [] */0 - ] - ]]), s0); - var s1 = sequence(/* :: */[ - /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [1])); - })], - /* :: */[ - /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [2.7])); - })], - /* :: */[ - r(/* () */0), - /* [] */0 - ] - ] - ]); - doTest(/* Error */Block.__(1, [2.7]), s1); - var e0 = onError((function (_msg) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [42])); - })]; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, ["file not found"])); - })]); - doTest(/* Ok */Block.__(0, [42]), e0); - var e1 = onError((function (_msg) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [42])); - })]; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, ["file not found"])); - })]); - doTest(/* Error */Block.__(1, [42]), e1); - var n0 = sequence(/* :: */[ - mapError((function (prim) { - return String(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [42])); - })]), - /* :: */[ - mapError((function (prim) { - return prim.toString(); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [3.14])); - })]), - /* [] */0 - ] - ]); - doTest(/* Error */Block.__(1, ["42"]), n0); - var n1 = sequence(/* :: */[ - mapError((function (prim) { - return String(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [1])); - })]), - /* :: */[ - mapError((function (prim) { - return prim.toString(); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [3.14])); - })]), - /* [] */0 - ] - ]); - doTest(/* Error */Block.__(1, ["3.14"]), n1); - var n2 = sequence(/* :: */[ - mapError((function (prim) { - return String(prim); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [1])); - })]), - /* :: */[ - mapError((function (prim) { - return prim.toString(); - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [2])); - })]), - /* [] */0 - ] - ]); - doTest(/* Ok */Block.__(0, [/* :: */[ - 1, - /* :: */[ - 2, - /* [] */0 - ] - ]]), n2); - perform((function (param) { - return 42; - }), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [18])); - })]); - var value = 42; - doTest(/* Ok */Block.__(0, [42]), /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [value])); - })]); - var value$1 = "failure"; - doTest(/* Error */Block.__(1, ["failure"]), /* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, [value$1])); - })]); - doTest(/* Ok */Block.__(0, [undefined]), toOption(/* Task */[(function (cb) { - return Curry._1(cb, /* Error */Block.__(1, ["for some reason"])); - })])); - doTest(/* Ok */Block.__(0, [42]), toOption(/* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, [42])); - })])); - return /* () */0; -} - -exports.nothing = nothing; -exports.performOpt = performOpt; -exports.perform = perform; -exports.attemptOpt = attemptOpt; -exports.attempt = attempt; -exports.ignore = ignore; -exports.succeed = succeed; -exports.fail = fail; -exports.nativeBinding = nativeBinding; -exports.andThen = andThen; -exports.onError = onError; -exports.fromResult = fromResult; -exports.mapError = mapError; -exports.toOption = toOption; -exports.map = map; -exports.map2 = map2; -exports.map3 = map3; -exports.map4 = map4; -exports.map5 = map5; -exports.map6 = map6; -exports.sequence = sequence; -exports.testing_deop = testing_deop; -exports.testing = testing; -/* No side effect */ - -},{"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_builtin_exceptions.js":40,"bs-platform/lib/js/caml_obj.js":49,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/curry.js":58}],14:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var $$String = require("bs-platform/lib/js/string.js"); -var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); -var Web_node = require("./web_node.js"); -var Caml_array = require("bs-platform/lib/js/caml_array.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Web_document = require("./web_document.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -var noNode = /* CommentNode */Block.__(0, [""]); - -function comment(s) { - return /* CommentNode */Block.__(0, [s]); -} - -function text(s) { - return /* Text */Block.__(1, [s]); -} - -function fullnode(namespace, tagName, key, unique, props, vdoms) { - return /* Node */Block.__(2, [ - namespace, - tagName, - key, - unique, - props, - vdoms - ]); -} - -function node($staropt$star, tagName, $staropt$star$1, $staropt$star$2, props, vdoms) { - var namespace = $staropt$star !== undefined ? $staropt$star : ""; - var key = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - var unique = $staropt$star$2 !== undefined ? $staropt$star$2 : ""; - return fullnode(namespace, tagName, key, unique, props, vdoms); -} - -function lazyGen(key, fn) { - return /* LazyGen */Block.__(3, [ - key, - fn, - { - contents: noNode - } - ]); -} - -function prop(key, value) { - return /* RawProp */Block.__(0, [ - key, - value - ]); -} - -function onCB(name, key, cb) { - return /* Event */Block.__(3, [ - name, - /* EventHandlerCallback */Block.__(0, [ - key, - cb - ]), - { - contents: undefined - } - ]); -} - -function onMsg(name, msg) { - return /* Event */Block.__(3, [ - name, - /* EventHandlerMsg */Block.__(1, [msg]), - { - contents: undefined - } - ]); -} - -function attribute(namespace, key, value) { - return /* Attribute */Block.__(1, [ - namespace, - key, - value - ]); -} - -function data(key, value) { - return /* Data */Block.__(2, [ - key, - value - ]); -} - -function style(key, value) { - return /* Style */Block.__(4, [/* :: */[ - /* tuple */[ - key, - value - ], - /* [] */0 - ]]); -} - -function styles(s) { - return /* Style */Block.__(4, [s]); -} - -function renderToHtmlString(_param) { - while(true) { - var param = _param; - switch (param.tag | 0) { - case /* CommentNode */0 : - return ""); - case /* Text */1 : - return param[0]; - case /* Node */2 : - var tagName = param[1]; - var namespace = param[0]; - return $$String.concat("", /* :: */[ - "<", - /* :: */[ - namespace, - /* :: */[ - namespace === "" ? "" : ":", - /* :: */[ - tagName, - /* :: */[ - $$String.concat("", List.map((function (p) { - var param = p; - if (typeof param === "number") { - return ""; - } else { - switch (param.tag | 0) { - case /* RawProp */0 : - return $$String.concat("", /* :: */[ - " ", - /* :: */[ - param[0], - /* :: */[ - "=\"", - /* :: */[ - param[1], - /* :: */[ - "\"", - /* [] */0 - ] - ] - ] - ] - ]); - case /* Attribute */1 : - return $$String.concat("", /* :: */[ - " ", - /* :: */[ - param[1], - /* :: */[ - "=\"", - /* :: */[ - param[2], - /* :: */[ - "\"", - /* [] */0 - ] - ] - ] - ] - ]); - case /* Data */2 : - return $$String.concat("", /* :: */[ - " data-", - /* :: */[ - param[0], - /* :: */[ - "=\"", - /* :: */[ - param[1], - /* :: */[ - "\"", - /* [] */0 - ] - ] - ] - ] - ]); - case /* Event */3 : - return ""; - case /* Style */4 : - return $$String.concat("", /* :: */[ - " style=\"", - /* :: */[ - $$String.concat(";", List.map((function (param) { - return $$String.concat("", /* :: */[ - param[0], - /* :: */[ - ":", - /* :: */[ - param[1], - /* :: */[ - ";", - /* [] */0 - ] - ] - ] - ]); - }), param[0])), - /* :: */[ - "\"", - /* [] */0 - ] - ] - ]); - - } - } - }), param[4])), - /* :: */[ - ">", - /* :: */[ - $$String.concat("", List.map(renderToHtmlString, param[5])), - /* :: */[ - "", - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ] - ]); - case /* LazyGen */3 : - _param = Curry._1(param[1], /* () */0); - continue ; - case /* Tagger */4 : - _param = param[1]; - continue ; - - } - }; -} - -function emptyEventHandler(_ev) { - return /* () */0; -} - -function emptyEventCB(_ev) { - return ; -} - -function eventHandler(callbacks, cb) { - return (function (ev) { - var match = Curry._1(cb.contents, ev); - if (match !== undefined) { - return Curry._1(callbacks.contents.enqueue, Caml_option.valFromOption(match)); - } else { - return /* () */0; - } - }); -} - -function eventHandler_GetCB(param) { - if (param.tag) { - var msg = param[0]; - return (function (_ev) { - return Caml_option.some(msg); - }); - } else { - return param[1]; - } -} - -function compareEventHandlerTypes(left, param) { - if (param.tag) { - if (left.tag && Caml_obj.caml_equal(param[0], left[0])) { - return true; - } else { - return false; - } - } else if (left.tag) { - return false; - } else { - return param[0] === left[0]; - } -} - -function eventHandler_Register(callbacks, elem, name, handlerType) { - var cb = { - contents: eventHandler_GetCB(handlerType) - }; - var handler = eventHandler(callbacks, cb); - Web_node.addEventListener(elem, name, handler, false); - return { - handler: handler, - cb: cb - }; -} - -function eventHandler_Unregister(elem, name, param) { - if (param !== undefined) { - Web_node.removeEventListener(elem, name, param.handler, false); - return ; - } - -} - -function eventHandler_Mutate(callbacks, elem, oldName, newName, oldHandlerType, newHandlerType, oldCache, newCache) { - var match = oldCache.contents; - if (match !== undefined) { - if (oldName === newName) { - newCache.contents = oldCache.contents; - if (compareEventHandlerTypes(oldHandlerType, newHandlerType)) { - return /* () */0; - } else { - var cb = eventHandler_GetCB(newHandlerType); - match.cb.contents = cb; - return /* () */0; - } - } else { - oldCache.contents = eventHandler_Unregister(elem, oldName, oldCache.contents); - newCache.contents = eventHandler_Register(callbacks, elem, newName, newHandlerType); - return /* () */0; - } - } else { - newCache.contents = eventHandler_Register(callbacks, elem, newName, newHandlerType); - return /* () */0; - } -} - -function patchVNodesOnElems_PropertiesApply_Add(callbacks, elem, _idx, param) { - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* RawProp */0 : - elem[param[0]] = param[1]; - return /* () */0; - case /* Attribute */1 : - return Web_node.setAttributeNsOptional(elem, param[0], param[1], param[2]); - case /* Data */2 : - console.log(/* tuple */[ - "TODO: Add Data Unhandled", - param[0], - param[1] - ]); - throw [ - Caml_builtin_exceptions.failure, - "TODO: Add Data Unhandled" - ]; - case /* Event */3 : - param[2].contents = eventHandler_Register(callbacks, elem, param[0], param[1]); - return /* () */0; - case /* Style */4 : - return List.fold_left((function (param, param$1) { - return Web_node.setStyleProperty(elem, undefined, param$1[0], param$1[1]); - }), /* () */0, param[0]); - - } - } -} - -function patchVNodesOnElems_PropertiesApply_Remove(_callbacks, elem, _idx, param) { - if (typeof param === "number") { - return /* () */0; - } else { - switch (param.tag | 0) { - case /* RawProp */0 : - elem[param[0]] = undefined; - return /* () */0; - case /* Attribute */1 : - return Web_node.removeAttributeNsOptional(elem, param[0], param[1]); - case /* Data */2 : - console.log(/* tuple */[ - "TODO: Remove Data Unhandled", - param[0], - param[1] - ]); - throw [ - Caml_builtin_exceptions.failure, - "TODO: Remove Data Unhandled" - ]; - case /* Event */3 : - var cache = param[2]; - cache.contents = eventHandler_Unregister(elem, param[0], cache.contents); - return /* () */0; - case /* Style */4 : - return List.fold_left((function (param, param$1) { - return Web_node.setStyleProperty(elem, undefined, param$1[0], null); - }), /* () */0, param[0]); - - } - } -} - -function patchVNodesOnElems_PropertiesApply_RemoveAdd(callbacks, elem, idx, oldProp, newProp) { - patchVNodesOnElems_PropertiesApply_Remove(callbacks, elem, idx, oldProp); - patchVNodesOnElems_PropertiesApply_Add(callbacks, elem, idx, newProp); - return /* () */0; -} - -function patchVNodesOnElems_PropertiesApply_Mutate(_callbacks, elem, _idx, oldProp, _newProp) { - if (typeof _newProp === "number") { - throw [ - Caml_builtin_exceptions.failure, - "This should never be called as all entries through NoProp are gated." - ]; - } else { - switch (_newProp.tag | 0) { - case /* RawProp */0 : - elem[_newProp[0]] = _newProp[1]; - return /* () */0; - case /* Attribute */1 : - return Web_node.setAttributeNsOptional(elem, _newProp[0], _newProp[1], _newProp[2]); - case /* Data */2 : - console.log(/* tuple */[ - "TODO: Mutate Data Unhandled", - _newProp[0], - _newProp[1] - ]); - throw [ - Caml_builtin_exceptions.failure, - "TODO: Mutate Data Unhandled" - ]; - case /* Event */3 : - throw [ - Caml_builtin_exceptions.failure, - "This will never be called because it is gated" - ]; - case /* Style */4 : - if (typeof oldProp === "number") { - throw [ - Caml_builtin_exceptions.failure, - "Passed a non-Style to a new Style as a Mutations while the old Style is not actually a style!" - ]; - } else if (oldProp.tag === /* Style */4) { - return List.fold_left2((function (param, param$1, param$2) { - var nv = param$2[1]; - var nk = param$2[0]; - var ok = param$1[0]; - if (ok === nk) { - if (param$1[1] === nv) { - return /* () */0; - } else { - return Web_node.setStyleProperty(elem, undefined, nk, nv); - } - } else { - Web_node.setStyleProperty(elem, undefined, ok, null); - return Web_node.setStyleProperty(elem, undefined, nk, nv); - } - }), /* () */0, oldProp[0], _newProp[0]); - } else { - throw [ - Caml_builtin_exceptions.failure, - "Passed a non-Style to a new Style as a Mutations while the old Style is not actually a style!" - ]; - } - - } - } -} - -function patchVNodesOnElems_PropertiesApply(callbacks, elem, _idx, _oldProperties, _newProperties) { - while(true) { - var newProperties = _newProperties; - var oldProperties = _oldProperties; - var idx = _idx; - if (oldProperties) { - var _oldProp = oldProperties[0]; - if (newProperties) { - if (typeof _oldProp === "number") { - if (typeof newProperties[0] === "number") { - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - - } else { - switch (_oldProp.tag | 0) { - case /* RawProp */0 : - var newProp = newProperties[0]; - if (typeof newProp !== "number" && !newProp.tag) { - if (!(_oldProp[0] === newProp[0] && _oldProp[1] === newProp[1])) { - patchVNodesOnElems_PropertiesApply_Mutate(callbacks, elem, idx, _oldProp, newProp); - } - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - case /* Attribute */1 : - var newProp$1 = newProperties[0]; - if (typeof newProp$1 !== "number" && newProp$1.tag === /* Attribute */1) { - if (!(_oldProp[0] === newProp$1[0] && _oldProp[1] === newProp$1[1] && _oldProp[2] === newProp$1[2])) { - patchVNodesOnElems_PropertiesApply_Mutate(callbacks, elem, idx, _oldProp, newProp$1); - } - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - case /* Data */2 : - var newProp$2 = newProperties[0]; - if (typeof newProp$2 !== "number" && newProp$2.tag === /* Data */2) { - if (!(_oldProp[0] === newProp$2[0] && _oldProp[1] === newProp$2[1])) { - patchVNodesOnElems_PropertiesApply_Mutate(callbacks, elem, idx, _oldProp, newProp$2); - } - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - case /* Event */3 : - var _newProp = newProperties[0]; - if (typeof _newProp !== "number" && _newProp.tag === /* Event */3) { - eventHandler_Mutate(callbacks, elem, _oldProp[0], _newProp[0], _oldProp[1], _newProp[1], _oldProp[2], _newProp[2]); - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - case /* Style */4 : - var newProp$3 = newProperties[0]; - if (typeof newProp$3 !== "number" && newProp$3.tag === /* Style */4) { - if (!Caml_obj.caml_equal(_oldProp[0], newProp$3[0])) { - patchVNodesOnElems_PropertiesApply_Mutate(callbacks, elem, idx, _oldProp, newProp$3); - } - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } - break; - - } - } - } else { - return false; - } - patchVNodesOnElems_PropertiesApply_RemoveAdd(callbacks, elem, idx, _oldProp, newProperties[0]); - _newProperties = newProperties[1]; - _oldProperties = oldProperties[1]; - _idx = idx + 1 | 0; - continue ; - } else if (newProperties) { - return false; - } else { - return true; - } - }; -} - -function patchVNodesOnElems_Properties(callbacks, elem, oldProperties, newProperties) { - return patchVNodesOnElems_PropertiesApply(callbacks, elem, 0, oldProperties, newProperties); -} - -function genEmptyProps(length) { - var _lst = /* [] */0; - var _len = length; - while(true) { - var len = _len; - var lst = _lst; - if (len !== 0) { - _len = len - 1 | 0; - _lst = /* :: */[ - /* NoProp */0, - lst - ]; - continue ; - } else { - return lst; - } - }; -} - -function mapEmptyProps(props) { - return List.map((function (param) { - return /* NoProp */0; - }), props); -} - -function patchVNodesOnElems_ReplaceNode(callbacks, elem, elems, idx, param) { - if (param.tag === /* Node */2) { - var newProperties = param[4]; - var oldChild = Caml_array.caml_array_get(elems, idx); - var newChild = Web_document.createElementNsOptional(param[0], param[1]); - var match = patchVNodesOnElems_Properties(callbacks, newChild, List.map((function (param) { - return /* NoProp */0; - }), newProperties), newProperties); - if (match) { - var childChildren = newChild.childNodes; - patchVNodesOnElems(callbacks, newChild, childChildren, 0, /* [] */0, param[5]); - Web_node.insertBefore(elem, newChild, oldChild); - elem.removeChild(oldChild); - return /* () */0; - } else { - throw [ - Caml_builtin_exceptions.match_failure, - /* tuple */[ - "vdom.ml", - 343, - 13 - ] - ]; - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "Node replacement should never be passed anything but a node itself" - ]; - } -} - -function patchVNodesOnElems_CreateElement(_callbacks, _param) { - while(true) { - var param = _param; - var callbacks = _callbacks; - switch (param.tag | 0) { - case /* CommentNode */0 : - var text = param[0]; - return document.createComment(text); - case /* Text */1 : - var text$1 = param[0]; - return document.createTextNode(text$1); - case /* Node */2 : - var newProperties = param[4]; - var newChild = Web_document.createElementNsOptional(param[0], param[1]); - var match = patchVNodesOnElems_Properties(callbacks, newChild, List.map((function (param) { - return /* NoProp */0; - }), newProperties), newProperties); - if (match) { - var childChildren = newChild.childNodes; - patchVNodesOnElems(callbacks, newChild, childChildren, 0, /* [] */0, param[5]); - return newChild; - } else { - throw [ - Caml_builtin_exceptions.match_failure, - /* tuple */[ - "vdom.ml", - 368, - 11 - ] - ]; - } - case /* LazyGen */3 : - var vdom = Curry._1(param[1], /* () */0); - param[2].contents = vdom; - _param = vdom; - continue ; - case /* Tagger */4 : - _param = param[1]; - _callbacks = Curry._1(param[0], callbacks); - continue ; - - } - }; -} - -function patchVNodesOnElems_MutateNode(callbacks, elem, elems, idx, oldNode, newNode) { - if (oldNode.tag === /* Node */2) { - if (newNode.tag === /* Node */2) { - if (oldNode[3] !== newNode[3] || oldNode[1] !== newNode[1]) { - return patchVNodesOnElems_ReplaceNode(callbacks, elem, elems, idx, newNode); - } else { - var child = Caml_array.caml_array_get(elems, idx); - var childChildren = child.childNodes; - if (!patchVNodesOnElems_Properties(callbacks, child, oldNode[4], newNode[4])) { - console.log("VDom: Failed swapping properties because the property list length changed, use `noProp` to swap properties instead, not by altering the list structure. This is a massive inefficiency until this issue is resolved."); - patchVNodesOnElems_ReplaceNode(callbacks, elem, elems, idx, newNode); - } - return patchVNodesOnElems(callbacks, child, childChildren, 0, oldNode[5], newNode[5]); - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "Non-node passed to patchVNodesOnElems_MutateNode" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "Non-node passed to patchVNodesOnElems_MutateNode" - ]; - } -} - -function patchVNodesOnElems(callbacks, elem, elems, _idx, _oldVNodes, _newVNodes) { - while(true) { - var newVNodes = _newVNodes; - var oldVNodes = _oldVNodes; - var idx = _idx; - if (oldVNodes) { - var oldNode = oldVNodes[0]; - switch (oldNode.tag | 0) { - case /* CommentNode */0 : - if (newVNodes) { - var match = newVNodes[0]; - if (!match.tag && oldNode[0] === match[0]) { - _newVNodes = newVNodes[1]; - _oldVNodes = oldVNodes[1]; - _idx = idx + 1 | 0; - continue ; - } - - } - break; - case /* Text */1 : - if (newVNodes) { - var match$1 = newVNodes[0]; - if (match$1.tag === /* Text */1) { - var newText = match$1[0]; - if (oldNode[0] !== newText) { - var child = Caml_array.caml_array_get(elems, idx); - child.nodeValue = newText; - } - _newVNodes = newVNodes[1]; - _oldVNodes = oldVNodes[1]; - _idx = idx + 1 | 0; - continue ; - } - - } - break; - case /* Node */2 : - if (newVNodes) { - var newNode = newVNodes[0]; - if (newNode.tag === /* Node */2) { - var newRest = newVNodes[1]; - var newKey = newNode[2]; - var newTagName = newNode[1]; - var newNamespace = newNode[0]; - var oldRest = oldVNodes[1]; - var oldKey = oldNode[2]; - var oldTagName = oldNode[1]; - var oldNamespace = oldNode[0]; - if (oldKey === newKey && oldKey !== "") { - _newVNodes = newRest; - _oldVNodes = oldRest; - _idx = idx + 1 | 0; - continue ; - } else if (oldKey === "" || newKey === "") { - patchVNodesOnElems_MutateNode(callbacks, elem, elems, idx, oldNode, newNode); - _newVNodes = newRest; - _oldVNodes = oldRest; - _idx = idx + 1 | 0; - continue ; - } else { - var exit = 0; - var exit$1 = 0; - if (oldRest) { - var match$2 = oldRest[0]; - if (match$2.tag === /* Node */2) { - var olderRest = oldRest[1]; - var olderKey = match$2[2]; - var olderTagName = match$2[1]; - var olderNamespace = match$2[0]; - var exit$2 = 0; - if (newRest) { - var match$3 = newRest[0]; - if (match$3.tag === /* Node */2 && olderNamespace === newNamespace && olderTagName === newTagName && olderKey === newKey && oldNamespace === match$3[0] && oldTagName === match$3[1] && oldKey === match$3[2]) { - var firstChild = Caml_array.caml_array_get(elems, idx); - var secondChild = Caml_array.caml_array_get(elems, idx + 1 | 0); - elem.removeChild(secondChild); - Web_node.insertBefore(elem, secondChild, firstChild); - _newVNodes = newRest[1]; - _oldVNodes = olderRest; - _idx = idx + 2 | 0; - continue ; - } else { - exit$2 = 4; - } - } else { - exit$2 = 4; - } - if (exit$2 === 4) { - if (olderNamespace === newNamespace && olderTagName === newTagName && olderKey === newKey) { - var oldChild = Caml_array.caml_array_get(elems, idx); - elem.removeChild(oldChild); - _newVNodes = newRest; - _oldVNodes = olderRest; - _idx = idx + 1 | 0; - continue ; - } else { - exit$1 = 3; - } - } - - } else { - exit$1 = 3; - } - } else { - exit$1 = 3; - } - if (exit$1 === 3) { - if (newRest) { - var match$4 = newRest[0]; - if (match$4.tag === /* Node */2 && oldNamespace === match$4[0] && oldTagName === match$4[1] && oldKey === match$4[2]) { - var oldChild$1 = Caml_array.caml_array_get(elems, idx); - var newChild = patchVNodesOnElems_CreateElement(callbacks, newNode); - Web_node.insertBefore(elem, newChild, oldChild$1); - _newVNodes = newRest; - _idx = idx + 1 | 0; - continue ; - } else { - exit = 2; - } - } else { - exit = 2; - } - } - if (exit === 2) { - patchVNodesOnElems_MutateNode(callbacks, elem, elems, idx, oldNode, newNode); - _newVNodes = newRest; - _oldVNodes = oldRest; - _idx = idx + 1 | 0; - continue ; - } - - } - } - - } - break; - case /* LazyGen */3 : - if (newVNodes) { - var match$5 = newVNodes[0]; - if (match$5.tag === /* LazyGen */3) { - var newRest$1 = newVNodes[1]; - var newCache = match$5[2]; - var newGen = match$5[1]; - var newKey$1 = match$5[0]; - var oldRest$1 = oldVNodes[1]; - var oldCache = oldNode[2]; - var oldKey$1 = oldNode[0]; - if (oldKey$1 === newKey$1) { - newCache.contents = oldCache.contents; - _newVNodes = newRest$1; - _oldVNodes = oldRest$1; - _idx = idx + 1 | 0; - continue ; - } else { - var exit$3 = 0; - var exit$4 = 0; - if (oldRest$1) { - var match$6 = oldRest$1[0]; - if (match$6.tag === /* LazyGen */3) { - var olderRest$1 = oldRest$1[1]; - var olderKey$1 = match$6[0]; - var exit$5 = 0; - if (newRest$1) { - var match$7 = newRest$1[0]; - if (match$7.tag === /* LazyGen */3 && olderKey$1 === newKey$1 && oldKey$1 === match$7[0]) { - var firstChild$1 = Caml_array.caml_array_get(elems, idx); - var secondChild$1 = Caml_array.caml_array_get(elems, idx + 1 | 0); - elem.removeChild(secondChild$1); - Web_node.insertBefore(elem, secondChild$1, firstChild$1); - _newVNodes = newRest$1[1]; - _oldVNodes = olderRest$1; - _idx = idx + 2 | 0; - continue ; - } else { - exit$5 = 4; - } - } else { - exit$5 = 4; - } - if (exit$5 === 4) { - if (olderKey$1 === newKey$1) { - var oldChild$2 = Caml_array.caml_array_get(elems, idx); - elem.removeChild(oldChild$2); - var oldVdom = match$6[2].contents; - newCache.contents = oldVdom; - _newVNodes = newRest$1; - _oldVNodes = olderRest$1; - _idx = idx + 1 | 0; - continue ; - } else { - exit$4 = 3; - } - } - - } else { - exit$4 = 3; - } - } else { - exit$4 = 3; - } - if (exit$4 === 3) { - if (newRest$1) { - var match$8 = newRest$1[0]; - if (match$8.tag === /* LazyGen */3 && match$8[0] === oldKey$1) { - var oldChild$3 = Caml_array.caml_array_get(elems, idx); - var newVdom = Curry._1(newGen, /* () */0); - newCache.contents = newVdom; - var newChild$1 = patchVNodesOnElems_CreateElement(callbacks, newVdom); - Web_node.insertBefore(elem, newChild$1, oldChild$3); - _newVNodes = newRest$1; - _idx = idx + 1 | 0; - continue ; - } else { - exit$3 = 2; - } - } else { - exit$3 = 2; - } - } - if (exit$3 === 2) { - var oldVdom$1 = oldCache.contents; - var newVdom$1 = Curry._1(newGen, /* () */0); - newCache.contents = newVdom$1; - _newVNodes = /* :: */[ - newVdom$1, - newRest$1 - ]; - _oldVNodes = /* :: */[ - oldVdom$1, - oldRest$1 - ]; - continue ; - } - - } - } - - } - break; - case /* Tagger */4 : - _oldVNodes = /* :: */[ - oldNode[1], - oldVNodes[1] - ]; - continue ; - - } - var oldRest$2 = oldVNodes[1]; - if (newVNodes) { - var newNode$1 = newVNodes[0]; - if (newNode$1.tag === /* Tagger */4) { - patchVNodesOnElems(Curry._1(newNode$1[0], callbacks), elem, elems, idx, /* :: */[ - oldNode, - /* [] */0 - ], /* :: */[ - newNode$1[1], - /* [] */0 - ]); - _newVNodes = newVNodes[1]; - _oldVNodes = oldRest$2; - _idx = idx + 1 | 0; - continue ; - } else { - var oldChild$4 = Caml_array.caml_array_get(elems, idx); - var newChild$2 = patchVNodesOnElems_CreateElement(callbacks, newNode$1); - Web_node.insertBefore(elem, newChild$2, oldChild$4); - elem.removeChild(oldChild$4); - _newVNodes = newVNodes[1]; - _oldVNodes = oldRest$2; - _idx = idx + 1 | 0; - continue ; - } - } else { - var child$1 = Caml_array.caml_array_get(elems, idx); - elem.removeChild(child$1); - _newVNodes = /* [] */0; - _oldVNodes = oldRest$2; - continue ; - } - } else if (newVNodes) { - var newChild$3 = patchVNodesOnElems_CreateElement(callbacks, newVNodes[0]); - elem.appendChild(newChild$3); - _newVNodes = newVNodes[1]; - _oldVNodes = /* [] */0; - _idx = idx + 1 | 0; - continue ; - } else { - return /* () */0; - } - }; -} - -function patchVNodesIntoElement(callbacks, elem, oldVNodes, newVNodes) { - var elems = elem.childNodes; - patchVNodesOnElems(callbacks, elem, elems, 0, oldVNodes, newVNodes); - return newVNodes; -} - -function patchVNodeIntoElement(callbacks, elem, oldVNode, newVNode) { - return patchVNodesIntoElement(callbacks, elem, /* :: */[ - oldVNode, - /* [] */0 - ], /* :: */[ - newVNode, - /* [] */0 - ]); -} - -function wrapCallbacks_On(func, param) { - if (typeof param === "number") { - return /* Render */0; - } else if (param.tag) { - return /* RemoveRenderMsg */Block.__(1, [Curry._1(func, param[0])]); - } else { - return /* AddRenderMsg */Block.__(0, [Curry._1(func, param[0])]); - } -} - -function wrapCallbacks(func, callbacks) { - return { - contents: { - enqueue: (function (msg) { - return Curry._1(callbacks.contents.enqueue, Curry._1(func, msg)); - }), - on: (function (smsg) { - return Curry._1(callbacks.contents.on, wrapCallbacks_On(func, smsg)); - }) - } - }; -} - -function map(func, vdom) { - var tagger = function (param) { - return wrapCallbacks(func, param); - }; - return /* Tagger */Block.__(4, [ - tagger, - vdom - ]); -} - -var noProp = /* NoProp */0; - -exports.noNode = noNode; -exports.comment = comment; -exports.text = text; -exports.fullnode = fullnode; -exports.node = node; -exports.lazyGen = lazyGen; -exports.noProp = noProp; -exports.prop = prop; -exports.onCB = onCB; -exports.onMsg = onMsg; -exports.attribute = attribute; -exports.data = data; -exports.style = style; -exports.styles = styles; -exports.renderToHtmlString = renderToHtmlString; -exports.emptyEventHandler = emptyEventHandler; -exports.emptyEventCB = emptyEventCB; -exports.eventHandler = eventHandler; -exports.eventHandler_GetCB = eventHandler_GetCB; -exports.compareEventHandlerTypes = compareEventHandlerTypes; -exports.eventHandler_Register = eventHandler_Register; -exports.eventHandler_Unregister = eventHandler_Unregister; -exports.eventHandler_Mutate = eventHandler_Mutate; -exports.patchVNodesOnElems_PropertiesApply_Add = patchVNodesOnElems_PropertiesApply_Add; -exports.patchVNodesOnElems_PropertiesApply_Remove = patchVNodesOnElems_PropertiesApply_Remove; -exports.patchVNodesOnElems_PropertiesApply_RemoveAdd = patchVNodesOnElems_PropertiesApply_RemoveAdd; -exports.patchVNodesOnElems_PropertiesApply_Mutate = patchVNodesOnElems_PropertiesApply_Mutate; -exports.patchVNodesOnElems_PropertiesApply = patchVNodesOnElems_PropertiesApply; -exports.patchVNodesOnElems_Properties = patchVNodesOnElems_Properties; -exports.genEmptyProps = genEmptyProps; -exports.mapEmptyProps = mapEmptyProps; -exports.patchVNodesOnElems_ReplaceNode = patchVNodesOnElems_ReplaceNode; -exports.patchVNodesOnElems_CreateElement = patchVNodesOnElems_CreateElement; -exports.patchVNodesOnElems_MutateNode = patchVNodesOnElems_MutateNode; -exports.patchVNodesOnElems = patchVNodesOnElems; -exports.patchVNodesIntoElement = patchVNodesIntoElement; -exports.patchVNodeIntoElement = patchVNodeIntoElement; -exports.wrapCallbacks_On = wrapCallbacks_On; -exports.wrapCallbacks = wrapCallbacks; -exports.map = map; -/* No side effect */ - -},{"./web_document.js":16,"./web_node.js":20,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_array.js":39,"bs-platform/lib/js/caml_builtin_exceptions.js":40,"bs-platform/lib/js/caml_obj.js":49,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61,"bs-platform/lib/js/string.js":64}],15:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Web_node = require("./web_node.js"); -var Web_window = require("./web_window.js"); - -function polyfills(param) { - Web_node.remove_polyfill(/* () */0); - Web_window.requestAnimationFrame_polyfill(/* () */0); - return /* () */0; -} - -var $$Event = /* alias */0; - -var $$Node = /* alias */0; - -var $$Document = /* alias */0; - -var $$Date = /* alias */0; - -var $$Window = /* alias */0; - -var $$Location = /* alias */0; - -var Json = /* alias */0; - -var $$XMLHttpRequest = /* alias */0; - -var $$FormData = /* alias */0; - -exports.$$Event = $$Event; -exports.$$Node = $$Node; -exports.$$Document = $$Document; -exports.$$Date = $$Date; -exports.$$Window = $$Window; -exports.$$Location = $$Location; -exports.Json = Json; -exports.$$XMLHttpRequest = $$XMLHttpRequest; -exports.$$FormData = $$FormData; -exports.polyfills = polyfills; -/* No side effect */ - -},{"./web_node.js":20,"./web_window.js":21}],16:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function body(param) { - return document.body; -} - -function createElement(typ) { - return document.createElement(typ); -} - -function createElementNS(namespace, key) { - return document.createElementNS(namespace, key); -} - -function createComment(text) { - return document.createComment(text); -} - -function createTextNode(text) { - return document.createTextNode(text); -} - -function getElementById(id) { - return document.getElementById(id); -} - -function createElementNsOptional(namespace, tagName) { - if (namespace === "") { - return document.createElement(tagName); - } else { - return document.createElementNS(namespace, tagName); - } -} - -function $$location(param) { - return document.location; -} - -exports.body = body; -exports.createElement = createElement; -exports.createElementNS = createElementNS; -exports.createComment = createComment; -exports.createTextNode = createTextNode; -exports.getElementById = getElementById; -exports.createElementNsOptional = createElementNsOptional; -exports.$$location = $$location; -/* No side effect */ - -},{}],17:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function append(key, value, f) { - return f.append(key, value); -} - -exports.append = append; -/* No side effect */ - -},{}],18:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Js_json = require("bs-platform/lib/js/js_json.js"); - -function string_of_json($staropt$star, value) { - var indent = $staropt$star !== undefined ? $staropt$star : 2; - if (value !== undefined) { - try { - return JSON.stringify(value, null, indent); - } - catch (exn){ - return ""; - } - } else { - return "undefined"; - } -} - -function of_type(_v, x) { - return x; -} - -var classify = Js_json.classify; - -var test = Js_json.test; - -var decodeString = Js_json.decodeString; - -var decodeNumber = Js_json.decodeNumber; - -var decodeObject = Js_json.decodeObject; - -var decodeArray = Js_json.decodeArray; - -var decodeBoolean = Js_json.decodeBoolean; - -var decodeNull = Js_json.decodeNull; - -var $$null = null; - -exports.classify = classify; -exports.test = test; -exports.decodeString = decodeString; -exports.decodeNumber = decodeNumber; -exports.decodeObject = decodeObject; -exports.decodeArray = decodeArray; -exports.decodeBoolean = decodeBoolean; -exports.decodeNull = decodeNull; -exports.string_of_json = string_of_json; -exports.of_type = of_type; -exports.$$null = $$null; -/* No side effect */ - -},{"bs-platform/lib/js/js_json.js":60}],19:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function getHref($$location) { - return $$location.href; -} - -function setHref($$location, value) { - $$location.href = value; - return /* () */0; -} - -function getProtocol($$location) { - return $$location.protocol; -} - -function setProtocol($$location, value) { - $$location.protocol = value; - return /* () */0; -} - -function getHost($$location) { - return $$location.host; -} - -function setHost($$location, value) { - $$location.host = value; - return /* () */0; -} - -function getHostname($$location) { - return $$location.hostname; -} - -function setHostname($$location, value) { - $$location.hostname = value; - return /* () */0; -} - -function getPort($$location) { - return $$location.port; -} - -function setPort($$location, value) { - $$location.port = value; - return /* () */0; -} - -function getPathname($$location) { - return $$location.pathname; -} - -function setPathname($$location, value) { - $$location.pathname = value; - return /* () */0; -} - -function getSearch($$location) { - return $$location.search; -} - -function setSearch($$location, value) { - $$location.search = value; - return /* () */0; -} - -function getHash($$location) { - return $$location.hash; -} - -function setHash($$location, value) { - $$location.hash = value; - return /* () */0; -} - -function getUsername($$location) { - return $$location.username; -} - -function setUsername($$location, value) { - $$location.username = value; - return /* () */0; -} - -function getPassword($$location) { - return $$location.password; -} - -function setPassword($$location, value) { - $$location.password = value; - return /* () */0; -} - -function getOrigin($$location) { - return $$location.origin; -} - -function asRecord($$location) { - return { - href: $$location.href, - protocol: $$location.protocol, - host: $$location.host, - hostname: $$location.hostname, - port: $$location.port, - pathname: $$location.pathname, - search: $$location.search, - hash: $$location.hash, - username: $$location.username, - password: $$location.password, - origin: $$location.origin - }; -} - -exports.getHref = getHref; -exports.setHref = setHref; -exports.getProtocol = getProtocol; -exports.setProtocol = setProtocol; -exports.getHost = getHost; -exports.setHost = setHost; -exports.getHostname = getHostname; -exports.setHostname = setHostname; -exports.getPort = getPort; -exports.setPort = setPort; -exports.getPathname = getPathname; -exports.setPathname = setPathname; -exports.getSearch = getSearch; -exports.setSearch = setSearch; -exports.getHash = getHash; -exports.setHash = setHash; -exports.getUsername = getUsername; -exports.setUsername = setUsername; -exports.getPassword = getPassword; -exports.setPassword = setPassword; -exports.getOrigin = getOrigin; -exports.asRecord = asRecord; -/* No side effect */ - -},{}],20:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function style(n) { - return n.style; -} - -function getStyle(n, key) { - return n.style[key]; -} - -function setStyle(n, key, value) { - n.style[key] = value; - return /* () */0; -} - -function setStyleProperty(n, $staropt$star, key, value) { - var priority = $staropt$star !== undefined ? $staropt$star : false; - var style = n.style; - var match = style.setProperty; - if (match !== undefined) { - return style.setProperty(key, value, priority ? "important" : null); - } else { - return setStyle(n, key, value); - } -} - -function childNodes(n) { - return n.childNodes; -} - -function firstChild(n) { - return n.firstChild; -} - -function appendChild(n, child) { - return n.appendChild(child); -} - -function removeChild(n, child) { - return n.removeChild(child); -} - -function insertBefore(n, child, refNode) { - return n.insertBefore(child, refNode); -} - -function remove(n, child) { - return n.remove(child); -} - -function setAttributeNS(n, namespace, key, value) { - return n.setAttributeNS(namespace, key, value); -} - -function setAttribute(n, key, value) { - return n.setAttribute(key, value); -} - -function setAttributeNsOptional(n, namespace, key, value) { - if (namespace === "") { - return n.setAttribute(key, value); - } else { - return n.setAttributeNS(namespace, key, value); - } -} - -function removeAttributeNS(n, namespace, key) { - return n.removeAttributeNS(namespace, key); -} - -function removeAttribute(n, key) { - return n.removeAttribute(key); -} - -function removeAttributeNsOptional(n, namespace, key) { - if (namespace === "") { - return n.removeAttribute(key); - } else { - return n.removeAttributeNS(namespace, key); - } -} - -function addEventListener(n, typ, listener, options) { - return n.addEventListener(typ, listener, options); -} - -function removeEventListener(n, typ, listener, options) { - return n.removeEventListener(typ, listener, options); -} - -function focus(n) { - return n.focus(); -} - -function set_nodeValue(n, text) { - n.nodeValue = text; - return /* () */0; -} - -function get_nodeValue(n) { - return n.nodeValue; -} - -function remove_polyfill(param) { - return (// remove polyfill - (function() { - if (!('remove' in Element.prototype)) { - Element.prototype.remove = function() { - if (this.parentNode) { - this.parentNode.removeChild(this); - } - }; - }; - }())); -} - -exports.style = style; -exports.getStyle = getStyle; -exports.setStyle = setStyle; -exports.setStyleProperty = setStyleProperty; -exports.childNodes = childNodes; -exports.firstChild = firstChild; -exports.appendChild = appendChild; -exports.removeChild = removeChild; -exports.insertBefore = insertBefore; -exports.remove = remove; -exports.setAttributeNS = setAttributeNS; -exports.setAttribute = setAttribute; -exports.setAttributeNsOptional = setAttributeNsOptional; -exports.removeAttributeNS = removeAttributeNS; -exports.removeAttribute = removeAttribute; -exports.removeAttributeNsOptional = removeAttributeNsOptional; -exports.addEventListener = addEventListener; -exports.removeEventListener = removeEventListener; -exports.focus = focus; -exports.set_nodeValue = set_nodeValue; -exports.get_nodeValue = get_nodeValue; -exports.remove_polyfill = remove_polyfill; -/* No side effect */ - -},{}],21:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function history(param) { - return window.history; -} - -function localStorage(param) { - return window.localStorage; -} - -function $$location(param) { - return window.location; -} - -function requestAnimationFrame(callback) { - return window.requestAnimationFrame(callback); -} - -function cancelAnimationFrame(id) { - return window.cancelAnimationFrame(id); -} - -function $$clearTimeout(id) { - return window.clearTimeout(id); -} - -function $$setInterval(cb, msTime) { - return window.setInterval(cb, msTime); -} - -function $$setTimeout(cb, msTime) { - return window.setTimeout(cb, msTime); -} - -function addEventListener(typ, listener, options) { - return window.addEventListener(typ, listener, options); -} - -function removeEventListener(typ, listener, options) { - return window.removeEventListener(typ, listener, options); -} - -function requestAnimationFrame_polyfill(param) { - return (// requestAnimationFrame polyfill - (function() { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] - || window[vendors[x]+'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - - if (!window.cancelAnimationFrame) - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - }())); -} - -var $$History = /* alias */0; - -var LocalStorage = /* alias */0; - -exports.$$History = $$History; -exports.LocalStorage = LocalStorage; -exports.history = history; -exports.localStorage = localStorage; -exports.$$location = $$location; -exports.requestAnimationFrame = requestAnimationFrame; -exports.cancelAnimationFrame = cancelAnimationFrame; -exports.$$clearTimeout = $$clearTimeout; -exports.$$setInterval = $$setInterval; -exports.$$setTimeout = $$setTimeout; -exports.addEventListener = addEventListener; -exports.removeEventListener = removeEventListener; -exports.requestAnimationFrame_polyfill = requestAnimationFrame_polyfill; -/* No side effect */ - -},{}],22:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -function length($$window) { - var match = $$window.history; - if (match !== undefined) { - return match.length; - } else { - return -1; - } -} - -function back($$window) { - var match = $$window.history; - if (match !== undefined) { - return match.back; - } else { - return /* () */0; - } -} - -function forward($$window) { - var match = $$window.history; - if (match !== undefined) { - return match.forward; - } else { - return /* () */0; - } -} - -function go($$window, to$prime) { - var match = $$window.history; - if (match !== undefined) { - return match.go(to$prime); - } else { - return /* () */0; - } -} - -function pushState($$window, state, title, url) { - var match = $$window.history; - if (match !== undefined) { - return match.pushState(state, title, url); - } else { - return /* () */0; - } -} - -function replaceState($$window, state, title, url) { - var match = $$window.history; - if (match !== undefined) { - return match.replaceState(state, title, url); - } else { - return /* () */0; - } -} - -function state($$window) { - var match = $$window.history; - if (match !== undefined) { - return match.state; - } - -} - -exports.length = length; -exports.back = back; -exports.forward = forward; -exports.go = go; -exports.pushState = pushState; -exports.replaceState = replaceState; -exports.state = state; -/* No side effect */ - -},{}],23:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function length($$window) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.length); - } - -} - -function clear($$window) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.clear()); - } - -} - -function key($$window, idx) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.key(idx)); - } - -} - -function getItem($$window, key) { - var match = $$window.localStorage; - if (match !== undefined) { - try { - return Caml_option.some(match.getItem(key)); - } - catch (exn){ - return ; - } - } - -} - -function removeItem($$window, key) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.removeItem(key)); - } - -} - -function setItem($$window, key, value) { - var match = $$window.localStorage; - if (match !== undefined) { - return Caml_option.some(match.setItem(key, value)); - } - -} - -exports.length = length; -exports.clear = clear; -exports.key = key; -exports.getItem = getItem; -exports.removeItem = removeItem; -exports.setItem = setItem; -/* No side effect */ - -},{"bs-platform/lib/js/caml_option.js":50}],24:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var $$Array = require("bs-platform/lib/js/array.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); -var Web_formdata = require("./web_formdata.js"); -var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); -var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); - -function abort(x) { - return x.abort(); -} - -function getAllResponseHeaders(x) { - var match = x.getAllResponseHeaders(); - if (match !== null) { - if (match === "") { - return /* Error */Block.__(1, [/* NetworkError */1]); - } else { - return /* Ok */Block.__(0, [match]); - } - } else { - return /* Error */Block.__(1, [/* IncompleteResponse */0]); - } -} - -function getAllResponseHeadersAsList(x) { - var err = getAllResponseHeaders(x); - if (err.tag) { - return err; - } else { - return /* Ok */Block.__(0, [List.map((function (param) { - if (param.length !== 2) { - throw [ - Caml_builtin_exceptions.failure, - "Cannot happen, already checked length" - ]; - } - var key = param[0]; - var value = param[1]; - return /* tuple */[ - key, - value - ]; - }), List.filter((function (a) { - return a.length === 2; - }))($$Array.to_list($$Array.map((function (param) { - return param.split(": ", 2); - }), err[0].split("\r\n")))))]); - } -} - -function getAllResponseHeadersAsDict(x) { - var height = function (param) { - if (param) { - return param[/* h */4]; - } else { - return 0; - } - }; - var create = function (l, x, d, r) { - var hl = height(l); - var hr = height(r); - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - }; - var singleton = function (x, d) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */d, - /* r : Empty */0, - /* h */1 - ]; - }; - var bal = function (l, x, d, r) { - var hl = l ? l[/* h */4] : 0; - var hr = r ? r[/* h */4] : 0; - if (hl > (hr + 2 | 0)) { - if (l) { - var lr = l[/* r */3]; - var ld = l[/* d */2]; - var lv = l[/* v */1]; - var ll = l[/* l */0]; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } else if (lr) { - return create(create(ll, lv, ld, lr[/* l */0]), lr[/* v */1], lr[/* d */2], create(lr[/* r */3], x, d, r)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else if (hr > (hl + 2 | 0)) { - if (r) { - var rr = r[/* r */3]; - var rd = r[/* d */2]; - var rv = r[/* v */1]; - var rl = r[/* l */0]; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } else if (rl) { - return create(create(l, x, d, rl[/* l */0]), rl[/* v */1], rl[/* d */2], create(rl[/* r */3], rv, rd, rr)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.bal" - ]; - } - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */d, - /* r */r, - /* h */hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - ]; - } - }; - var add = function (x, data, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = add(x, data, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */data, - /* r : Empty */0, - /* h */1 - ]; - } - }; - var min_binding = function (_param) { - while(true) { - var param = _param; - if (param) { - var l = param[/* l */0]; - if (l) { - _param = l; - continue ; - } else { - return /* tuple */[ - param[/* v */1], - param[/* d */2] - ]; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; - }; - var remove_min_binding = function (param) { - if (param) { - var l = param[/* l */0]; - if (l) { - return bal(remove_min_binding(l), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return param[/* r */3]; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Map.remove_min_elt" - ]; - } - }; - var merge = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var remove = function (x, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return merge(l, r); - } else if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = remove(x, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - return /* Empty */0; - } - }; - var update = function (x, f, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - var match = Curry._1(f, Caml_option.some(d)); - if (match !== undefined) { - var data = Caml_option.valFromOption(match); - if (d === data) { - return m; - } else { - return /* Node */[ - /* l */l, - /* v */x, - /* d */data, - /* r */r, - /* h */m[/* h */4] - ]; - } - } else { - return merge(l, r); - } - } else if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return m; - } else { - return bal(ll, v, d, r); - } - } else { - var rr = update(x, f, r); - if (r === rr) { - return m; - } else { - return bal(l, v, d, rr); - } - } - } else { - var match$1 = Curry._1(f, undefined); - if (match$1 !== undefined) { - return /* Node */[ - /* l : Empty */0, - /* v */x, - /* d */Caml_option.valFromOption(match$1), - /* r : Empty */0, - /* h */1 - ]; - } else { - return /* Empty */0; - } - } - }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (param) { - iter(f, param[/* l */0]); - Curry._2(f, param[/* v */1], param[/* d */2]); - _param = param[/* r */3]; - continue ; - } else { - return /* () */0; - } - }; - }; - var map = function (f, param) { - if (param) { - var l$prime = map(f, param[/* l */0]); - var d$prime = Curry._1(f, param[/* d */2]); - var r$prime = map(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */param[/* v */1], - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var mapi = function (f, param) { - if (param) { - var v = param[/* v */1]; - var l$prime = mapi(f, param[/* l */0]); - var d$prime = Curry._2(f, v, param[/* d */2]); - var r$prime = mapi(f, param[/* r */3]); - return /* Node */[ - /* l */l$prime, - /* v */v, - /* d */d$prime, - /* r */r$prime, - /* h */param[/* h */4] - ]; - } else { - return /* Empty */0; - } - }; - var fold = function (f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (m) { - _accu = Curry._3(f, m[/* v */1], m[/* d */2], fold(f, m[/* l */0], accu)); - _m = m[/* r */3]; - continue ; - } else { - return accu; - } - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) && for_all(p, param[/* l */0])) { - _param = param[/* r */3]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; - }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._2(p, param[/* v */1], param[/* d */2]) || exists(p, param[/* l */0])) { - return true; - } else { - _param = param[/* r */3]; - continue ; - } - } else { - return false; - } - }; - }; - var add_min_binding = function (k, x, param) { - if (param) { - return bal(add_min_binding(k, x, param[/* l */0]), param[/* v */1], param[/* d */2], param[/* r */3]); - } else { - return singleton(k, x); - } - }; - var add_max_binding = function (k, x, param) { - if (param) { - return bal(param[/* l */0], param[/* v */1], param[/* d */2], add_max_binding(k, x, param[/* r */3])); - } else { - return singleton(k, x); - } - }; - var join = function (l, v, d, r) { - if (l) { - if (r) { - var rh = r[/* h */4]; - var lh = l[/* h */4]; - if (lh > (rh + 2 | 0)) { - return bal(l[/* l */0], l[/* v */1], l[/* d */2], join(l[/* r */3], v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r[/* l */0]), r[/* v */1], r[/* d */2], r[/* r */3]); - } else { - return create(l, v, d, r); - } - } else { - return add_max_binding(v, d, l); - } - } else { - return add_min_binding(v, d, r); - } - }; - var concat = function (t1, t2) { - if (t1) { - if (t2) { - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - } else { - return t1; - } - } else { - return t2; - } - }; - var concat_or_join = function (t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); - } - }; - var split = function (x, param) { - if (param) { - var r = param[/* r */3]; - var d = param[/* d */2]; - var v = param[/* v */1]; - var l = param[/* l */0]; - var c = Caml_primitive.caml_string_compare(x, v); - if (c === 0) { - return /* tuple */[ - l, - Caml_option.some(d), - r - ]; - } else if (c < 0) { - var match = split(x, l); - return /* tuple */[ - match[0], - match[1], - join(match[2], v, d, r) - ]; - } else { - var match$1 = split(x, r); - return /* tuple */[ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - undefined, - /* Empty */0 - ]; - } - }; - var merge$1 = function (f, s1, s2) { - if (s1) { - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1[/* l */0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[/* d */2]), match[1]), merge$1(f, s1[/* r */3], match[2])); - } - - } else if (!s2) { - return /* Empty */0; - } - if (s2) { - var v2 = s2[/* v */1]; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2[/* l */0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[/* d */2])), merge$1(f, match$1[2], s2[/* r */3])); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "map.ml", - 393, - 10 - ] - ]; - } - }; - var union = function (f, s1, s2) { - if (s1) { - if (s2) { - var d2 = s2[/* d */2]; - var v2 = s2[/* v */1]; - var d1 = s1[/* d */2]; - var v1 = s1[/* v */1]; - if (s1[/* h */4] >= s2[/* h */4]) { - var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1[/* l */0], match[0]); - var r = union(f, s1[/* r */3], match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } - } else { - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2[/* l */0]); - var r$1 = union(f, match$1[2], s2[/* r */3]); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); - } else { - return join(l$1, v2, d2, r$1); - } - } - } else { - return s1; - } - } else { - return s2; - } - }; - var filter = function (p, m) { - if (m) { - var r = m[/* r */3]; - var d = m[/* d */2]; - var v = m[/* v */1]; - var l = m[/* l */0]; - var l$prime = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$prime = filter(p, r); - if (pvd) { - if (l === l$prime && r === r$prime) { - return m; - } else { - return join(l$prime, v, d, r$prime); - } - } else { - return concat(l$prime, r$prime); - } - } else { - return /* Empty */0; - } - }; - var partition = function (p, param) { - if (param) { - var d = param[/* d */2]; - var v = param[/* v */1]; - var match = partition(p, param[/* l */0]); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param[/* r */3]); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return /* tuple */[ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return /* tuple */[ - concat(lt, rt), - join(lf, v, d, rf) - ]; - } - } else { - return /* tuple */[ - /* Empty */0, - /* Empty */0 - ]; - } - }; - var cardinal = function (param) { - if (param) { - return (cardinal(param[/* l */0]) + 1 | 0) + cardinal(param[/* r */3]) | 0; - } else { - return 0; - } - }; - var bindings_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[/* l */0]; - _accu = /* :: */[ - /* tuple */[ - param[/* v */1], - param[/* d */2] - ], - bindings_aux(accu, param[/* r */3]) - ]; - continue ; - } else { - return accu; - } - }; - }; - var err = getAllResponseHeadersAsList(x); - if (err.tag) { - return err; - } else { - var insert = function (d, param) { - return add(param[0], param[1], d); - }; - return /* Ok */Block.__(0, [List.fold_left(insert, /* Empty */0, err[0])]); - } -} - -function getResponseHeader(key, x) { - return Caml_option.null_to_opt(x.getResponse(key)); -} - -function open_(method$prime, url, $staropt$star, $staropt$star$1, $staropt$star$2, x) { - var async = $staropt$star !== undefined ? $staropt$star : true; - var user = $staropt$star$1 !== undefined ? $staropt$star$1 : ""; - var password = $staropt$star$2 !== undefined ? $staropt$star$2 : ""; - return x.open(method$prime, url, async, user, password); -} - -function overrideMimeType(mimetype, x) { - return x.overrideMimeType(mimetype); -} - -function send(body, x) { - if (typeof body === "number") { - if (body === /* EmptyBody */0) { - return x.send(); - } else { - return x.send(null); - } - } else { - switch (body.tag | 0) { - case /* FormListBody */2 : - var form = List.fold_left((function (f, param) { - Web_formdata.append(param[0], param[1], f); - return f; - }), new FormData(), body[0]); - return x.send(form); - case /* StringBody */0 : - case /* FormDataBody */1 : - case /* DocumentBody */3 : - return x.send(body[0]); - - } - } -} - -function setRequestHeader(header, value, x) { - return x.setRequestHeader(header, value); -} - -function set_onreadystatechange(cb, x) { - x.onreadystatechange = cb; - return /* () */0; -} - -function get_onreadystatechange(x) { - return x.onreadystatechange; -} - -function readyState(x) { - var i = x.readyState; - if (i > 4 || i < 0) { - var s = "Invalid return from 'readystate' of: " + String(i); - throw [ - Caml_builtin_exceptions.failure, - s - ]; - } else { - return i; - } -} - -function set_responseType(typ, x) { - if (typeof typ === "number") { - switch (typ) { - case /* StringResponseType */0 : - x.responseType = ""; - return /* () */0; - case /* ArrayBufferResponseType */1 : - x.responseType = "arraybuffer"; - return /* () */0; - case /* BlobResponseType */2 : - x.responseType = "blob"; - return /* () */0; - case /* DocumentResponseType */3 : - x.responseType = "document"; - return /* () */0; - case /* JsonResponseType */4 : - x.responseType = "json"; - return /* () */0; - case /* TextResponseType */5 : - x.responseType = "text"; - return /* () */0; - - } - } else { - x.responseType = typ[0]; - return /* () */0; - } -} - -function get_responseType(x) { - var s = x.responseType; - switch (s) { - case "" : - return /* StringResponseType */0; - case "arraybuffer" : - return /* ArrayBufferResponseType */1; - case "blob" : - return /* BlobResponseType */2; - case "document" : - return /* DocumentResponseType */3; - case "json" : - return /* JsonResponseType */4; - case "text" : - return /* TextResponseType */5; - default: - return /* RawResponseType */[s]; - } -} - -function get_response(x) { - var match = x.response; - if (match !== null) { - var match$1 = get_responseType(x); - if (typeof match$1 === "number") { - switch (match$1) { - case /* StringResponseType */0 : - return /* StringResponse */Block.__(0, [match]); - case /* ArrayBufferResponseType */1 : - return /* ArrayBufferResponse */Block.__(1, [match]); - case /* BlobResponseType */2 : - return /* BlobResponse */Block.__(2, [match]); - case /* DocumentResponseType */3 : - return /* DocumentResponse */Block.__(3, [match]); - case /* JsonResponseType */4 : - return /* JsonResponse */Block.__(4, [match]); - case /* TextResponseType */5 : - return /* TextResponse */Block.__(5, [match]); - - } - } else { - return /* RawResponse */Block.__(6, [ - match$1[0], - match - ]); - } - } else { - return /* NoResponse */0; - } -} - -function get_responseText(x) { - return x.responseText; -} - -function get_responseURL(x) { - return x.responseURL; -} - -function get_responseXML(x) { - return Caml_option.null_to_opt(x.responseXML); -} - -function get_status(x) { - return x.status; -} - -function get_statusText(x) { - return x.statusText; -} - -function set_timeout(t, x) { - x.timeout = t; - return /* () */0; -} - -function get_timeout(x) { - return x.timeout; -} - -function set_withCredentials(b, x) { - x.withCredentials = b; - return /* () */0; -} - -function get_withCredentials(x) { - return x.withCredentials; -} - -function set_onabort(cb, x) { - x.onabort = cb; - return /* () */0; -} - -function get_onabort(x) { - return x.onabort; -} - -function set_onerror(cb, x) { - x.onerror = cb; - return /* () */0; -} - -function get_onerror(x) { - return x.onerror; -} - -function set_onload(cb, x) { - x.onload = cb; - return /* () */0; -} - -function get_onload(x) { - return x.onload; -} - -function set_onloadstart(cb, x) { - x.onloadstart = cb; - return /* () */0; -} - -function get_onloadstart(x) { - return x.onloadstart; -} - -function set_onprogress(cb, x) { - x.onprogress = cb; - return /* () */0; -} - -function get_onprogress(x) { - return x.onprogress; -} - -function set_ontimeout(cb, x) { - x.ontimeout = cb; - return /* () */0; -} - -function get_ontimeout(x) { - return x.ontimeout; -} - -function set_onloadend(cb, x) { - x.onloadend = cb; - return /* () */0; -} - -function get_onloadend(x) { - return x.onloadend; -} - -exports.abort = abort; -exports.getAllResponseHeaders = getAllResponseHeaders; -exports.getAllResponseHeadersAsList = getAllResponseHeadersAsList; -exports.getAllResponseHeadersAsDict = getAllResponseHeadersAsDict; -exports.getResponseHeader = getResponseHeader; -exports.open_ = open_; -exports.overrideMimeType = overrideMimeType; -exports.send = send; -exports.setRequestHeader = setRequestHeader; -exports.set_onreadystatechange = set_onreadystatechange; -exports.get_onreadystatechange = get_onreadystatechange; -exports.readyState = readyState; -exports.set_responseType = set_responseType; -exports.get_responseType = get_responseType; -exports.get_response = get_response; -exports.get_responseText = get_responseText; -exports.get_responseURL = get_responseURL; -exports.get_responseXML = get_responseXML; -exports.get_status = get_status; -exports.get_statusText = get_statusText; -exports.set_timeout = set_timeout; -exports.get_timeout = get_timeout; -exports.set_withCredentials = set_withCredentials; -exports.get_withCredentials = get_withCredentials; -exports.set_onabort = set_onabort; -exports.get_onabort = get_onabort; -exports.set_onerror = set_onerror; -exports.get_onerror = get_onerror; -exports.set_onload = set_onload; -exports.get_onload = get_onload; -exports.set_onloadstart = set_onloadstart; -exports.get_onloadstart = get_onloadstart; -exports.set_onprogress = set_onprogress; -exports.get_onprogress = get_onprogress; -exports.set_ontimeout = set_ontimeout; -exports.get_ontimeout = get_ontimeout; -exports.set_onloadend = set_onloadend; -exports.get_onloadend = get_onloadend; -/* No side effect */ - -},{"./web_formdata.js":17,"bs-platform/lib/js/array.js":35,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_builtin_exceptions.js":40,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/caml_primitive.js":51,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61}],25:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Test_client_drag = require("./test_client_drag.js"); -var Test_client_counter = require("./test_client_counter.js"); -var Test_client_http_task = require("./test_client_http_task.js"); -var Test_client_btn_update_span = require("./test_client_btn_update_span.js"); -var Test_client_on_with_options = require("./test_client_on_with_options.js"); -var Test_client_attribute_removal = require("./test_client_attribute_removal.js"); -var Test_client_counter_debug_program = require("./test_client_counter_debug_program.js"); -var Test_client_counter_debug_beginner = require("./test_client_counter_debug_beginner.js"); -var Test_client_counter_debug_standard = require("./test_client_counter_debug_standard.js"); - -var counter = Test_client_counter.main; - -var counter_debug_beginner = Test_client_counter_debug_beginner.main; - -var counter_debug_standard = Test_client_counter_debug_standard.main; - -var counter_debug_program = Test_client_counter_debug_program.main; - -var btn_update_span = Test_client_btn_update_span.main; - -var attribute_removal = Test_client_attribute_removal.main; - -var drag = Test_client_drag.main; - -var on_with_options = Test_client_on_with_options.main; - -var http_task = Test_client_http_task.main; - -exports.counter = counter; -exports.counter_debug_beginner = counter_debug_beginner; -exports.counter_debug_standard = counter_debug_standard; -exports.counter_debug_program = counter_debug_program; -exports.btn_update_span = btn_update_span; -exports.attribute_removal = attribute_removal; -exports.drag = drag; -exports.on_with_options = on_with_options; -exports.http_task = http_task; -/* Test_client_drag Not a pure module */ - -},{"./test_client_attribute_removal.js":26,"./test_client_btn_update_span.js":27,"./test_client_counter.js":28,"./test_client_counter_debug_beginner.js":29,"./test_client_counter_debug_program.js":30,"./test_client_counter_debug_standard.js":31,"./test_client_drag.js":32,"./test_client_http_task.js":33,"./test_client_on_with_options.js":34}],26:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function select(param_0) { - return /* Select */[param_0]; -} - -function render_selected(param) { - if (param !== undefined) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - /* Text */Block.__(1, ["you selected " + param]), - /* :: */[ - Tea_html.div(undefined, undefined, /* :: */[ - Vdom.onMsg("click", /* Delete */0), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["delete selection"]), - /* [] */0 - ]), - /* [] */0 - ] - ]); - } else { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - /* Text */Block.__(1, ["Nothing selected"]), - /* [] */0 - ]); - } -} - -function lang(l, is_selected) { - var msg = /* Select */[l]; - return Tea_html.li(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* :: */[ - Vdom.style("color", "blue"), - /* :: */[ - is_selected ? Vdom.style("border", "1px solid black") : Tea_html.noProp, - /* :: */[ - is_selected ? /* Attribute */Block.__(1, [ - "", - "lang", - l - ]) : Tea_html.noProp, - /* [] */0 - ] - ] - ] - ], /* :: */[ - /* Text */Block.__(1, [l]), - /* [] */0 - ]); -} - -function render_languages(selected, languages) { - var is_selected = function (selected, language) { - if (selected !== undefined) { - return language === Caml_option.valFromOption(selected); - } else { - return false; - } - }; - var rendered = List.map((function (l) { - return lang(l, is_selected(selected, l)); - }), languages); - return Tea_html.ul(undefined, undefined, /* [] */0, rendered); -} - -function update(state, param) { - if (param) { - return { - selected: param[0], - languages: state.languages - }; - } else { - return { - selected: undefined, - languages: state.languages - }; - } -} - -function view(state) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - render_selected(state.selected), - /* :: */[ - render_languages(state.selected, state.languages), - /* [] */0 - ] - ]); -} - -var partial_arg_model = { - selected: "Erlang", - languages: /* :: */[ - "Erlang", - /* :: */[ - "Ocaml", - /* :: */[ - "Clojure", - /* [] */0 - ] - ] - ] -}; - -var partial_arg = { - model: partial_arg_model, - update: update, - view: view -}; - -function main(param, param$1) { - return Tea_app.beginnerProgram(partial_arg, param, param$1); -} - -var $$delete = /* Delete */0; - -exports.select = select; -exports.$$delete = $$delete; -exports.render_selected = render_selected; -exports.lang = lang; -exports.render_languages = render_languages; -exports.update = update; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ - -},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":14,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_option.js":50,"bs-platform/lib/js/list.js":61}],27:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); - -function update$prime(model, param) { - return /* tuple */[ - model[0], - "right" - ]; -} - -function render_model(param) { - if (param[0] !== undefined && param[1] !== undefined) { - return Tea_html.input$prime(undefined, undefined, /* :: */[ - /* RawProp */Block.__(0, [ - "value", - "This should be on screen" - ]), - /* [] */0 - ], /* [] */0); - } - return Tea_html.span(undefined, undefined, /* [] */0, /* :: */[ - /* Text */Block.__(1, ["nothing"]), - /* [] */0 - ]); -} - -function view$prime(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", /* Trigger */0), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["trigger rerender"]), - /* [] */0 - ]), - /* :: */[ - render_model(model), - /* [] */0 - ] - ]); -} - -var partial_arg_model = /* tuple */[ - "left", - undefined -]; - -var partial_arg = { - model: partial_arg_model, - update: update$prime, - view: view$prime -}; - -function main(param, param$1) { - return Tea_app.beginnerProgram(partial_arg, param, param$1); -} - -var trigger = /* Trigger */0; - -exports.trigger = trigger; -exports.update$prime = update$prime; -exports.render_model = render_model; -exports.view$prime = view$prime; -exports.main = main; -/* Tea_html Not a pure module */ - -},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":14,"bs-platform/lib/js/block.js":36}],28:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); - -function update(model, param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return model + 1 | 0; - case /* Decrement */1 : - return model - 1 | 0; - case /* Reset */2 : - return 0; - - } - } else { - return param[0]; - } -} - -function view_button(title, msg) { - return Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [title]), - /* [] */0 - ]); -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.span(undefined, undefined, /* :: */[ - Vdom.style("text-weight", "bold"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* [] */0 - ]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Increment", model >= 3 ? /* Decrement */1 : /* Increment */0), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Decrement", /* Decrement */1), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Set to 42", /* Set */[42]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - model !== 0 ? view_button("Reset", /* Reset */2) : Tea_html.noNode, - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]); -} - -var partial_arg = { - model: 4, - update: update, - view: view -}; - -function main(param, param$1) { - return Tea_app.beginnerProgram(partial_arg, param, param$1); -} - -exports.update = update; -exports.view_button = view_button; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ - -},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":14,"bs-platform/lib/js/block.js":36}],29:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_debug = require("../src-ocaml/tea_debug.js"); - -function string_of_msg(param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return "Increment"; - case /* Decrement */1 : - return "Decrement"; - case /* Reset */2 : - return "Reset"; - - } - } else { - return "Set"; - } -} - -function update(model, param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return model + 1 | 0; - case /* Decrement */1 : - return model - 1 | 0; - case /* Reset */2 : - return 0; - - } - } else { - return param[0]; - } -} - -function view_button(title, msg) { - return Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [title]), - /* [] */0 - ]); -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.span(undefined, undefined, /* :: */[ - Vdom.style("text-weight", "bold"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* [] */0 - ]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Increment", model >= 3 ? /* Decrement */1 : /* Increment */0), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Decrement", /* Decrement */1), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Set to 42", /* Set */[42]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - model !== 0 ? view_button("Reset", /* Reset */2) : Tea_html.noNode, - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]); -} - -var partial_arg = { - model: 4, - update: update, - view: view -}; - -function main(param, param$1) { - return Tea_debug.beginnerProgram(partial_arg, string_of_msg, param, param$1); -} - -exports.string_of_msg = string_of_msg; -exports.update = update; -exports.view_button = view_button; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ - -},{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":14,"bs-platform/lib/js/block.js":36}],30:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_debug = require("../src-ocaml/tea_debug.js"); - -function string_of_msg(param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return "Increment"; - case /* Decrement */1 : - return "Decrement"; - case /* Reset */2 : - return "Reset"; - - } - } else { - return "Set"; - } -} - -function init(param) { - return /* tuple */[ - 4, - /* NoCmd */0 - ]; -} - -function subscriptions(param) { - return /* NoSub */0; -} - -function update(model, param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return /* tuple */[ - model + 1 | 0, - /* NoCmd */0 - ]; - case /* Decrement */1 : - return /* tuple */[ - model - 1 | 0, - /* NoCmd */0 - ]; - case /* Reset */2 : - return /* tuple */[ - 0, - /* NoCmd */0 - ]; - - } - } else { - return /* tuple */[ - param[0], - /* NoCmd */0 - ]; - } -} - -function view_button(title, msg) { - return Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [title]), - /* [] */0 - ]); -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.span(undefined, undefined, /* :: */[ - Vdom.style("text-weight", "bold"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* [] */0 - ]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Increment", model >= 3 ? /* Decrement */1 : /* Increment */0), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Decrement", /* Decrement */1), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Set to 42", /* Set */[42]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - model !== 0 ? view_button("Reset", /* Reset */2) : Tea_html.noNode, - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]); -} - -function partial_arg_shutdown(_model) { - return /* NoCmd */0; -} - -var partial_arg = { - init: init, - update: update, - view: view, - subscriptions: subscriptions, - shutdown: partial_arg_shutdown -}; - -function main(param, param$1) { - return Tea_debug.program(partial_arg, string_of_msg, param, param$1); -} - -exports.string_of_msg = string_of_msg; -exports.init = init; -exports.subscriptions = subscriptions; -exports.update = update; -exports.view_button = view_button; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ - -},{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":14,"bs-platform/lib/js/block.js":36}],31:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_debug = require("../src-ocaml/tea_debug.js"); - -function string_of_msg(param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return "Increment"; - case /* Decrement */1 : - return "Decrement"; - case /* Reset */2 : - return "Reset"; - - } - } else { - return "Set"; - } -} - -function init(param) { - return /* tuple */[ - 4, - /* NoCmd */0 - ]; -} - -function subscriptions(param) { - return /* NoSub */0; -} - -function update(model, param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return /* tuple */[ - model + 1 | 0, - /* NoCmd */0 - ]; - case /* Decrement */1 : - return /* tuple */[ - model - 1 | 0, - /* NoCmd */0 - ]; - case /* Reset */2 : - return /* tuple */[ - 0, - /* NoCmd */0 - ]; - - } - } else { - return /* tuple */[ - param[0], - /* NoCmd */0 - ]; - } -} - -function view_button(title, msg) { - return Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [title]), - /* [] */0 - ]); -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.span(undefined, undefined, /* :: */[ - Vdom.style("text-weight", "bold"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* [] */0 - ]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Increment", model >= 3 ? /* Decrement */1 : /* Increment */0), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Decrement", /* Decrement */1), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Set to 42", /* Set */[42]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - model !== 0 ? view_button("Reset", /* Reset */2) : Tea_html.noNode, - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]); -} - -var partial_arg = { - init: init, - update: update, - view: view, - subscriptions: subscriptions -}; - -function main(param, param$1) { - return Tea_debug.standardProgram(partial_arg, string_of_msg, param, param$1); -} - -exports.string_of_msg = string_of_msg; -exports.init = init; -exports.subscriptions = subscriptions; -exports.update = update; -exports.view_button = view_button; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ - -},{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":14,"bs-platform/lib/js/block.js":36}],32:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_json = require("../src-ocaml/tea_json.js"); -var Tea_mouse = require("../src-ocaml/tea_mouse.js"); -var Tea_result = require("../src-ocaml/tea_result.js"); - -function dragStart(param_0) { - return /* DragStart */Block.__(0, [param_0]); -} - -function dragAt(param_0) { - return /* DragAt */Block.__(1, [param_0]); -} - -function dragEnd(param_0) { - return /* DragEnd */Block.__(2, [param_0]); -} - -function init(param) { - return /* tuple */[ - { - position: { - x: 200, - y: 200 - }, - drag: undefined - }, - /* NoCmd */0 - ]; -} - -function getPosition(param) { - var drag = param.drag; - var position = param.position; - if (drag !== undefined) { - var match = drag; - var current = match.current; - var start = match.start; - return { - x: (position.x + current.x | 0) - start.x | 0, - y: (position.y + current.y | 0) - start.y | 0 - }; - } else { - return position; - } -} - -function updateHelp(model, param) { - var position = model.position; - switch (param.tag | 0) { - case /* DragStart */0 : - var xy = param[0]; - return { - position: position, - drag: { - start: xy, - current: xy - } - }; - case /* DragAt */1 : - var match = model.drag; - return { - position: position, - drag: match !== undefined ? ({ - start: match.start, - current: param[0] - }) : undefined - }; - case /* DragEnd */2 : - return { - position: getPosition(model), - drag: undefined - }; - - } -} - -function update(model, msg) { - return /* tuple */[ - updateHelp(model, msg), - /* NoCmd */0 - ]; -} - -function subscriptions(model) { - var match = model.drag; - if (match !== undefined) { - return /* Batch */Block.__(0, [/* :: */[ - Tea_mouse.moves(undefined, dragAt), - /* :: */[ - Tea_mouse.ups(undefined, dragEnd), - /* [] */0 - ] - ]]); - } else { - return /* NoSub */0; - } -} - -function px(number) { - return String(number) + "px"; -} - -function cb(ev) { - return Tea_result.result_to_option(Tea_json.Decoder.decodeEvent(Tea_json.Decoder.map(dragStart, Tea_mouse.position), ev)); -} - -var onMouseDown = Vdom.onCB("mousedown", "", cb); - -function view(model) { - var realPosition = getPosition(model); - return Tea_html.div(undefined, undefined, /* :: */[ - onMouseDown, - /* :: */[ - /* Style */Block.__(4, [/* :: */[ - /* tuple */[ - "background-color", - "#3C8D2F" - ], - /* :: */[ - /* tuple */[ - "cursor", - "move" - ], - /* :: */[ - /* tuple */[ - "width", - "100px" - ], - /* :: */[ - /* tuple */[ - "height", - "100px" - ], - /* :: */[ - /* tuple */[ - "border-radius", - "4px" - ], - /* :: */[ - /* tuple */[ - "position", - "absolute" - ], - /* :: */[ - /* tuple */[ - "left", - String(realPosition.x) + "px" - ], - /* :: */[ - /* tuple */[ - "top", - String(realPosition.y) + "px" - ], - /* :: */[ - /* tuple */[ - "color", - "white" - ], - /* :: */[ - /* tuple */[ - "display", - "flex" - ], - /* :: */[ - /* tuple */[ - "align-items", - "center" - ], - /* :: */[ - /* tuple */[ - "justify-content", - "center" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ]]), - /* [] */0 - ] - ], /* :: */[ - /* Text */Block.__(1, ["Drag Me!"]), - /* [] */0 - ]); -} - -var partial_arg = { - init: init, - update: update, - view: view, - subscriptions: subscriptions -}; - -function main(param, param$1) { - return Tea_app.standardProgram(partial_arg, param, param$1); -} - -exports.dragStart = dragStart; -exports.dragAt = dragAt; -exports.dragEnd = dragEnd; -exports.init = init; -exports.getPosition = getPosition; -exports.updateHelp = updateHelp; -exports.update = update; -exports.subscriptions = subscriptions; -exports.px = px; -exports.onMouseDown = onMouseDown; -exports.view = view; -exports.main = main; -/* onMouseDown Not a pure module */ - -},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/tea_json.js":8,"../src-ocaml/tea_mouse.js":9,"../src-ocaml/tea_result.js":11,"../src-ocaml/vdom.js":14,"bs-platform/lib/js/block.js":36}],33:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_ex = require("../src-ocaml/tea_ex.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_http = require("../src-ocaml/tea_http.js"); -var Tea_task = require("../src-ocaml/tea_task.js"); -var Tea_debug = require("../src-ocaml/tea_debug.js"); - -function gotResponse(param_0) { - return /* GotResponse */[param_0]; -} - -function update(model, param) { - if (param) { - return /* tuple */[ - param[0][0], - /* NoCmd */0 - ]; - } else { - return /* tuple */[ - model, - Tea_task.attempt(gotResponse, Tea_task.andThen((function (param) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, ["both saved"])); - })]; - }), Tea_task.andThen((function (res) { - return Tea_ex.LocalStorage.setItem("todo-2", res); - }), Tea_task.andThen((function (param) { - return Tea_task.mapError(Tea_http.string_of_error, Tea_http.toTask(Tea_http.getString("https://jsonplaceholder.typicode.com/todos/2"))); - }), Tea_task.andThen((function (res) { - return Tea_ex.LocalStorage.setItem("todo-1", res); - }), Tea_task.mapError(Tea_http.string_of_error, Tea_http.toTask(Tea_http.getString("https://jsonplaceholder.typicode.com/todos/1")))))))) - ]; - } -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", /* Req */0), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["execute"]), - /* [] */0 - ]), - /* :: */[ - /* Text */Block.__(1, [model]), - /* [] */0 - ] - ]); -} - -function som(param) { - if (param) { - if (param[0].tag) { - return "GotResponse Error"; - } else { - return "GotResponse Ok"; - } - } else { - return "Req"; - } -} - -function partial_arg_init(param) { - return /* tuple */[ - "nothing", - /* NoCmd */0 - ]; -} - -function partial_arg_subscriptions(param) { - return /* NoSub */0; -} - -var partial_arg = { - init: partial_arg_init, - update: update, - view: view, - subscriptions: partial_arg_subscriptions -}; - -function main(param, param$1) { - return Tea_debug.standardProgram(partial_arg, som, param, param$1); -} - -var req = /* Req */0; - -exports.gotResponse = gotResponse; -exports.req = req; -exports.update = update; -exports.view = view; -exports.som = som; -exports.main = main; -/* Tea_html Not a pure module */ - -},{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_ex.js":4,"../src-ocaml/tea_html.js":5,"../src-ocaml/tea_http.js":7,"../src-ocaml/tea_task.js":13,"../src-ocaml/vdom.js":14,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/curry.js":58}],34:[function(require,module,exports){ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_json = require("../src-ocaml/tea_json.js"); -var Tea_html2 = require("../src-ocaml/tea_html2.js"); -var Caml_format = require("bs-platform/lib/js/caml_format.js"); - -function set_value(param_0) { - return /* Set_value */[param_0]; -} - -function update(model, param) { - if (param) { - return param[0]; - } else { - return model + 1 | 0; - } -} - -function view(model) { - var clientX = Tea_json.Decoder.field("clientX", Tea_json.Decoder.$$int); - var init = Tea_html2.Events.defaultOptions; - return Tea_html2.div(undefined, undefined, /* [] */0, List.map((function (e) { - return Tea_html2.div(undefined, undefined, /* [] */0, /* :: */[ - e, - /* [] */0 - ]); - }), /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* :: */[ - Tea_html2.button(undefined, undefined, /* :: */[ - Tea_html2.Events.onClick(/* Click */0), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["onClick"]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.button(undefined, undefined, /* :: */[ - Curry._3(Tea_html2.Events.on, "", "click", Tea_json.Decoder.succeed(/* Click */0)), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["on \"click\""]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.a(undefined, undefined, /* :: */[ - Tea_html2.Attributes.href("https://www.google.com"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["a normal link"]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.a(undefined, undefined, /* :: */[ - Tea_html2.Attributes.href("https://www.google.com"), - /* :: */[ - Curry._4(Tea_html2.Events.onWithOptions, "", "click", { - stopPropagation: init.stopPropagation, - preventDefault: true - }, Tea_json.Decoder.succeed(/* Click */0)), - /* [] */0 - ] - ], /* :: */[ - /* Text */Block.__(1, ["a link with prevent default"]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.button(undefined, undefined, /* :: */[ - Curry._3(Tea_html2.Events.on, "", "click", Tea_json.Decoder.map(set_value, clientX)), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["on \"click\", use clientX value"]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.input$prime(undefined, undefined, /* :: */[ - Tea_html2.Attributes.type$prime("text"), - /* :: */[ - Curry._3(Tea_html2.Events.on, "", "input", Tea_json.Decoder.map((function (v) { - return /* Set_value */[Caml_format.caml_int_of_string(v)]; - }), Tea_html2.Events.targetValue)), - /* [] */0 - ] - ], /* [] */0), - /* [] */0 - ] - ] - ] - ] - ] - ] - ])); -} - -var partial_arg = { - model: 0, - update: update, - view: view -}; - -function main(param, param$1) { - return Tea_app.beginnerProgram(partial_arg, param, param$1); -} - -var click = /* Click */0; - -exports.click = click; -exports.set_value = set_value; -exports.update = update; -exports.view = view; -exports.main = main; -/* Tea_html2 Not a pure module */ - -},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html2.js":6,"../src-ocaml/tea_json.js":8,"bs-platform/lib/js/block.js":36,"bs-platform/lib/js/caml_format.js":44,"bs-platform/lib/js/curry.js":58,"bs-platform/lib/js/list.js":61}],35:[function(require,module,exports){ -'use strict'; - -var Curry = require("./curry.js"); -var Caml_obj = require("./caml_obj.js"); -var Caml_array = require("./caml_array.js"); -var Caml_exceptions = require("./caml_exceptions.js"); -var Caml_js_exceptions = require("./caml_js_exceptions.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -var make_float = Caml_array.caml_make_float_vect; - -var Floatarray = { }; - -function init(l, f) { - if (l === 0) { - return []; - } else { - if (l < 0) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Array.init" - ]; - } - var res = Caml_array.caml_make_vect(l, Curry._1(f, 0)); - for(var i = 1 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - res[i] = Curry._1(f, i); - } - return res; - } -} - -function make_matrix(sx, sy, init) { - var res = Caml_array.caml_make_vect(sx, []); - for(var x = 0 ,x_finish = sx - 1 | 0; x <= x_finish; ++x){ - res[x] = Caml_array.caml_make_vect(sy, init); - } - return res; -} - -function copy(a) { - var l = a.length; - if (l === 0) { - return []; - } else { - return Caml_array.caml_array_sub(a, 0, l); - } -} - -function append(a1, a2) { - var l1 = a1.length; - if (l1 === 0) { - return copy(a2); - } else if (a2.length === 0) { - return Caml_array.caml_array_sub(a1, 0, l1); - } else { - return a1.concat(a2); - } -} - -function sub(a, ofs, len) { - if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Array.sub" - ]; - } - return Caml_array.caml_array_sub(a, ofs, len); -} - -function fill(a, ofs, len, v) { - if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Array.fill" - ]; - } - for(var i = ofs ,i_finish = (ofs + len | 0) - 1 | 0; i <= i_finish; ++i){ - a[i] = v; - } - return /* () */0; -} - -function blit(a1, ofs1, a2, ofs2, len) { - if (len < 0 || ofs1 < 0 || ofs1 > (a1.length - len | 0) || ofs2 < 0 || ofs2 > (a2.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Array.blit" - ]; - } - return Caml_array.caml_array_blit(a1, ofs1, a2, ofs2, len); -} - -function iter(f, a) { - for(var i = 0 ,i_finish = a.length - 1 | 0; i <= i_finish; ++i){ - Curry._1(f, a[i]); - } - return /* () */0; -} - -function iter2(f, a, b) { - if (a.length !== b.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Array.iter2: arrays must have the same length" - ]; - } - for(var i = 0 ,i_finish = a.length - 1 | 0; i <= i_finish; ++i){ - Curry._2(f, a[i], b[i]); - } - return /* () */0; -} - -function map(f, a) { - var l = a.length; - if (l === 0) { - return []; - } else { - var r = Caml_array.caml_make_vect(l, Curry._1(f, a[0])); - for(var i = 1 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - r[i] = Curry._1(f, a[i]); - } - return r; - } -} - -function map2(f, a, b) { - var la = a.length; - var lb = b.length; - if (la !== lb) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Array.map2: arrays must have the same length" - ]; - } - if (la === 0) { - return []; - } else { - var r = Caml_array.caml_make_vect(la, Curry._2(f, a[0], b[0])); - for(var i = 1 ,i_finish = la - 1 | 0; i <= i_finish; ++i){ - r[i] = Curry._2(f, a[i], b[i]); - } - return r; - } -} - -function iteri(f, a) { - for(var i = 0 ,i_finish = a.length - 1 | 0; i <= i_finish; ++i){ - Curry._2(f, i, a[i]); - } - return /* () */0; -} - -function mapi(f, a) { - var l = a.length; - if (l === 0) { - return []; - } else { - var r = Caml_array.caml_make_vect(l, Curry._2(f, 0, a[0])); - for(var i = 1 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - r[i] = Curry._2(f, i, a[i]); - } - return r; - } -} - -function to_list(a) { - var _i = a.length - 1 | 0; - var _res = /* [] */0; - while(true) { - var res = _res; - var i = _i; - if (i < 0) { - return res; - } else { - _res = /* :: */[ - a[i], - res - ]; - _i = i - 1 | 0; - continue ; - } - }; -} - -function list_length(_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[1]; - _accu = accu + 1 | 0; - continue ; - } else { - return accu; - } - }; -} - -function of_list(l) { - if (l) { - var a = Caml_array.caml_make_vect(list_length(0, l), l[0]); - var _i = 1; - var _param = l[1]; - while(true) { - var param = _param; - var i = _i; - if (param) { - a[i] = param[0]; - _param = param[1]; - _i = i + 1 | 0; - continue ; - } else { - return a; - } - }; - } else { - return []; - } -} - -function fold_left(f, x, a) { - var r = x; - for(var i = 0 ,i_finish = a.length - 1 | 0; i <= i_finish; ++i){ - r = Curry._2(f, r, a[i]); - } - return r; -} - -function fold_right(f, a, x) { - var r = x; - for(var i = a.length - 1 | 0; i >= 0; --i){ - r = Curry._2(f, a[i], r); - } - return r; -} - -function exists(p, a) { - var n = a.length; - var _i = 0; - while(true) { - var i = _i; - if (i === n) { - return false; - } else if (Curry._1(p, a[i])) { - return true; - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - -function for_all(p, a) { - var n = a.length; - var _i = 0; - while(true) { - var i = _i; - if (i === n) { - return true; - } else if (Curry._1(p, a[i])) { - _i = i + 1 | 0; - continue ; - } else { - return false; - } - }; -} - -function mem(x, a) { - var n = a.length; - var _i = 0; - while(true) { - var i = _i; - if (i === n) { - return false; - } else if (Caml_obj.caml_equal(a[i], x)) { - return true; - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - -function memq(x, a) { - var n = a.length; - var _i = 0; - while(true) { - var i = _i; - if (i === n) { - return false; - } else if (x === a[i]) { - return true; - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - -var Bottom = Caml_exceptions.create("Array.Bottom"); - -function sort(cmp, a) { - var maxson = function (l, i) { - var i31 = ((i + i | 0) + i | 0) + 1 | 0; - var x = i31; - if ((i31 + 2 | 0) < l) { - if (Curry._2(cmp, Caml_array.caml_array_get(a, i31), Caml_array.caml_array_get(a, i31 + 1 | 0)) < 0) { - x = i31 + 1 | 0; - } - if (Curry._2(cmp, Caml_array.caml_array_get(a, x), Caml_array.caml_array_get(a, i31 + 2 | 0)) < 0) { - x = i31 + 2 | 0; - } - return x; - } else if ((i31 + 1 | 0) < l && Curry._2(cmp, Caml_array.caml_array_get(a, i31), Caml_array.caml_array_get(a, i31 + 1 | 0)) < 0) { - return i31 + 1 | 0; - } else if (i31 < l) { - return i31; - } else { - throw [ - Bottom, - i - ]; - } - }; - var trickle = function (l, i, e) { - try { - var l$1 = l; - var _i = i; - var e$1 = e; - while(true) { - var i$1 = _i; - var j = maxson(l$1, i$1); - if (Curry._2(cmp, Caml_array.caml_array_get(a, j), e$1) > 0) { - Caml_array.caml_array_set(a, i$1, Caml_array.caml_array_get(a, j)); - _i = j; - continue ; - } else { - return Caml_array.caml_array_set(a, i$1, e$1); - } - }; - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === Bottom) { - return Caml_array.caml_array_set(a, exn[1], e); - } else { - throw exn; - } - } - }; - var bubble = function (l, i) { - try { - var l$1 = l; - var _i = i; - while(true) { - var i$1 = _i; - var j = maxson(l$1, i$1); - Caml_array.caml_array_set(a, i$1, Caml_array.caml_array_get(a, j)); - _i = j; - continue ; - }; - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === Bottom) { - return exn[1]; - } else { - throw exn; - } - } - }; - var trickleup = function (_i, e) { - while(true) { - var i = _i; - var father = (i - 1 | 0) / 3 | 0; - if (i === father) { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "array.ml", - 238, - 4 - ] - ]; - } - if (Curry._2(cmp, Caml_array.caml_array_get(a, father), e) < 0) { - Caml_array.caml_array_set(a, i, Caml_array.caml_array_get(a, father)); - if (father > 0) { - _i = father; - continue ; - } else { - return Caml_array.caml_array_set(a, 0, e); - } - } else { - return Caml_array.caml_array_set(a, i, e); - } - }; - }; - var l = a.length; - for(var i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i){ - trickle(l, i, Caml_array.caml_array_get(a, i)); - } - for(var i$1 = l - 1 | 0; i$1 >= 2; --i$1){ - var e = Caml_array.caml_array_get(a, i$1); - Caml_array.caml_array_set(a, i$1, Caml_array.caml_array_get(a, 0)); - trickleup(bubble(i$1, 0), e); - } - if (l > 1) { - var e$1 = Caml_array.caml_array_get(a, 1); - Caml_array.caml_array_set(a, 1, Caml_array.caml_array_get(a, 0)); - return Caml_array.caml_array_set(a, 0, e$1); - } else { - return 0; - } -} - -function stable_sort(cmp, a) { - var merge = function (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { - var src1r = src1ofs + src1len | 0; - var src2r = src2ofs + src2len | 0; - var _i1 = src1ofs; - var _s1 = Caml_array.caml_array_get(a, src1ofs); - var _i2 = src2ofs; - var _s2 = Caml_array.caml_array_get(src2, src2ofs); - var _d = dstofs; - while(true) { - var d = _d; - var s2 = _s2; - var i2 = _i2; - var s1 = _s1; - var i1 = _i1; - if (Curry._2(cmp, s1, s2) <= 0) { - Caml_array.caml_array_set(dst, d, s1); - var i1$1 = i1 + 1 | 0; - if (i1$1 < src1r) { - _d = d + 1 | 0; - _s1 = Caml_array.caml_array_get(a, i1$1); - _i1 = i1$1; - continue ; - } else { - return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0); - } - } else { - Caml_array.caml_array_set(dst, d, s2); - var i2$1 = i2 + 1 | 0; - if (i2$1 < src2r) { - _d = d + 1 | 0; - _s2 = Caml_array.caml_array_get(src2, i2$1); - _i2 = i2$1; - continue ; - } else { - return blit(a, i1, dst, d + 1 | 0, src1r - i1 | 0); - } - } - }; - }; - var isortto = function (srcofs, dst, dstofs, len) { - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - var e = Caml_array.caml_array_get(a, srcofs + i | 0); - var j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && Curry._2(cmp, Caml_array.caml_array_get(dst, j), e) > 0) { - Caml_array.caml_array_set(dst, j + 1 | 0, Caml_array.caml_array_get(dst, j)); - j = j - 1 | 0; - }; - Caml_array.caml_array_set(dst, j + 1 | 0, e); - } - return /* () */0; - }; - var sortto = function (srcofs, dst, dstofs, len) { - if (len <= 5) { - return isortto(srcofs, dst, dstofs, len); - } else { - var l1 = len / 2 | 0; - var l2 = len - l1 | 0; - sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2); - sortto(srcofs, a, srcofs + l2 | 0, l1); - return merge(srcofs + l2 | 0, l1, dst, dstofs + l1 | 0, l2, dst, dstofs); - } - }; - var l = a.length; - if (l <= 5) { - return isortto(0, a, 0, l); - } else { - var l1 = l / 2 | 0; - var l2 = l - l1 | 0; - var t = Caml_array.caml_make_vect(l2, Caml_array.caml_array_get(a, 0)); - sortto(l1, t, 0, l2); - sortto(0, a, l2, l1); - return merge(l2, l1, t, 0, l2, a, 0); - } -} - -var create_matrix = make_matrix; - -var concat = Caml_array.caml_array_concat; - -var fast_sort = stable_sort; - -exports.make_float = make_float; -exports.init = init; -exports.make_matrix = make_matrix; -exports.create_matrix = create_matrix; -exports.append = append; -exports.concat = concat; -exports.sub = sub; -exports.copy = copy; -exports.fill = fill; -exports.blit = blit; -exports.to_list = to_list; -exports.of_list = of_list; -exports.iter = iter; -exports.iteri = iteri; -exports.map = map; -exports.mapi = mapi; -exports.fold_left = fold_left; -exports.fold_right = fold_right; -exports.iter2 = iter2; -exports.map2 = map2; -exports.for_all = for_all; -exports.exists = exists; -exports.mem = mem; -exports.memq = memq; -exports.sort = sort; -exports.stable_sort = stable_sort; -exports.fast_sort = fast_sort; -exports.Floatarray = Floatarray; -/* No side effect */ - -},{"./caml_array.js":39,"./caml_builtin_exceptions.js":40,"./caml_exceptions.js":42,"./caml_js_exceptions.js":48,"./caml_obj.js":49,"./curry.js":58}],36:[function(require,module,exports){ -'use strict'; - - -function __(tag, block) { - block.tag = tag; - return block; -} - -exports.__ = __; -/* No side effect */ - -},{}],37:[function(require,module,exports){ -'use strict'; - -var Bytes = require("./bytes.js"); -var Curry = require("./curry.js"); -var $$String = require("./string.js"); -var Caml_bytes = require("./caml_bytes.js"); -var Pervasives = require("./pervasives.js"); -var Caml_string = require("./caml_string.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function create(n) { - var n$1 = n < 1 ? 1 : n; - var s = Caml_bytes.caml_create_bytes(n$1); - return { - buffer: s, - position: 0, - length: n$1, - initial_buffer: s - }; -} - -function contents(b) { - return Bytes.sub_string(b.buffer, 0, b.position); -} - -function to_bytes(b) { - return Bytes.sub(b.buffer, 0, b.position); -} - -function sub(b, ofs, len) { - if (ofs < 0 || len < 0 || ofs > (b.position - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Buffer.sub" - ]; - } - return Bytes.sub_string(b.buffer, ofs, len); -} - -function blit(src, srcoff, dst, dstoff, len) { - if (len < 0 || srcoff < 0 || srcoff > (src.position - len | 0) || dstoff < 0 || dstoff > (dst.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Buffer.blit" - ]; - } - return Caml_bytes.caml_blit_bytes(src.buffer, srcoff, dst, dstoff, len); -} - -function nth(b, ofs) { - if (ofs < 0 || ofs >= b.position) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Buffer.nth" - ]; - } - return b.buffer[ofs]; -} - -function length(b) { - return b.position; -} - -function clear(b) { - b.position = 0; - return /* () */0; -} - -function reset(b) { - b.position = 0; - b.buffer = b.initial_buffer; - b.length = b.buffer.length; - return /* () */0; -} - -function resize(b, more) { - var len = b.length; - var new_len = len; - while((b.position + more | 0) > new_len) { - new_len = (new_len << 1); - }; - var new_buffer = Caml_bytes.caml_create_bytes(new_len); - Bytes.blit(b.buffer, 0, new_buffer, 0, b.position); - b.buffer = new_buffer; - b.length = new_len; - return /* () */0; -} - -function add_char(b, c) { - var pos = b.position; - if (pos >= b.length) { - resize(b, 1); - } - b.buffer[pos] = c; - b.position = pos + 1 | 0; - return /* () */0; -} - -function add_utf_8_uchar(b, u) { - var u$1 = u; - if (u$1 < 0) { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "buffer.ml", - 90, - 19 - ] - ]; - } - if (u$1 <= 127) { - return add_char(b, u$1); - } else if (u$1 <= 2047) { - var pos = b.position; - if ((pos + 2 | 0) > b.length) { - resize(b, 2); - } - b.buffer[pos] = 192 | (u$1 >>> 6); - b.buffer[pos + 1 | 0] = 128 | u$1 & 63; - b.position = pos + 2 | 0; - return /* () */0; - } else if (u$1 <= 65535) { - var pos$1 = b.position; - if ((pos$1 + 3 | 0) > b.length) { - resize(b, 3); - } - b.buffer[pos$1] = 224 | (u$1 >>> 12); - b.buffer[pos$1 + 1 | 0] = 128 | (u$1 >>> 6) & 63; - b.buffer[pos$1 + 2 | 0] = 128 | u$1 & 63; - b.position = pos$1 + 3 | 0; - return /* () */0; - } else if (u$1 <= 1114111) { - var pos$2 = b.position; - if ((pos$2 + 4 | 0) > b.length) { - resize(b, 4); - } - b.buffer[pos$2] = 240 | (u$1 >>> 18); - b.buffer[pos$2 + 1 | 0] = 128 | (u$1 >>> 12) & 63; - b.buffer[pos$2 + 2 | 0] = 128 | (u$1 >>> 6) & 63; - b.buffer[pos$2 + 3 | 0] = 128 | u$1 & 63; - b.position = pos$2 + 4 | 0; - return /* () */0; - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "buffer.ml", - 123, - 8 - ] - ]; - } -} - -function add_utf_16be_uchar(b, u) { - var u$1 = u; - if (u$1 < 0) { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "buffer.ml", - 126, - 19 - ] - ]; - } - if (u$1 <= 65535) { - var pos = b.position; - if ((pos + 2 | 0) > b.length) { - resize(b, 2); - } - b.buffer[pos] = (u$1 >>> 8); - b.buffer[pos + 1 | 0] = u$1 & 255; - b.position = pos + 2 | 0; - return /* () */0; - } else if (u$1 <= 1114111) { - var u$prime = u$1 - 65536 | 0; - var hi = 55296 | (u$prime >>> 10); - var lo = 56320 | u$prime & 1023; - var pos$1 = b.position; - if ((pos$1 + 4 | 0) > b.length) { - resize(b, 4); - } - b.buffer[pos$1] = (hi >>> 8); - b.buffer[pos$1 + 1 | 0] = hi & 255; - b.buffer[pos$1 + 2 | 0] = (lo >>> 8); - b.buffer[pos$1 + 3 | 0] = lo & 255; - b.position = pos$1 + 4 | 0; - return /* () */0; - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "buffer.ml", - 144, - 8 - ] - ]; - } -} - -function add_utf_16le_uchar(b, u) { - var u$1 = u; - if (u$1 < 0) { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "buffer.ml", - 147, - 19 - ] - ]; - } - if (u$1 <= 65535) { - var pos = b.position; - if ((pos + 2 | 0) > b.length) { - resize(b, 2); - } - b.buffer[pos] = u$1 & 255; - b.buffer[pos + 1 | 0] = (u$1 >>> 8); - b.position = pos + 2 | 0; - return /* () */0; - } else if (u$1 <= 1114111) { - var u$prime = u$1 - 65536 | 0; - var hi = 55296 | (u$prime >>> 10); - var lo = 56320 | u$prime & 1023; - var pos$1 = b.position; - if ((pos$1 + 4 | 0) > b.length) { - resize(b, 4); - } - b.buffer[pos$1] = hi & 255; - b.buffer[pos$1 + 1 | 0] = (hi >>> 8); - b.buffer[pos$1 + 2 | 0] = lo & 255; - b.buffer[pos$1 + 3 | 0] = (lo >>> 8); - b.position = pos$1 + 4 | 0; - return /* () */0; - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "buffer.ml", - 165, - 8 - ] - ]; - } -} - -function add_substring(b, s, offset, len) { - if (offset < 0 || len < 0 || offset > (s.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Buffer.add_substring/add_subbytes" - ]; - } - var new_position = b.position + len | 0; - if (new_position > b.length) { - resize(b, len); - } - Bytes.blit_string(s, offset, b.buffer, b.position, len); - b.position = new_position; - return /* () */0; -} - -function add_subbytes(b, s, offset, len) { - return add_substring(b, Caml_bytes.bytes_to_string(s), offset, len); -} - -function add_string(b, s) { - var len = s.length; - var new_position = b.position + len | 0; - if (new_position > b.length) { - resize(b, len); - } - Bytes.blit_string(s, 0, b.buffer, b.position, len); - b.position = new_position; - return /* () */0; -} - -function add_bytes(b, s) { - return add_string(b, Caml_bytes.bytes_to_string(s)); -} - -function add_buffer(b, bs) { - return add_subbytes(b, bs.buffer, 0, bs.position); -} - -function add_channel(b, ic, len) { - if (len < 0) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Buffer.add_channel" - ]; - } - if ((b.position + len | 0) > b.length) { - resize(b, len); - } - var b$1 = b; - var ic$1 = ic; - var _len = len; - while(true) { - var len$1 = _len; - if (len$1 > 0) { - var n = Pervasives.input(ic$1, b$1.buffer, b$1.position, len$1); - b$1.position = b$1.position + n | 0; - if (n === 0) { - throw Caml_builtin_exceptions.end_of_file; - } - _len = len$1 - n | 0; - continue ; - } else { - return 0; - } - }; -} - -function output_buffer(oc, b) { - return Pervasives.output(oc, b.buffer, 0, b.position); -} - -function closing(param) { - if (param !== 40) { - if (param !== 123) { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "buffer.ml", - 216, - 9 - ] - ]; - } else { - return /* "}" */125; - } - } else { - return /* ")" */41; - } -} - -function advance_to_closing(opening, closing, k, s, start) { - var _k = k; - var _i = start; - var lim = s.length; - while(true) { - var i = _i; - var k$1 = _k; - if (i >= lim) { - throw Caml_builtin_exceptions.not_found; - } - if (Caml_string.get(s, i) === opening) { - _i = i + 1 | 0; - _k = k$1 + 1 | 0; - continue ; - } else if (Caml_string.get(s, i) === closing) { - if (k$1 === 0) { - return i; - } else { - _i = i + 1 | 0; - _k = k$1 - 1 | 0; - continue ; - } - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - -function advance_to_non_alpha(s, start) { - var _i = start; - var lim = s.length; - while(true) { - var i = _i; - if (i >= lim) { - return lim; - } else { - var match = Caml_string.get(s, i); - if (match >= 91) { - if (match >= 97) { - if (match >= 123) { - return i; - } - - } else if (match !== 95) { - return i; - } - - } else if (match >= 58) { - if (match < 65) { - return i; - } - - } else if (match < 48) { - return i; - } - _i = i + 1 | 0; - continue ; - } - }; -} - -function find_ident(s, start, lim) { - if (start >= lim) { - throw Caml_builtin_exceptions.not_found; - } - var c = Caml_string.get(s, start); - if (c !== 40 && c !== 123) { - var stop = advance_to_non_alpha(s, start + 1 | 0); - return /* tuple */[ - $$String.sub(s, start, stop - start | 0), - stop - ]; - } - var new_start = start + 1 | 0; - var stop$1 = advance_to_closing(c, closing(c), 0, s, new_start); - return /* tuple */[ - $$String.sub(s, new_start, (stop$1 - start | 0) - 1 | 0), - stop$1 + 1 | 0 - ]; -} - -function add_substitute(b, f, s) { - var lim = s.length; - var _previous = /* " " */32; - var _i = 0; - while(true) { - var i = _i; - var previous = _previous; - if (i < lim) { - var current = Caml_string.get(s, i); - if (current !== 36) { - if (previous === /* "\\" */92) { - add_char(b, /* "\\" */92); - add_char(b, current); - _i = i + 1 | 0; - _previous = /* " " */32; - continue ; - } else if (current !== 92) { - add_char(b, current); - _i = i + 1 | 0; - _previous = current; - continue ; - } else { - _i = i + 1 | 0; - _previous = current; - continue ; - } - } else if (previous === /* "\\" */92) { - add_char(b, current); - _i = i + 1 | 0; - _previous = /* " " */32; - continue ; - } else { - var j = i + 1 | 0; - var match = find_ident(s, j, lim); - add_string(b, Curry._1(f, match[0])); - _i = match[1]; - _previous = /* " " */32; - continue ; - } - } else if (previous === /* "\\" */92) { - return add_char(b, previous); - } else { - return 0; - } - }; -} - -function truncate(b, len) { - if (len < 0 || len > b.position) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Buffer.truncate" - ]; - } - b.position = len; - return /* () */0; -} - -exports.create = create; -exports.contents = contents; -exports.to_bytes = to_bytes; -exports.sub = sub; -exports.blit = blit; -exports.nth = nth; -exports.length = length; -exports.clear = clear; -exports.reset = reset; -exports.add_char = add_char; -exports.add_utf_8_uchar = add_utf_8_uchar; -exports.add_utf_16le_uchar = add_utf_16le_uchar; -exports.add_utf_16be_uchar = add_utf_16be_uchar; -exports.add_string = add_string; -exports.add_bytes = add_bytes; -exports.add_substring = add_substring; -exports.add_subbytes = add_subbytes; -exports.add_substitute = add_substitute; -exports.add_buffer = add_buffer; -exports.add_channel = add_channel; -exports.output_buffer = output_buffer; -exports.truncate = truncate; -/* No side effect */ - -},{"./bytes.js":38,"./caml_builtin_exceptions.js":40,"./caml_bytes.js":41,"./caml_string.js":52,"./curry.js":58,"./pervasives.js":62,"./string.js":64}],38:[function(require,module,exports){ -'use strict'; - -var Char = require("./char.js"); -var Curry = require("./curry.js"); -var Caml_bytes = require("./caml_bytes.js"); -var Caml_primitive = require("./caml_primitive.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function make(n, c) { - var s = Caml_bytes.caml_create_bytes(n); - Caml_bytes.caml_fill_bytes(s, 0, n, c); - return s; -} - -function init(n, f) { - var s = Caml_bytes.caml_create_bytes(n); - for(var i = 0 ,i_finish = n - 1 | 0; i <= i_finish; ++i){ - s[i] = Curry._1(f, i); - } - return s; -} - -var empty = []; - -function copy(s) { - var len = s.length; - var r = Caml_bytes.caml_create_bytes(len); - Caml_bytes.caml_blit_bytes(s, 0, r, 0, len); - return r; -} - -function to_string(b) { - return Caml_bytes.bytes_to_string(copy(b)); -} - -function of_string(s) { - return copy(Caml_bytes.bytes_of_string(s)); -} - -function sub(s, ofs, len) { - if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.sub / Bytes.sub" - ]; - } - var r = Caml_bytes.caml_create_bytes(len); - Caml_bytes.caml_blit_bytes(s, ofs, r, 0, len); - return r; -} - -function sub_string(b, ofs, len) { - return Caml_bytes.bytes_to_string(sub(b, ofs, len)); -} - -function $plus$plus(a, b) { - var c = a + b | 0; - var match = a < 0; - var match$1 = b < 0; - var match$2 = c < 0; - if (match) { - if (match$1 && !match$2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Bytes.extend" - ]; - } else { - return c; - } - } else if (match$1) { - return c; - } else { - if (match$2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Bytes.extend" - ]; - } - return c; - } -} - -function extend(s, left, right) { - var len = $plus$plus($plus$plus(s.length, left), right); - var r = Caml_bytes.caml_create_bytes(len); - var match = left < 0 ? /* tuple */[ - -left | 0, - 0 - ] : /* tuple */[ - 0, - left - ]; - var dstoff = match[1]; - var srcoff = match[0]; - var cpylen = Caml_primitive.caml_int_min(s.length - srcoff | 0, len - dstoff | 0); - if (cpylen > 0) { - Caml_bytes.caml_blit_bytes(s, srcoff, r, dstoff, cpylen); - } - return r; -} - -function fill(s, ofs, len, c) { - if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.fill / Bytes.fill" - ]; - } - return Caml_bytes.caml_fill_bytes(s, ofs, len, c); -} - -function blit(s1, ofs1, s2, ofs2, len) { - if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Bytes.blit" - ]; - } - return Caml_bytes.caml_blit_bytes(s1, ofs1, s2, ofs2, len); -} - -function blit_string(s1, ofs1, s2, ofs2, len) { - if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.blit / Bytes.blit_string" - ]; - } - return Caml_bytes.caml_blit_string(s1, ofs1, s2, ofs2, len); -} - -function iter(f, a) { - for(var i = 0 ,i_finish = a.length - 1 | 0; i <= i_finish; ++i){ - Curry._1(f, a[i]); - } - return /* () */0; -} - -function iteri(f, a) { - for(var i = 0 ,i_finish = a.length - 1 | 0; i <= i_finish; ++i){ - Curry._2(f, i, a[i]); - } - return /* () */0; -} - -function ensure_ge(x, y) { - if (x >= y) { - return x; - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Bytes.concat" - ]; - } -} - -function sum_lengths(_acc, seplen, _param) { - while(true) { - var param = _param; - var acc = _acc; - if (param) { - var tl = param[1]; - var hd = param[0]; - if (tl) { - _param = tl; - _acc = ensure_ge((hd.length + seplen | 0) + acc | 0, acc); - continue ; - } else { - return hd.length + acc | 0; - } - } else { - return acc; - } - }; -} - -function concat(sep, l) { - if (l) { - var seplen = sep.length; - var dst = Caml_bytes.caml_create_bytes(sum_lengths(0, seplen, l)); - var _pos = 0; - var sep$1 = sep; - var seplen$1 = seplen; - var _param = l; - while(true) { - var param = _param; - var pos = _pos; - if (param) { - var tl = param[1]; - var hd = param[0]; - if (tl) { - Caml_bytes.caml_blit_bytes(hd, 0, dst, pos, hd.length); - Caml_bytes.caml_blit_bytes(sep$1, 0, dst, pos + hd.length | 0, seplen$1); - _param = tl; - _pos = (pos + hd.length | 0) + seplen$1 | 0; - continue ; - } else { - Caml_bytes.caml_blit_bytes(hd, 0, dst, pos, hd.length); - return dst; - } - } else { - return dst; - } - }; - } else { - return empty; - } -} - -function cat(s1, s2) { - var l1 = s1.length; - var l2 = s2.length; - var r = Caml_bytes.caml_create_bytes(l1 + l2 | 0); - Caml_bytes.caml_blit_bytes(s1, 0, r, 0, l1); - Caml_bytes.caml_blit_bytes(s2, 0, r, l1, l2); - return r; -} - -function is_space(param) { - var switcher = param - 9 | 0; - if (switcher > 4 || switcher < 0) { - return switcher === 23; - } else { - return switcher !== 2; - } -} - -function trim(s) { - var len = s.length; - var i = 0; - while(i < len && is_space(s[i])) { - i = i + 1 | 0; - }; - var j = len - 1 | 0; - while(j >= i && is_space(s[j])) { - j = j - 1 | 0; - }; - if (j >= i) { - return sub(s, i, (j - i | 0) + 1 | 0); - } else { - return empty; - } -} - -function escaped(s) { - var n = 0; - for(var i = 0 ,i_finish = s.length - 1 | 0; i <= i_finish; ++i){ - var match = s[i]; - var tmp; - if (match >= 32) { - var switcher = match - 34 | 0; - tmp = switcher > 58 || switcher < 0 ? ( - switcher >= 93 ? 4 : 1 - ) : ( - switcher > 57 || switcher < 1 ? 2 : 1 - ); - } else { - tmp = match >= 11 ? ( - match !== 13 ? 4 : 2 - ) : ( - match >= 8 ? 2 : 4 - ); - } - n = n + tmp | 0; - } - if (n === s.length) { - return copy(s); - } else { - var s$prime = Caml_bytes.caml_create_bytes(n); - n = 0; - for(var i$1 = 0 ,i_finish$1 = s.length - 1 | 0; i$1 <= i_finish$1; ++i$1){ - var c = s[i$1]; - var exit = 0; - if (c >= 35) { - if (c !== 92) { - if (c >= 127) { - exit = 1; - } else { - s$prime[n] = c; - } - } else { - exit = 2; - } - } else if (c >= 32) { - if (c >= 34) { - exit = 2; - } else { - s$prime[n] = c; - } - } else if (c >= 14) { - exit = 1; - } else { - switch (c) { - case 8 : - s$prime[n] = /* "\\" */92; - n = n + 1 | 0; - s$prime[n] = /* "b" */98; - break; - case 9 : - s$prime[n] = /* "\\" */92; - n = n + 1 | 0; - s$prime[n] = /* "t" */116; - break; - case 10 : - s$prime[n] = /* "\\" */92; - n = n + 1 | 0; - s$prime[n] = /* "n" */110; - break; - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - case 11 : - case 12 : - exit = 1; - break; - case 13 : - s$prime[n] = /* "\\" */92; - n = n + 1 | 0; - s$prime[n] = /* "r" */114; - break; - - } - } - switch (exit) { - case 1 : - s$prime[n] = /* "\\" */92; - n = n + 1 | 0; - s$prime[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$prime[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$prime[n] = 48 + c % 10 | 0; - break; - case 2 : - s$prime[n] = /* "\\" */92; - n = n + 1 | 0; - s$prime[n] = c; - break; - - } - n = n + 1 | 0; - } - return s$prime; - } -} - -function map(f, s) { - var l = s.length; - if (l === 0) { - return s; - } else { - var r = Caml_bytes.caml_create_bytes(l); - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - r[i] = Curry._1(f, s[i]); - } - return r; - } -} - -function mapi(f, s) { - var l = s.length; - if (l === 0) { - return s; - } else { - var r = Caml_bytes.caml_create_bytes(l); - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - r[i] = Curry._2(f, i, s[i]); - } - return r; - } -} - -function uppercase_ascii(s) { - return map(Char.uppercase_ascii, s); -} - -function lowercase_ascii(s) { - return map(Char.lowercase_ascii, s); -} - -function apply1(f, s) { - if (s.length === 0) { - return s; - } else { - var r = copy(s); - r[0] = Curry._1(f, s[0]); - return r; - } -} - -function capitalize_ascii(s) { - return apply1(Char.uppercase_ascii, s); -} - -function uncapitalize_ascii(s) { - return apply1(Char.lowercase_ascii, s); -} - -function index_rec(s, lim, _i, c) { - while(true) { - var i = _i; - if (i >= lim) { - throw Caml_builtin_exceptions.not_found; - } - if (s[i] === c) { - return i; - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - -function index(s, c) { - return index_rec(s, s.length, 0, c); -} - -function index_rec_opt(s, lim, _i, c) { - while(true) { - var i = _i; - if (i >= lim) { - return ; - } else if (s[i] === c) { - return i; - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - -function index_opt(s, c) { - return index_rec_opt(s, s.length, 0, c); -} - -function index_from(s, i, c) { - var l = s.length; - if (i < 0 || i > l) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.index_from / Bytes.index_from" - ]; - } - return index_rec(s, l, i, c); -} - -function index_from_opt(s, i, c) { - var l = s.length; - if (i < 0 || i > l) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.index_from_opt / Bytes.index_from_opt" - ]; - } - return index_rec_opt(s, l, i, c); -} - -function rindex_rec(s, _i, c) { - while(true) { - var i = _i; - if (i < 0) { - throw Caml_builtin_exceptions.not_found; - } - if (s[i] === c) { - return i; - } else { - _i = i - 1 | 0; - continue ; - } - }; -} - -function rindex(s, c) { - return rindex_rec(s, s.length - 1 | 0, c); -} - -function rindex_from(s, i, c) { - if (i < -1 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.rindex_from / Bytes.rindex_from" - ]; - } - return rindex_rec(s, i, c); -} - -function rindex_rec_opt(s, _i, c) { - while(true) { - var i = _i; - if (i < 0) { - return ; - } else if (s[i] === c) { - return i; - } else { - _i = i - 1 | 0; - continue ; - } - }; -} - -function rindex_opt(s, c) { - return rindex_rec_opt(s, s.length - 1 | 0, c); -} - -function rindex_from_opt(s, i, c) { - if (i < -1 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.rindex_from_opt / Bytes.rindex_from_opt" - ]; - } - return rindex_rec_opt(s, i, c); -} - -function contains_from(s, i, c) { - var l = s.length; - if (i < 0 || i > l) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.contains_from / Bytes.contains_from" - ]; - } - try { - index_rec(s, l, i, c); - return true; - } - catch (exn){ - if (exn === Caml_builtin_exceptions.not_found) { - return false; - } else { - throw exn; - } - } -} - -function contains(s, c) { - return contains_from(s, 0, c); -} - -function rcontains_from(s, i, c) { - if (i < 0 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.rcontains_from / Bytes.rcontains_from" - ]; - } - try { - rindex_rec(s, i, c); - return true; - } - catch (exn){ - if (exn === Caml_builtin_exceptions.not_found) { - return false; - } else { - throw exn; - } - } -} - -var compare = Caml_primitive.caml_bytes_compare; - -function uppercase(s) { - return map(Char.uppercase, s); -} - -function lowercase(s) { - return map(Char.lowercase, s); -} - -function capitalize(s) { - return apply1(Char.uppercase, s); -} - -function uncapitalize(s) { - return apply1(Char.lowercase, s); -} - -var equal = Caml_primitive.caml_bytes_equal; - -var unsafe_to_string = Caml_bytes.bytes_to_string; - -var unsafe_of_string = Caml_bytes.bytes_of_string; - -exports.make = make; -exports.init = init; -exports.empty = empty; -exports.copy = copy; -exports.of_string = of_string; -exports.to_string = to_string; -exports.sub = sub; -exports.sub_string = sub_string; -exports.extend = extend; -exports.fill = fill; -exports.blit = blit; -exports.blit_string = blit_string; -exports.concat = concat; -exports.cat = cat; -exports.iter = iter; -exports.iteri = iteri; -exports.map = map; -exports.mapi = mapi; -exports.trim = trim; -exports.escaped = escaped; -exports.index = index; -exports.index_opt = index_opt; -exports.rindex = rindex; -exports.rindex_opt = rindex_opt; -exports.index_from = index_from; -exports.index_from_opt = index_from_opt; -exports.rindex_from = rindex_from; -exports.rindex_from_opt = rindex_from_opt; -exports.contains = contains; -exports.contains_from = contains_from; -exports.rcontains_from = rcontains_from; -exports.uppercase = uppercase; -exports.lowercase = lowercase; -exports.capitalize = capitalize; -exports.uncapitalize = uncapitalize; -exports.uppercase_ascii = uppercase_ascii; -exports.lowercase_ascii = lowercase_ascii; -exports.capitalize_ascii = capitalize_ascii; -exports.uncapitalize_ascii = uncapitalize_ascii; -exports.compare = compare; -exports.equal = equal; -exports.unsafe_to_string = unsafe_to_string; -exports.unsafe_of_string = unsafe_of_string; -/* No side effect */ - -},{"./caml_builtin_exceptions.js":40,"./caml_bytes.js":41,"./caml_primitive.js":51,"./char.js":57,"./curry.js":58}],39:[function(require,module,exports){ -'use strict'; - -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function caml_array_sub(x, offset, len) { - var result = new Array(len); - var j = 0; - var i = offset; - while(j < len) { - result[j] = x[i]; - j = j + 1 | 0; - i = i + 1 | 0; - }; - return result; -} - -function len(_acc, _l) { - while(true) { - var l = _l; - var acc = _acc; - if (l) { - _l = l[1]; - _acc = l[0].length + acc | 0; - continue ; - } else { - return acc; - } - }; -} - -function fill(arr, _i, _l) { - while(true) { - var l = _l; - var i = _i; - if (l) { - var x = l[0]; - var l$1 = x.length; - var k = i; - var j = 0; - while(j < l$1) { - arr[k] = x[j]; - k = k + 1 | 0; - j = j + 1 | 0; - }; - _l = l[1]; - _i = k; - continue ; - } else { - return /* () */0; - } - }; -} - -function caml_array_concat(l) { - var v = len(0, l); - var result = new Array(v); - fill(result, 0, l); - return result; -} - -function caml_array_set(xs, index, newval) { - if (index < 0 || index >= xs.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "index out of bounds" - ]; - } - xs[index] = newval; - return /* () */0; -} - -function caml_array_get(xs, index) { - if (index < 0 || index >= xs.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "index out of bounds" - ]; - } - return xs[index]; -} - -function caml_make_vect(len, init) { - var b = new Array(len); - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - b[i] = init; - } - return b; -} - -function caml_make_float_vect(len) { - var b = new Array(len); - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - b[i] = 0; - } - return b; -} - -function caml_array_blit(a1, i1, a2, i2, len) { - if (i2 <= i1) { - for(var j = 0 ,j_finish = len - 1 | 0; j <= j_finish; ++j){ - a2[j + i2 | 0] = a1[j + i1 | 0]; - } - return /* () */0; - } else { - for(var j$1 = len - 1 | 0; j$1 >= 0; --j$1){ - a2[j$1 + i2 | 0] = a1[j$1 + i1 | 0]; - } - return /* () */0; - } -} - -function caml_array_dup(prim) { - return prim.slice(0); -} - -exports.caml_array_dup = caml_array_dup; -exports.caml_array_sub = caml_array_sub; -exports.caml_array_concat = caml_array_concat; -exports.caml_make_vect = caml_make_vect; -exports.caml_make_float_vect = caml_make_float_vect; -exports.caml_array_blit = caml_array_blit; -exports.caml_array_get = caml_array_get; -exports.caml_array_set = caml_array_set; -/* No side effect */ - -},{"./caml_builtin_exceptions.js":40}],40:[function(require,module,exports){ -'use strict'; - - -var out_of_memory = /* tuple */[ - "Out_of_memory", - 0 -]; - -var sys_error = /* tuple */[ - "Sys_error", - -1 -]; - -var failure = /* tuple */[ - "Failure", - -2 -]; - -var invalid_argument = /* tuple */[ - "Invalid_argument", - -3 -]; - -var end_of_file = /* tuple */[ - "End_of_file", - -4 -]; - -var division_by_zero = /* tuple */[ - "Division_by_zero", - -5 -]; - -var not_found = /* tuple */[ - "Not_found", - -6 -]; - -var match_failure = /* tuple */[ - "Match_failure", - -7 -]; - -var stack_overflow = /* tuple */[ - "Stack_overflow", - -8 -]; - -var sys_blocked_io = /* tuple */[ - "Sys_blocked_io", - -9 -]; - -var assert_failure = /* tuple */[ - "Assert_failure", - -10 -]; - -var undefined_recursive_module = /* tuple */[ - "Undefined_recursive_module", - -11 -]; - -out_of_memory.tag = 248; - -sys_error.tag = 248; - -failure.tag = 248; - -invalid_argument.tag = 248; - -end_of_file.tag = 248; - -division_by_zero.tag = 248; - -not_found.tag = 248; - -match_failure.tag = 248; - -stack_overflow.tag = 248; - -sys_blocked_io.tag = 248; - -assert_failure.tag = 248; - -undefined_recursive_module.tag = 248; - -exports.out_of_memory = out_of_memory; -exports.sys_error = sys_error; -exports.failure = failure; -exports.invalid_argument = invalid_argument; -exports.end_of_file = end_of_file; -exports.division_by_zero = division_by_zero; -exports.not_found = not_found; -exports.match_failure = match_failure; -exports.stack_overflow = stack_overflow; -exports.sys_blocked_io = sys_blocked_io; -exports.assert_failure = assert_failure; -exports.undefined_recursive_module = undefined_recursive_module; -/* Not a pure module */ - -},{}],41:[function(require,module,exports){ -'use strict'; - -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function get(s, i) { - if (i < 0 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "index out of bounds" - ]; - } - return s[i]; -} - -function caml_fill_bytes(s, i, l, c) { - if (l > 0) { - for(var k = i ,k_finish = (l + i | 0) - 1 | 0; k <= k_finish; ++k){ - s[k] = c; - } - return /* () */0; - } else { - return 0; - } -} - -function caml_create_bytes(len) { - if (len < 0) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.create" - ]; - } - var result = new Array(len); - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - result[i] = /* "\000" */0; - } - return result; -} - -function caml_blit_bytes(s1, i1, s2, i2, len) { - if (len > 0) { - if (s1 === s2) { - var s1$1 = s1; - var i1$1 = i1; - var i2$1 = i2; - var len$1 = len; - if (i1$1 < i2$1) { - var range_a = (s1$1.length - i2$1 | 0) - 1 | 0; - var range_b = len$1 - 1 | 0; - var range = range_a > range_b ? range_b : range_a; - for(var j = range; j >= 0; --j){ - s1$1[i2$1 + j | 0] = s1$1[i1$1 + j | 0]; - } - return /* () */0; - } else if (i1$1 > i2$1) { - var range_a$1 = (s1$1.length - i1$1 | 0) - 1 | 0; - var range_b$1 = len$1 - 1 | 0; - var range$1 = range_a$1 > range_b$1 ? range_b$1 : range_a$1; - for(var k = 0; k <= range$1; ++k){ - s1$1[i2$1 + k | 0] = s1$1[i1$1 + k | 0]; - } - return /* () */0; - } else { - return 0; - } - } else { - var off1 = s1.length - i1 | 0; - if (len <= off1) { - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - s2[i2 + i | 0] = s1[i1 + i | 0]; - } - return /* () */0; - } else { - for(var i$1 = 0 ,i_finish$1 = off1 - 1 | 0; i$1 <= i_finish$1; ++i$1){ - s2[i2 + i$1 | 0] = s1[i1 + i$1 | 0]; - } - for(var i$2 = off1 ,i_finish$2 = len - 1 | 0; i$2 <= i_finish$2; ++i$2){ - s2[i2 + i$2 | 0] = /* "\000" */0; - } - return /* () */0; - } - } - } else { - return 0; - } -} - -function bytes_to_string(a) { - var bytes = a; - var i = 0; - var len = a.length; - var s = ""; - var s_len = len; - if (i === 0 && len <= 4096 && len === bytes.length) { - return String.fromCharCode.apply(null, bytes); - } else { - var offset = 0; - while(s_len > 0) { - var next = s_len < 1024 ? s_len : 1024; - var tmp_bytes = new Array(next); - caml_blit_bytes(bytes, offset, tmp_bytes, 0, next); - s = s + String.fromCharCode.apply(null, tmp_bytes); - s_len = s_len - next | 0; - offset = offset + next | 0; - }; - return s; - } -} - -function caml_blit_string(s1, i1, s2, i2, len) { - if (len > 0) { - var off1 = s1.length - i1 | 0; - if (len <= off1) { - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - s2[i2 + i | 0] = s1.charCodeAt(i1 + i | 0); - } - return /* () */0; - } else { - for(var i$1 = 0 ,i_finish$1 = off1 - 1 | 0; i$1 <= i_finish$1; ++i$1){ - s2[i2 + i$1 | 0] = s1.charCodeAt(i1 + i$1 | 0); - } - for(var i$2 = off1 ,i_finish$2 = len - 1 | 0; i$2 <= i_finish$2; ++i$2){ - s2[i2 + i$2 | 0] = /* "\000" */0; - } - return /* () */0; - } - } else { - return 0; - } -} - -function bytes_of_string(s) { - var len = s.length; - var res = new Array(len); - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - res[i] = s.charCodeAt(i); - } - return res; -} - -exports.caml_create_bytes = caml_create_bytes; -exports.caml_fill_bytes = caml_fill_bytes; -exports.get = get; -exports.bytes_to_string = bytes_to_string; -exports.caml_blit_bytes = caml_blit_bytes; -exports.caml_blit_string = caml_blit_string; -exports.bytes_of_string = bytes_of_string; -/* No side effect */ - -},{"./caml_builtin_exceptions.js":40}],42:[function(require,module,exports){ -'use strict'; - - -var id = { - contents: 0 -}; - -function caml_set_oo_id(b) { - b[1] = id.contents; - id.contents = id.contents + 1; - return b; -} - -function caml_fresh_oo_id(param) { - id.contents = id.contents + 1; - return id.contents; -} - -function create(str) { - var v_001 = caml_fresh_oo_id(/* () */0); - var v = /* tuple */[ - str, - v_001 - ]; - v.tag = 248; - return v; -} - -function caml_is_extension(e) { - if (e === undefined) { - return false; - } else if (e.tag === 248) { - return true; - } else { - var slot = e[0]; - if (slot !== undefined) { - return slot.tag === 248; - } else { - return false; - } - } -} - -exports.caml_set_oo_id = caml_set_oo_id; -exports.caml_fresh_oo_id = caml_fresh_oo_id; -exports.create = create; -exports.caml_is_extension = caml_is_extension; -/* No side effect */ - -},{}],43:[function(require,module,exports){ -(function (global){ -'use strict'; - - -var getGlobalThis = (function(){ - if (typeof globalThis !== 'undefined') return globalThis; - if (typeof self !== 'undefined') return self; - if (typeof window !== 'undefined') return window; - if (typeof global !== 'undefined') return global; - if (typeof this !== 'undefined') return this; - throw new Error('Unable to locate global `this`'); -}); - -var resolve = (function(s){ - var myGlobal = getGlobalThis(); - if (myGlobal[s] === undefined){ - throw new Error(s + " not polyfilled by BuckleScript yet\n") - } - return myGlobal[s] -}); - -var register = (function(s,fn){ - var myGlobal = getGlobalThis(); - myGlobal[s] = fn - return 0 -}); - -exports.getGlobalThis = getGlobalThis; -exports.resolve = resolve; -exports.register = register; -/* No side effect */ - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],44:[function(require,module,exports){ -'use strict'; - -var Caml_int32 = require("./caml_int32.js"); -var Caml_int64 = require("./caml_int64.js"); -var Caml_utils = require("./caml_utils.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function parse_digit(c) { - if (c >= 65) { - if (c >= 97) { - if (c >= 123) { - return -1; - } else { - return c - 87 | 0; - } - } else if (c >= 91) { - return -1; - } else { - return c - 55 | 0; - } - } else if (c > 57 || c < 48) { - return -1; - } else { - return c - /* "0" */48 | 0; - } -} - -function int_of_string_base(param) { - switch (param) { - case /* Oct */0 : - return 8; - case /* Hex */1 : - return 16; - case /* Dec */2 : - return 10; - case /* Bin */3 : - return 2; - - } -} - -function parse_sign_and_base(s) { - var sign = 1; - var base = /* Dec */2; - var i = 0; - var match = s.charCodeAt(i); - switch (match) { - case 43 : - i = i + 1 | 0; - break; - case 44 : - break; - case 45 : - sign = -1; - i = i + 1 | 0; - break; - default: - - } - if (s[i] === "0") { - var match$1 = s.charCodeAt(i + 1 | 0); - if (match$1 >= 89) { - if (match$1 >= 111) { - if (match$1 < 121) { - switch (match$1 - 111 | 0) { - case 0 : - base = /* Oct */0; - i = i + 2 | 0; - break; - case 6 : - i = i + 2 | 0; - break; - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 7 : - case 8 : - break; - case 9 : - base = /* Hex */1; - i = i + 2 | 0; - break; - - } - } - - } else if (match$1 === 98) { - base = /* Bin */3; - i = i + 2 | 0; - } - - } else if (match$1 !== 66) { - if (match$1 >= 79) { - switch (match$1 - 79 | 0) { - case 0 : - base = /* Oct */0; - i = i + 2 | 0; - break; - case 6 : - i = i + 2 | 0; - break; - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 7 : - case 8 : - break; - case 9 : - base = /* Hex */1; - i = i + 2 | 0; - break; - - } - } - - } else { - base = /* Bin */3; - i = i + 2 | 0; - } - } - return /* tuple */[ - i, - sign, - base - ]; -} - -function caml_int_of_string(s) { - var match = parse_sign_and_base(s); - var i = match[0]; - var base = int_of_string_base(match[2]); - var threshold = 4294967295; - var len = s.length; - var c = i < len ? s.charCodeAt(i) : /* "\000" */0; - var d = parse_digit(c); - if (d < 0 || d >= base) { - throw [ - Caml_builtin_exceptions.failure, - "int_of_string" - ]; - } - var aux = function (_acc, _k) { - while(true) { - var k = _k; - var acc = _acc; - if (k === len) { - return acc; - } else { - var a = s.charCodeAt(k); - if (a === /* "_" */95) { - _k = k + 1 | 0; - continue ; - } else { - var v = parse_digit(a); - if (v < 0 || v >= base) { - throw [ - Caml_builtin_exceptions.failure, - "int_of_string" - ]; - } - var acc$1 = base * acc + v; - if (acc$1 > threshold) { - throw [ - Caml_builtin_exceptions.failure, - "int_of_string" - ]; - } - _k = k + 1 | 0; - _acc = acc$1; - continue ; - } - } - }; - }; - var res = match[1] * aux(d, i + 1 | 0); - var or_res = res | 0; - if (base === 10 && res !== or_res) { - throw [ - Caml_builtin_exceptions.failure, - "int_of_string" - ]; - } - return or_res; -} - -function caml_int64_of_string(s) { - var match = parse_sign_and_base(s); - var hbase = match[2]; - var i = match[0]; - var base = Caml_int64.of_int32(int_of_string_base(hbase)); - var sign = Caml_int64.of_int32(match[1]); - var threshold; - switch (hbase) { - case /* Oct */0 : - threshold = /* int64 */[ - /* hi */536870911, - /* lo */4294967295 - ]; - break; - case /* Hex */1 : - threshold = /* int64 */[ - /* hi */268435455, - /* lo */4294967295 - ]; - break; - case /* Dec */2 : - threshold = /* int64 */[ - /* hi */429496729, - /* lo */2576980377 - ]; - break; - case /* Bin */3 : - threshold = /* int64 */[ - /* hi */2147483647, - /* lo */4294967295 - ]; - break; - - } - var len = s.length; - var c = i < len ? s.charCodeAt(i) : /* "\000" */0; - var d = Caml_int64.of_int32(parse_digit(c)); - if (Caml_int64.lt(d, /* int64 */[ - /* hi */0, - /* lo */0 - ]) || Caml_int64.ge(d, base)) { - throw [ - Caml_builtin_exceptions.failure, - "int64_of_string" - ]; - } - var aux = function (_acc, _k) { - while(true) { - var k = _k; - var acc = _acc; - if (k === len) { - return acc; - } else { - var a = s.charCodeAt(k); - if (a === /* "_" */95) { - _k = k + 1 | 0; - continue ; - } else { - var v = Caml_int64.of_int32(parse_digit(a)); - if (Caml_int64.lt(v, /* int64 */[ - /* hi */0, - /* lo */0 - ]) || Caml_int64.ge(v, base) || Caml_int64.gt(acc, threshold)) { - throw [ - Caml_builtin_exceptions.failure, - "int64_of_string" - ]; - } - var acc$1 = Caml_int64.add(Caml_int64.mul(base, acc), v); - _k = k + 1 | 0; - _acc = acc$1; - continue ; - } - } - }; - }; - var res = Caml_int64.mul(sign, aux(d, i + 1 | 0)); - var or_res = Caml_int64.or_(res, /* int64 */[ - /* hi */0, - /* lo */0 - ]); - if (Caml_int64.eq(base, /* int64 */[ - /* hi */0, - /* lo */10 - ]) && Caml_int64.neq(res, or_res)) { - throw [ - Caml_builtin_exceptions.failure, - "int64_of_string" - ]; - } - return or_res; -} - -function int_of_base(param) { - switch (param) { - case /* Oct */0 : - return 8; - case /* Hex */1 : - return 16; - case /* Dec */2 : - return 10; - - } -} - -function lowercase(c) { - if (c >= /* "A" */65 && c <= /* "Z" */90 || c >= /* "\192" */192 && c <= /* "\214" */214 || c >= /* "\216" */216 && c <= /* "\222" */222) { - return c + 32 | 0; - } else { - return c; - } -} - -function parse_format(fmt) { - var len = fmt.length; - if (len > 31) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "format_int: format too long" - ]; - } - var f = { - justify: "+", - signstyle: "-", - filter: " ", - alternate: false, - base: /* Dec */2, - signedconv: false, - width: 0, - uppercase: false, - sign: 1, - prec: -1, - conv: "f" - }; - var _i = 0; - while(true) { - var i = _i; - if (i >= len) { - return f; - } else { - var c = fmt.charCodeAt(i); - var exit = 0; - if (c >= 69) { - if (c >= 88) { - if (c >= 121) { - exit = 1; - } else { - switch (c - 88 | 0) { - case 0 : - f.base = /* Hex */1; - f.uppercase = true; - _i = i + 1 | 0; - continue ; - case 13 : - case 14 : - case 15 : - exit = 5; - break; - case 12 : - case 17 : - exit = 4; - break; - case 23 : - f.base = /* Oct */0; - _i = i + 1 | 0; - continue ; - case 29 : - f.base = /* Dec */2; - _i = i + 1 | 0; - continue ; - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - case 8 : - case 9 : - case 10 : - case 11 : - case 16 : - case 18 : - case 19 : - case 20 : - case 21 : - case 22 : - case 24 : - case 25 : - case 26 : - case 27 : - case 28 : - case 30 : - case 31 : - exit = 1; - break; - case 32 : - f.base = /* Hex */1; - _i = i + 1 | 0; - continue ; - - } - } - } else if (c >= 72) { - exit = 1; - } else { - f.signedconv = true; - f.uppercase = true; - f.conv = String.fromCharCode(lowercase(c)); - _i = i + 1 | 0; - continue ; - } - } else { - switch (c) { - case 35 : - f.alternate = true; - _i = i + 1 | 0; - continue ; - case 32 : - case 43 : - exit = 2; - break; - case 45 : - f.justify = "-"; - _i = i + 1 | 0; - continue ; - case 46 : - f.prec = 0; - var j = i + 1 | 0; - while((function(j){ - return function () { - var w = fmt.charCodeAt(j) - /* "0" */48 | 0; - return w >= 0 && w <= 9; - } - }(j))()) { - f.prec = (Caml_int32.imul(f.prec, 10) + fmt.charCodeAt(j) | 0) - /* "0" */48 | 0; - j = j + 1 | 0; - }; - _i = j; - continue ; - case 33 : - case 34 : - case 36 : - case 37 : - case 38 : - case 39 : - case 40 : - case 41 : - case 42 : - case 44 : - case 47 : - exit = 1; - break; - case 48 : - f.filter = "0"; - _i = i + 1 | 0; - continue ; - case 49 : - case 50 : - case 51 : - case 52 : - case 53 : - case 54 : - case 55 : - case 56 : - case 57 : - exit = 3; - break; - default: - exit = 1; - } - } - switch (exit) { - case 1 : - _i = i + 1 | 0; - continue ; - case 2 : - f.signstyle = String.fromCharCode(c); - _i = i + 1 | 0; - continue ; - case 3 : - f.width = 0; - var j$1 = i; - while((function(j$1){ - return function () { - var w = fmt.charCodeAt(j$1) - /* "0" */48 | 0; - return w >= 0 && w <= 9; - } - }(j$1))()) { - f.width = (Caml_int32.imul(f.width, 10) + fmt.charCodeAt(j$1) | 0) - /* "0" */48 | 0; - j$1 = j$1 + 1 | 0; - }; - _i = j$1; - continue ; - case 4 : - f.signedconv = true; - f.base = /* Dec */2; - _i = i + 1 | 0; - continue ; - case 5 : - f.signedconv = true; - f.conv = String.fromCharCode(c); - _i = i + 1 | 0; - continue ; - - } - } - }; -} - -function finish_formatting(config, rawbuffer) { - var justify = config.justify; - var signstyle = config.signstyle; - var filter = config.filter; - var alternate = config.alternate; - var base = config.base; - var signedconv = config.signedconv; - var width = config.width; - var uppercase = config.uppercase; - var sign = config.sign; - var len = rawbuffer.length; - if (signedconv && (sign < 0 || signstyle !== "-")) { - len = len + 1 | 0; - } - if (alternate) { - if (base === /* Oct */0) { - len = len + 1 | 0; - } else if (base === /* Hex */1) { - len = len + 2 | 0; - } - - } - var buffer = ""; - if (justify === "+" && filter === " ") { - for(var _for = len ,_for_finish = width - 1 | 0; _for <= _for_finish; ++_for){ - buffer = buffer + filter; - } - } - if (signedconv) { - if (sign < 0) { - buffer = buffer + "-"; - } else if (signstyle !== "-") { - buffer = buffer + signstyle; - } - - } - if (alternate && base === /* Oct */0) { - buffer = buffer + "0"; - } - if (alternate && base === /* Hex */1) { - buffer = buffer + "0x"; - } - if (justify === "+" && filter === "0") { - for(var _for$1 = len ,_for_finish$1 = width - 1 | 0; _for$1 <= _for_finish$1; ++_for$1){ - buffer = buffer + filter; - } - } - buffer = uppercase ? buffer + rawbuffer.toUpperCase() : buffer + rawbuffer; - if (justify === "-") { - for(var _for$2 = len ,_for_finish$2 = width - 1 | 0; _for$2 <= _for_finish$2; ++_for$2){ - buffer = buffer + " "; - } - } - return buffer; -} - -function caml_format_int(fmt, i) { - if (fmt === "%d") { - return String(i); - } else { - var f = parse_format(fmt); - var f$1 = f; - var i$1 = i; - var i$2 = i$1 < 0 ? ( - f$1.signedconv ? (f$1.sign = -1, -i$1) : (i$1 >>> 0) - ) : i$1; - var s = i$2.toString(int_of_base(f$1.base)); - if (f$1.prec >= 0) { - f$1.filter = " "; - var n = f$1.prec - s.length | 0; - if (n > 0) { - s = Caml_utils.repeat(n, "0") + s; - } - - } - return finish_formatting(f$1, s); - } -} - -function caml_int64_format(fmt, x) { - var f = parse_format(fmt); - var x$1 = f.signedconv && Caml_int64.lt(x, /* int64 */[ - /* hi */0, - /* lo */0 - ]) ? (f.sign = -1, Caml_int64.neg(x)) : x; - var s = ""; - var match = f.base; - switch (match) { - case /* Oct */0 : - var wbase = /* int64 */[ - /* hi */0, - /* lo */8 - ]; - var cvtbl = "01234567"; - if (Caml_int64.lt(x$1, /* int64 */[ - /* hi */0, - /* lo */0 - ])) { - var y = Caml_int64.discard_sign(x$1); - var match$1 = Caml_int64.div_mod(y, wbase); - var quotient = Caml_int64.add(/* int64 */[ - /* hi */268435456, - /* lo */0 - ], match$1[0]); - var modulus = match$1[1]; - s = String.fromCharCode(cvtbl.charCodeAt(Caml_int64.to_int32(modulus))) + s; - while(Caml_int64.neq(quotient, /* int64 */[ - /* hi */0, - /* lo */0 - ])) { - var match$2 = Caml_int64.div_mod(quotient, wbase); - quotient = match$2[0]; - modulus = match$2[1]; - s = String.fromCharCode(cvtbl.charCodeAt(Caml_int64.to_int32(modulus))) + s; - }; - } else { - var match$3 = Caml_int64.div_mod(x$1, wbase); - var quotient$1 = match$3[0]; - var modulus$1 = match$3[1]; - s = String.fromCharCode(cvtbl.charCodeAt(Caml_int64.to_int32(modulus$1))) + s; - while(Caml_int64.neq(quotient$1, /* int64 */[ - /* hi */0, - /* lo */0 - ])) { - var match$4 = Caml_int64.div_mod(quotient$1, wbase); - quotient$1 = match$4[0]; - modulus$1 = match$4[1]; - s = String.fromCharCode(cvtbl.charCodeAt(Caml_int64.to_int32(modulus$1))) + s; - }; - } - break; - case /* Hex */1 : - s = Caml_int64.to_hex(x$1) + s; - break; - case /* Dec */2 : - var wbase$1 = /* int64 */[ - /* hi */0, - /* lo */10 - ]; - var cvtbl$1 = "0123456789"; - if (Caml_int64.lt(x$1, /* int64 */[ - /* hi */0, - /* lo */0 - ])) { - var y$1 = Caml_int64.discard_sign(x$1); - var match$5 = Caml_int64.div_mod(y$1, wbase$1); - var match$6 = Caml_int64.div_mod(Caml_int64.add(/* int64 */[ - /* hi */0, - /* lo */8 - ], match$5[1]), wbase$1); - var quotient$2 = Caml_int64.add(Caml_int64.add(/* int64 */[ - /* hi */214748364, - /* lo */3435973836 - ], match$5[0]), match$6[0]); - var modulus$2 = match$6[1]; - s = String.fromCharCode(cvtbl$1.charCodeAt(Caml_int64.to_int32(modulus$2))) + s; - while(Caml_int64.neq(quotient$2, /* int64 */[ - /* hi */0, - /* lo */0 - ])) { - var match$7 = Caml_int64.div_mod(quotient$2, wbase$1); - quotient$2 = match$7[0]; - modulus$2 = match$7[1]; - s = String.fromCharCode(cvtbl$1.charCodeAt(Caml_int64.to_int32(modulus$2))) + s; - }; - } else { - var match$8 = Caml_int64.div_mod(x$1, wbase$1); - var quotient$3 = match$8[0]; - var modulus$3 = match$8[1]; - s = String.fromCharCode(cvtbl$1.charCodeAt(Caml_int64.to_int32(modulus$3))) + s; - while(Caml_int64.neq(quotient$3, /* int64 */[ - /* hi */0, - /* lo */0 - ])) { - var match$9 = Caml_int64.div_mod(quotient$3, wbase$1); - quotient$3 = match$9[0]; - modulus$3 = match$9[1]; - s = String.fromCharCode(cvtbl$1.charCodeAt(Caml_int64.to_int32(modulus$3))) + s; - }; - } - break; - - } - if (f.prec >= 0) { - f.filter = " "; - var n = f.prec - s.length | 0; - if (n > 0) { - s = Caml_utils.repeat(n, "0") + s; - } - - } - return finish_formatting(f, s); -} - -function caml_format_float(fmt, x) { - var f = parse_format(fmt); - var prec = f.prec < 0 ? 6 : f.prec; - var x$1 = x < 0 ? (f.sign = -1, -x) : x; - var s = ""; - if (isNaN(x$1)) { - s = "nan"; - f.filter = " "; - } else if (isFinite(x$1)) { - var match = f.conv; - switch (match) { - case "e" : - s = x$1.toExponential(prec); - var i = s.length; - if (s[i - 3 | 0] === "e") { - s = s.slice(0, i - 1 | 0) + ("0" + s.slice(i - 1 | 0)); - } - break; - case "f" : - s = x$1.toFixed(prec); - break; - case "g" : - var prec$1 = prec !== 0 ? prec : 1; - s = x$1.toExponential(prec$1 - 1 | 0); - var j = s.indexOf("e"); - var exp = Number(s.slice(j + 1 | 0)) | 0; - if (exp < -4 || x$1 >= 1e21 || x$1.toFixed().length > prec$1) { - var i$1 = j - 1 | 0; - while(s[i$1] === "0") { - i$1 = i$1 - 1 | 0; - }; - if (s[i$1] === ".") { - i$1 = i$1 - 1 | 0; - } - s = s.slice(0, i$1 + 1 | 0) + s.slice(j); - var i$2 = s.length; - if (s[i$2 - 3 | 0] === "e") { - s = s.slice(0, i$2 - 1 | 0) + ("0" + s.slice(i$2 - 1 | 0)); - } - - } else { - var p = prec$1; - if (exp < 0) { - p = p - (exp + 1 | 0) | 0; - s = x$1.toFixed(p); - } else { - while((function () { - s = x$1.toFixed(p); - return s.length > (prec$1 + 1 | 0); - })()) { - p = p - 1 | 0; - }; - } - if (p !== 0) { - var k = s.length - 1 | 0; - while(s[k] === "0") { - k = k - 1 | 0; - }; - if (s[k] === ".") { - k = k - 1 | 0; - } - s = s.slice(0, k + 1 | 0); - } - - } - break; - default: - - } - } else { - s = "inf"; - f.filter = " "; - } - return finish_formatting(f, s); -} - -var caml_hexstring_of_float = (function(x,prec,style){ - if (!isFinite(x)) { - if (isNaN(x)) return "nan"; - return x > 0 ? "infinity":"-infinity"; - } - var sign = (x==0 && 1/x == -Infinity)?1:(x>=0)?0:1; - if(sign) x = -x; - var exp = 0; - if (x == 0) { } - else if (x < 1) { - while (x < 1 && exp > -1022) { x *= 2; exp-- } - } else { - while (x >= 2) { x /= 2; exp++ } - } - var exp_sign = exp < 0 ? '' : '+'; - var sign_str = ''; - if (sign) sign_str = '-' - else { - switch(style){ - case 43 /* '+' */: sign_str = '+'; break; - case 32 /* ' ' */: sign_str = ' '; break; - default: break; - } - } - if (prec >= 0 && prec < 13) { - /* If a precision is given, and is small, round mantissa accordingly */ - var cst = Math.pow(2,prec * 4); - x = Math.round(x * cst) / cst; - } - var x_str = x.toString(16); - if(prec >= 0){ - var idx = x_str.indexOf('.'); - if(idx<0) { - x_str += '.' + '0'.repeat(prec); - } - else { - var size = idx+1+prec; - if(x_str.length < size) - x_str += '0'.repeat(size - x_str.length); - else - x_str = x_str.substr(0,size); - } - } - return (sign_str + '0x' + x_str + 'p' + exp_sign + exp.toString(10)); -}); - -var float_of_string = (function(s,exn){ - - var res = +s; - if ((s.length > 0) && (res === res)) - return res; - s = s.replace(/_/g, ""); - res = +s; - if (((s.length > 0) && (res === res)) || /^[+-]?nan$/i.test(s)) { - return res; - }; - var m = /^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)p([+-]?[0-9]+)/i.exec(s); - // 1 2 3 4 - if(m){ - var m3 = m[3].replace(/0+$/,''); - var mantissa = parseInt(m[1] + m[2] + m3, 16); - var exponent = (m[4]|0) - 4*m3.length; - res = mantissa * Math.pow(2, exponent); - return res; - } - if (/^\+?inf(inity)?$/i.test(s)) - return Infinity; - if (/^-inf(inity)?$/i.test(s)) - return -Infinity; - throw exn; -}); - -function caml_float_of_string(s) { - return float_of_string(s, [ - Caml_builtin_exceptions.failure, - "float_of_string" - ]); -} - -var caml_nativeint_format = caml_format_int; - -var caml_int32_format = caml_format_int; - -var caml_int32_of_string = caml_int_of_string; - -var caml_nativeint_of_string = caml_int_of_string; - -exports.caml_format_float = caml_format_float; -exports.caml_hexstring_of_float = caml_hexstring_of_float; -exports.caml_format_int = caml_format_int; -exports.caml_nativeint_format = caml_nativeint_format; -exports.caml_int32_format = caml_int32_format; -exports.caml_float_of_string = caml_float_of_string; -exports.caml_int64_format = caml_int64_format; -exports.caml_int_of_string = caml_int_of_string; -exports.caml_int32_of_string = caml_int32_of_string; -exports.caml_int64_of_string = caml_int64_of_string; -exports.caml_nativeint_of_string = caml_nativeint_of_string; -/* No side effect */ - -},{"./caml_builtin_exceptions.js":40,"./caml_int32.js":45,"./caml_int64.js":46,"./caml_utils.js":54}],45:[function(require,module,exports){ -'use strict'; - -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function div(x, y) { - if (y === 0) { - throw Caml_builtin_exceptions.division_by_zero; - } - return x / y | 0; -} - -function mod_(x, y) { - if (y === 0) { - throw Caml_builtin_exceptions.division_by_zero; - } - return x % y; -} - -function caml_bswap16(x) { - return ((x & 255) << 8) | ((x & 65280) >>> 8); -} - -function caml_int32_bswap(x) { - return ((x & 255) << 24) | ((x & 65280) << 8) | ((x & 16711680) >>> 8) | ((x & 4278190080) >>> 24); -} - -var imul = (Math.imul || function (x,y) { - y |= 0; return ((((x >> 16) * y) << 16) + (x & 0xffff) * y)|0; -}); - -var caml_nativeint_bswap = caml_int32_bswap; - -exports.div = div; -exports.mod_ = mod_; -exports.caml_bswap16 = caml_bswap16; -exports.caml_int32_bswap = caml_int32_bswap; -exports.caml_nativeint_bswap = caml_nativeint_bswap; -exports.imul = imul; -/* imul Not a pure module */ - -},{"./caml_builtin_exceptions.js":40}],46:[function(require,module,exports){ -'use strict'; - -var Caml_int32 = require("./caml_int32.js"); -var Caml_utils = require("./caml_utils.js"); -var Caml_primitive = require("./caml_primitive.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -var min_int = /* Int64 */[ - /* hi */-2147483648, - /* lo */0 -]; - -var max_int = /* Int64 */[ - /* hi */2147483647, - /* lo */1 -]; - -var one = /* Int64 */[ - /* hi */0, - /* lo */1 -]; - -var zero = /* Int64 */[ - /* hi */0, - /* lo */0 -]; - -var neg_one = /* Int64 */[ - /* hi */-1, - /* lo */4294967295 -]; - -function neg_signed(x) { - return (x & 2147483648) !== 0; -} - -function add(param, param$1) { - var other_low_ = param$1[/* lo */1]; - var this_low_ = param[/* lo */1]; - var lo = this_low_ + other_low_ & 4294967295; - var overflow = neg_signed(this_low_) && (neg_signed(other_low_) || !neg_signed(lo)) || neg_signed(other_low_) && !neg_signed(lo) ? 1 : 0; - var hi = param[/* hi */0] + param$1[/* hi */0] + overflow & 4294967295; - return /* Int64 */[ - /* hi */hi, - /* lo */(lo >>> 0) - ]; -} - -function not(param) { - var hi = param[/* hi */0] ^ -1; - var lo = param[/* lo */1] ^ -1; - return /* Int64 */[ - /* hi */hi, - /* lo */(lo >>> 0) - ]; -} - -function eq(param, param$1) { - if (param[/* hi */0] === param$1[/* hi */0]) { - return param[/* lo */1] === param$1[/* lo */1]; - } else { - return false; - } -} - -function equal_null(x, y) { - if (y !== null) { - return eq(x, y); - } else { - return false; - } -} - -function equal_undefined(x, y) { - if (y !== undefined) { - return eq(x, y); - } else { - return false; - } -} - -function equal_nullable(x, y) { - if (y == null) { - return false; - } else { - return eq(x, y); - } -} - -function neg(x) { - if (eq(x, min_int)) { - return min_int; - } else { - return add(not(x), one); - } -} - -function sub(x, y) { - return add(x, neg(y)); -} - -function lsl_(x, numBits) { - if (numBits === 0) { - return x; - } else { - var lo = x[/* lo */1]; - if (numBits >= 32) { - return /* Int64 */[ - /* hi */(lo << (numBits - 32 | 0)), - /* lo */0 - ]; - } else { - var hi = (lo >>> (32 - numBits | 0)) | (x[/* hi */0] << numBits); - return /* Int64 */[ - /* hi */hi, - /* lo */((lo << numBits) >>> 0) - ]; - } - } -} - -function lsr_(x, numBits) { - if (numBits === 0) { - return x; - } else { - var hi = x[/* hi */0]; - var offset = numBits - 32 | 0; - if (offset === 0) { - return /* Int64 */[ - /* hi */0, - /* lo */(hi >>> 0) - ]; - } else if (offset > 0) { - var lo = (hi >>> offset); - return /* Int64 */[ - /* hi */0, - /* lo */(lo >>> 0) - ]; - } else { - var hi$1 = (hi >>> numBits); - var lo$1 = (hi << (-offset | 0)) | (x[/* lo */1] >>> numBits); - return /* Int64 */[ - /* hi */hi$1, - /* lo */(lo$1 >>> 0) - ]; - } - } -} - -function asr_(x, numBits) { - if (numBits === 0) { - return x; - } else { - var hi = x[/* hi */0]; - if (numBits < 32) { - var hi$1 = (hi >> numBits); - var lo = (hi << (32 - numBits | 0)) | (x[/* lo */1] >>> numBits); - return /* Int64 */[ - /* hi */hi$1, - /* lo */(lo >>> 0) - ]; - } else { - var lo$1 = (hi >> (numBits - 32 | 0)); - return /* Int64 */[ - /* hi */hi >= 0 ? 0 : -1, - /* lo */(lo$1 >>> 0) - ]; - } - } -} - -function is_zero(param) { - if (param[/* hi */0] !== 0 || param[/* lo */1] !== 0) { - return false; - } else { - return true; - } -} - -function mul(_this, _other) { - while(true) { - var other = _other; - var $$this = _this; - var lo; - var exit = 0; - var exit$1 = 0; - if ($$this[/* hi */0] !== 0 || $$this[/* lo */1] !== 0) { - exit$1 = 3; - } else { - return zero; - } - if (exit$1 === 3) { - if (other[/* hi */0] !== 0 || other[/* lo */1] !== 0) { - exit = 2; - } else { - return zero; - } - } - if (exit === 2) { - var this_hi = $$this[/* hi */0]; - var exit$2 = 0; - if (this_hi !== -2147483648 || $$this[/* lo */1] !== 0) { - exit$2 = 3; - } else { - lo = other[/* lo */1]; - } - if (exit$2 === 3) { - var other_hi = other[/* hi */0]; - var lo$1 = $$this[/* lo */1]; - var exit$3 = 0; - if (other_hi !== -2147483648 || other[/* lo */1] !== 0) { - exit$3 = 4; - } else { - lo = lo$1; - } - if (exit$3 === 4) { - var other_lo = other[/* lo */1]; - if (this_hi < 0) { - if (other_hi < 0) { - _other = neg(other); - _this = neg($$this); - continue ; - } else { - return neg(mul(neg($$this), other)); - } - } else if (other_hi < 0) { - return neg(mul($$this, neg(other))); - } else { - var a48 = (this_hi >>> 16); - var a32 = this_hi & 65535; - var a16 = (lo$1 >>> 16); - var a00 = lo$1 & 65535; - var b48 = (other_hi >>> 16); - var b32 = other_hi & 65535; - var b16 = (other_lo >>> 16); - var b00 = other_lo & 65535; - var c48 = 0; - var c32 = 0; - var c16 = 0; - var c00 = a00 * b00; - c16 = (c00 >>> 16) + a16 * b00; - c32 = (c16 >>> 16); - c16 = (c16 & 65535) + a00 * b16; - c32 = c32 + (c16 >>> 16) + a32 * b00; - c48 = (c32 >>> 16); - c32 = (c32 & 65535) + a16 * b16; - c48 = c48 + (c32 >>> 16); - c32 = (c32 & 65535) + a00 * b32; - c48 = c48 + (c32 >>> 16); - c32 = c32 & 65535; - c48 = c48 + (a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48) & 65535; - var hi = c32 | (c48 << 16); - var lo$2 = c00 & 65535 | ((c16 & 65535) << 16); - return /* Int64 */[ - /* hi */hi, - /* lo */(lo$2 >>> 0) - ]; - } - } - - } - - } - if ((lo & 1) === 0) { - return zero; - } else { - return min_int; - } - }; -} - -function swap(param) { - var hi = Caml_int32.caml_int32_bswap(param[/* lo */1]); - var lo = Caml_int32.caml_int32_bswap(param[/* hi */0]); - return /* Int64 */[ - /* hi */hi, - /* lo */(lo >>> 0) - ]; -} - -function xor(param, param$1) { - return /* Int64 */[ - /* hi */param[/* hi */0] ^ param$1[/* hi */0], - /* lo */((param[/* lo */1] ^ param$1[/* lo */1]) >>> 0) - ]; -} - -function or_(param, param$1) { - return /* Int64 */[ - /* hi */param[/* hi */0] | param$1[/* hi */0], - /* lo */((param[/* lo */1] | param$1[/* lo */1]) >>> 0) - ]; -} - -function and_(param, param$1) { - return /* Int64 */[ - /* hi */param[/* hi */0] & param$1[/* hi */0], - /* lo */((param[/* lo */1] & param$1[/* lo */1]) >>> 0) - ]; -} - -function ge(param, param$1) { - var other_hi = param$1[/* hi */0]; - var hi = param[/* hi */0]; - if (hi > other_hi) { - return true; - } else if (hi < other_hi) { - return false; - } else { - return param[/* lo */1] >= param$1[/* lo */1]; - } -} - -function neq(x, y) { - return !eq(x, y); -} - -function lt(x, y) { - return !ge(x, y); -} - -function gt(param, param$1) { - if (param[/* hi */0] > param$1[/* hi */0]) { - return true; - } else if (param[/* hi */0] < param$1[/* hi */0]) { - return false; - } else { - return param[/* lo */1] > param$1[/* lo */1]; - } -} - -function le(x, y) { - return !gt(x, y); -} - -function min(x, y) { - if (ge(x, y)) { - return y; - } else { - return x; - } -} - -function max(x, y) { - if (gt(x, y)) { - return x; - } else { - return y; - } -} - -function to_float(param) { - return param[/* hi */0] * 0x100000000 + param[/* lo */1]; -} - -function of_float(x) { - if (isNaN(x) || !isFinite(x)) { - return zero; - } else if (x <= -9.22337203685477581e+18) { - return min_int; - } else if (x + 1 >= 9.22337203685477581e+18) { - return max_int; - } else if (x < 0) { - return neg(of_float(-x)); - } else { - var hi = x / 4294967296 | 0; - var lo = x % 4294967296 | 0; - return /* Int64 */[ - /* hi */hi, - /* lo */(lo >>> 0) - ]; - } -} - -function div(_self, _other) { - while(true) { - var other = _other; - var self = _self; - var exit = 0; - var exit$1 = 0; - if (other[/* hi */0] !== 0 || other[/* lo */1] !== 0) { - exit$1 = 3; - } else { - throw Caml_builtin_exceptions.division_by_zero; - } - if (exit$1 === 3) { - var match = self[/* hi */0]; - if (match !== -2147483648) { - if (match !== 0 || self[/* lo */1] !== 0) { - exit = 2; - } else { - return zero; - } - } else if (self[/* lo */1] !== 0) { - exit = 2; - } else if (eq(other, one) || eq(other, neg_one)) { - return self; - } else if (eq(other, min_int)) { - return one; - } else { - var half_this = asr_(self, 1); - var approx = lsl_(div(half_this, other), 1); - var exit$2 = 0; - if (approx[/* hi */0] !== 0 || approx[/* lo */1] !== 0) { - exit$2 = 4; - } else if (other[/* hi */0] < 0) { - return one; - } else { - return neg(one); - } - if (exit$2 === 4) { - var y = mul(other, approx); - var rem = add(self, neg(y)); - return add(approx, div(rem, other)); - } - - } - } - if (exit === 2 && other[/* hi */0] === -2147483648 && other[/* lo */1] === 0) { - return zero; - } - var other_hi = other[/* hi */0]; - if (self[/* hi */0] < 0) { - if (other_hi < 0) { - _other = neg(other); - _self = neg(self); - continue ; - } else { - return neg(div(neg(self), other)); - } - } else if (other_hi < 0) { - return neg(div(self, neg(other))); - } else { - var res = zero; - var rem$1 = self; - while(ge(rem$1, other)) { - var approx$1 = Caml_primitive.caml_float_max(1, Math.floor(to_float(rem$1) / to_float(other))); - var log2 = Math.ceil(Math.log(approx$1) / Math.LN2); - var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); - var approxRes = of_float(approx$1); - var approxRem = mul(approxRes, other); - while(approxRem[/* hi */0] < 0 || gt(approxRem, rem$1)) { - approx$1 = approx$1 - delta; - approxRes = of_float(approx$1); - approxRem = mul(approxRes, other); - }; - if (is_zero(approxRes)) { - approxRes = one; - } - res = add(res, approxRes); - rem$1 = add(rem$1, neg(approxRem)); - }; - return res; - } - }; -} - -function mod_(self, other) { - var y = mul(div(self, other), other); - return add(self, neg(y)); -} - -function div_mod(self, other) { - var quotient = div(self, other); - var y = mul(quotient, other); - return /* tuple */[ - quotient, - add(self, neg(y)) - ]; -} - -function compare(param, param$1) { - var v = Caml_primitive.caml_nativeint_compare(param[/* hi */0], param$1[/* hi */0]); - if (v === 0) { - return Caml_primitive.caml_nativeint_compare(param[/* lo */1], param$1[/* lo */1]); - } else { - return v; - } -} - -function of_int32(lo) { - return /* Int64 */[ - /* hi */lo < 0 ? -1 : 0, - /* lo */(lo >>> 0) - ]; -} - -function to_int32(param) { - return param[/* lo */1] | 0; -} - -function to_hex(x) { - var x_lo = x[/* lo */1]; - var x_hi = x[/* hi */0]; - var aux = function (v) { - return (v >>> 0).toString(16); - }; - if (x_hi === 0 && x_lo === 0) { - return "0"; - } - if (x_lo !== 0) { - if (x_hi !== 0) { - var lo = aux(x_lo); - var pad = 8 - lo.length | 0; - if (pad <= 0) { - return aux(x_hi) + lo; - } else { - return aux(x_hi) + (Caml_utils.repeat(pad, "0") + lo); - } - } else { - return aux(x_lo); - } - } else { - return aux(x_hi) + "00000000"; - } -} - -function discard_sign(x) { - return /* Int64 */[ - /* hi */2147483647 & x[/* hi */0], - /* lo */x[/* lo */1] - ]; -} - -function float_of_bits(param) { - return (function(lo,hi){ return (new Float64Array(new Int32Array([lo,hi]).buffer))[0]})(param[/* lo */1], param[/* hi */0]); -} - -function bits_of_float(x) { - var buf = (function(x){return new Int32Array(new Float64Array([x]).buffer)})(x); - return /* Int64 */[ - /* hi */buf[1], - /* lo */(buf[0] >>> 0) - ]; -} - -function get64(s, i) { - var hi = (s.charCodeAt(i + 4 | 0) << 32) | (s.charCodeAt(i + 5 | 0) << 40) | (s.charCodeAt(i + 6 | 0) << 48) | (s.charCodeAt(i + 7 | 0) << 56); - var lo = s.charCodeAt(i) | (s.charCodeAt(i + 1 | 0) << 8) | (s.charCodeAt(i + 2 | 0) << 16) | (s.charCodeAt(i + 3 | 0) << 24); - return /* Int64 */[ - /* hi */hi, - /* lo */(lo >>> 0) - ]; -} - -exports.min_int = min_int; -exports.max_int = max_int; -exports.one = one; -exports.zero = zero; -exports.not = not; -exports.of_int32 = of_int32; -exports.to_int32 = to_int32; -exports.add = add; -exports.neg = neg; -exports.sub = sub; -exports.lsl_ = lsl_; -exports.lsr_ = lsr_; -exports.asr_ = asr_; -exports.is_zero = is_zero; -exports.mul = mul; -exports.xor = xor; -exports.or_ = or_; -exports.and_ = and_; -exports.swap = swap; -exports.ge = ge; -exports.eq = eq; -exports.neq = neq; -exports.lt = lt; -exports.gt = gt; -exports.le = le; -exports.equal_null = equal_null; -exports.equal_undefined = equal_undefined; -exports.equal_nullable = equal_nullable; -exports.min = min; -exports.max = max; -exports.to_float = to_float; -exports.of_float = of_float; -exports.div = div; -exports.mod_ = mod_; -exports.compare = compare; -exports.float_of_bits = float_of_bits; -exports.bits_of_float = bits_of_float; -exports.get64 = get64; -exports.div_mod = div_mod; -exports.to_hex = to_hex; -exports.discard_sign = discard_sign; -/* Caml_int32 Not a pure module */ - -},{"./caml_builtin_exceptions.js":40,"./caml_int32.js":45,"./caml_primitive.js":51,"./caml_utils.js":54}],47:[function(require,module,exports){ -(function (process){ -'use strict'; - -var Curry = require("./curry.js"); - -var stdout = { - buffer: "", - output: (function (param, s) { - var v = s.length - 1 | 0; - if (((typeof process !== "undefined") && process.stdout && process.stdout.write)) { - return process.stdout.write(s); - } else if (s[v] === "\n") { - console.log(s.slice(0, v)); - return /* () */0; - } else { - console.log(s); - return /* () */0; - } - }) -}; - -var stderr = { - buffer: "", - output: (function (param, s) { - var v = s.length - 1 | 0; - if (s[v] === "\n") { - console.log(s.slice(0, v)); - return /* () */0; - } else { - console.log(s); - return /* () */0; - } - }) -}; - -function caml_ml_flush(oc) { - if (oc.buffer !== "") { - Curry._2(oc.output, oc, oc.buffer); - oc.buffer = ""; - return /* () */0; - } else { - return 0; - } -} - -function caml_ml_output(oc, str, offset, len) { - var str$1 = offset === 0 && len === str.length ? str : str.slice(offset, len); - if (((typeof process !== "undefined") && process.stdout && process.stdout.write) && oc === stdout) { - return process.stdout.write(str$1); - } else { - var id = str$1.lastIndexOf("\n"); - if (id < 0) { - oc.buffer = oc.buffer + str$1; - return /* () */0; - } else { - oc.buffer = oc.buffer + str$1.slice(0, id + 1 | 0); - caml_ml_flush(oc); - oc.buffer = oc.buffer + str$1.slice(id + 1 | 0); - return /* () */0; - } - } -} - -function caml_ml_output_char(oc, $$char) { - return caml_ml_output(oc, String.fromCharCode($$char), 0, 1); -} - -function caml_ml_out_channels_list(param) { - return /* :: */[ - stdout, - /* :: */[ - stderr, - /* [] */0 - ] - ]; -} - -var stdin = undefined; - -exports.stdin = stdin; -exports.stdout = stdout; -exports.stderr = stderr; -exports.caml_ml_flush = caml_ml_flush; -exports.caml_ml_output = caml_ml_output; -exports.caml_ml_output_char = caml_ml_output_char; -exports.caml_ml_out_channels_list = caml_ml_out_channels_list; -/* No side effect */ - -}).call(this,require('_process')) -},{"./curry.js":58,"_process":65}],48:[function(require,module,exports){ -'use strict'; - -var Caml_option = require("./caml_option.js"); -var Caml_exceptions = require("./caml_exceptions.js"); - -var $$Error = Caml_exceptions.create("Caml_js_exceptions.Error"); - -function internalToOCamlException(e) { - if (Caml_exceptions.caml_is_extension(e)) { - return e; - } else { - return [ - $$Error, - e - ]; - } -} - -function caml_as_js_exn(exn) { - if (exn[0] === $$Error) { - return Caml_option.some(exn[1]); - } - -} - -exports.$$Error = $$Error; -exports.internalToOCamlException = internalToOCamlException; -exports.caml_as_js_exn = caml_as_js_exn; -/* No side effect */ - -},{"./caml_exceptions.js":42,"./caml_option.js":50}],49:[function(require,module,exports){ -'use strict'; - -var Block = require("./block.js"); -var Caml_primitive = require("./caml_primitive.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -var for_in = (function(o,foo){ - for (var x in o) { foo(x) }}); - -function caml_obj_block(tag, size) { - var v = new Array(size); - v.tag = tag; - return v; -} - -function caml_obj_dup(x) { - if (Array.isArray(x)) { - var len = x.length | 0; - var v = new Array(len); - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - v[i] = x[i]; - } - v.tag = x.tag | 0; - return v; - } else { - return Object.assign(({}), x); - } -} - -function caml_obj_truncate(x, new_size) { - var len = x.length | 0; - if (new_size <= 0 || new_size > len) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Obj.truncate" - ]; - } - if (len !== new_size) { - for(var i = new_size ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - x[i] = 0; - } - x.length = new_size; - return /* () */0; - } else { - return 0; - } -} - -function caml_lazy_make_forward(x) { - return Block.__(250, [x]); -} - -function caml_lazy_make(fn) { - var block = [fn]; - block.tag = 246; - return block; -} - -var caml_update_dummy = (function(x,y){ - for (var k in y){ - x[k] = y[k] - } - return 0; - }); - -function caml_compare(_a, _b) { - while(true) { - var b = _b; - var a = _a; - if (a === b) { - return 0; - } else { - var a_type = typeof a; - var b_type = typeof b; - switch (a_type) { - case "boolean" : - if (b_type === "boolean") { - return Caml_primitive.caml_bool_compare(a, b); - } - break; - case "function" : - if (b_type === "function") { - throw [ - Caml_builtin_exceptions.invalid_argument, - "compare: functional value" - ]; - } - break; - case "number" : - if (b_type === "number") { - return Caml_primitive.caml_int_compare(a, b); - } - break; - case "string" : - if (b_type === "string") { - return Caml_primitive.caml_string_compare(a, b); - } else { - return 1; - } - case "undefined" : - return -1; - default: - - } - switch (b_type) { - case "string" : - return -1; - case "undefined" : - return 1; - default: - if (a_type === "boolean") { - return 1; - } else if (b_type === "boolean") { - return -1; - } else if (a_type === "function") { - return 1; - } else if (b_type === "function") { - return -1; - } else if (a_type === "number") { - if (b === null || b.tag === 256) { - return 1; - } else { - return -1; - } - } else if (b_type === "number") { - if (a === null || a.tag === 256) { - return -1; - } else { - return 1; - } - } else if (a === null) { - if (b.tag === 256) { - return 1; - } else { - return -1; - } - } else if (b === null) { - if (a.tag === 256) { - return -1; - } else { - return 1; - } - } else { - var tag_a = a.tag | 0; - var tag_b = b.tag | 0; - if (tag_a === 250) { - _a = a[0]; - continue ; - } else if (tag_b === 250) { - _b = b[0]; - continue ; - } else if (tag_a === 256) { - if (tag_b === 256) { - return Caml_primitive.caml_int_compare(a[1], b[1]); - } else { - return -1; - } - } else if (tag_a === 248) { - return Caml_primitive.caml_int_compare(a[1], b[1]); - } else { - if (tag_a === 251) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "equal: abstract value" - ]; - } - if (tag_a !== tag_b) { - if (tag_a < tag_b) { - return -1; - } else { - return 1; - } - } else { - var len_a = a.length | 0; - var len_b = b.length | 0; - if (len_a === len_b) { - if (Array.isArray(a)) { - var a$1 = a; - var b$1 = b; - var _i = 0; - var same_length = len_a; - while(true) { - var i = _i; - if (i === same_length) { - return 0; - } else { - var res = caml_compare(a$1[i], b$1[i]); - if (res !== 0) { - return res; - } else { - _i = i + 1 | 0; - continue ; - } - } - }; - } else if ((a instanceof Date && b instanceof Date)) { - return (a - b); - } else { - var a$2 = a; - var b$2 = b; - var min_key_lhs = { - contents: undefined - }; - var min_key_rhs = { - contents: undefined - }; - var do_key = function (param, key) { - var min_key = param[2]; - var b = param[1]; - if (!b.hasOwnProperty(key) || caml_compare(param[0][key], b[key]) > 0) { - var match = min_key.contents; - if (match !== undefined && key >= match) { - return 0; - } else { - min_key.contents = key; - return /* () */0; - } - } else { - return 0; - } - }; - var partial_arg = /* tuple */[ - a$2, - b$2, - min_key_rhs - ]; - var do_key_a = (function(partial_arg){ - return function do_key_a(param) { - return do_key(partial_arg, param); - } - }(partial_arg)); - var partial_arg$1 = /* tuple */[ - b$2, - a$2, - min_key_lhs - ]; - var do_key_b = (function(partial_arg$1){ - return function do_key_b(param) { - return do_key(partial_arg$1, param); - } - }(partial_arg$1)); - for_in(a$2, do_key_a); - for_in(b$2, do_key_b); - var match = min_key_lhs.contents; - var match$1 = min_key_rhs.contents; - if (match !== undefined) { - if (match$1 !== undefined) { - return Caml_primitive.caml_string_compare(match, match$1); - } else { - return -1; - } - } else if (match$1 !== undefined) { - return 1; - } else { - return 0; - } - } - } else if (len_a < len_b) { - var a$3 = a; - var b$3 = b; - var _i$1 = 0; - var short_length = len_a; - while(true) { - var i$1 = _i$1; - if (i$1 === short_length) { - return -1; - } else { - var res$1 = caml_compare(a$3[i$1], b$3[i$1]); - if (res$1 !== 0) { - return res$1; - } else { - _i$1 = i$1 + 1 | 0; - continue ; - } - } - }; - } else { - var a$4 = a; - var b$4 = b; - var _i$2 = 0; - var short_length$1 = len_b; - while(true) { - var i$2 = _i$2; - if (i$2 === short_length$1) { - return 1; - } else { - var res$2 = caml_compare(a$4[i$2], b$4[i$2]); - if (res$2 !== 0) { - return res$2; - } else { - _i$2 = i$2 + 1 | 0; - continue ; - } - } - }; - } - } - } - } - } - } - }; -} - -function caml_equal(_a, _b) { - while(true) { - var b = _b; - var a = _a; - if (a === b) { - return true; - } else { - var a_type = typeof a; - if (a_type === "string" || a_type === "number" || a_type === "boolean" || a_type === "undefined" || a === null) { - return false; - } else { - var b_type = typeof b; - if (a_type === "function" || b_type === "function") { - throw [ - Caml_builtin_exceptions.invalid_argument, - "equal: functional value" - ]; - } - if (b_type === "number" || b_type === "undefined" || b === null) { - return false; - } else { - var tag_a = a.tag | 0; - var tag_b = b.tag | 0; - if (tag_a === 250) { - _a = a[0]; - continue ; - } else if (tag_b === 250) { - _b = b[0]; - continue ; - } else if (tag_a === 248) { - return a[1] === b[1]; - } else { - if (tag_a === 251) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "equal: abstract value" - ]; - } - if (tag_a !== tag_b) { - return false; - } else if (tag_a === 256) { - return a[1] === b[1]; - } else { - var len_a = a.length | 0; - var len_b = b.length | 0; - if (len_a === len_b) { - if (Array.isArray(a)) { - var a$1 = a; - var b$1 = b; - var _i = 0; - var same_length = len_a; - while(true) { - var i = _i; - if (i === same_length) { - return true; - } else if (caml_equal(a$1[i], b$1[i])) { - _i = i + 1 | 0; - continue ; - } else { - return false; - } - }; - } else if ((a instanceof Date && b instanceof Date)) { - return !(a > b || a < b); - } else { - var a$2 = a; - var b$2 = b; - var result = { - contents: true - }; - var do_key_a = (function(b$2,result){ - return function do_key_a(key) { - if (b$2.hasOwnProperty(key)) { - return 0; - } else { - result.contents = false; - return /* () */0; - } - } - }(b$2,result)); - var do_key_b = (function(a$2,b$2,result){ - return function do_key_b(key) { - if (!a$2.hasOwnProperty(key) || !caml_equal(b$2[key], a$2[key])) { - result.contents = false; - return /* () */0; - } else { - return 0; - } - } - }(a$2,b$2,result)); - for_in(a$2, do_key_a); - if (result.contents) { - for_in(b$2, do_key_b); - } - return result.contents; - } - } else { - return false; - } - } - } - } - } - } - }; -} - -function caml_equal_null(x, y) { - if (y !== null) { - return caml_equal(x, y); - } else { - return x === y; - } -} - -function caml_equal_undefined(x, y) { - if (y !== undefined) { - return caml_equal(x, y); - } else { - return x === y; - } -} - -function caml_equal_nullable(x, y) { - if (y == null) { - return x === y; - } else { - return caml_equal(x, y); - } -} - -function caml_notequal(a, b) { - return !caml_equal(a, b); -} - -function caml_greaterequal(a, b) { - return caml_compare(a, b) >= 0; -} - -function caml_greaterthan(a, b) { - return caml_compare(a, b) > 0; -} - -function caml_lessequal(a, b) { - return caml_compare(a, b) <= 0; -} - -function caml_lessthan(a, b) { - return caml_compare(a, b) < 0; -} - -function caml_min(x, y) { - if (caml_compare(x, y) <= 0) { - return x; - } else { - return y; - } -} - -function caml_max(x, y) { - if (caml_compare(x, y) >= 0) { - return x; - } else { - return y; - } -} - -function caml_obj_set_tag(prim, prim$1) { - prim.tag = prim$1; - return /* () */0; -} - -exports.caml_obj_block = caml_obj_block; -exports.caml_obj_dup = caml_obj_dup; -exports.caml_obj_truncate = caml_obj_truncate; -exports.caml_lazy_make_forward = caml_lazy_make_forward; -exports.caml_lazy_make = caml_lazy_make; -exports.caml_update_dummy = caml_update_dummy; -exports.caml_compare = caml_compare; -exports.caml_equal = caml_equal; -exports.caml_equal_null = caml_equal_null; -exports.caml_equal_undefined = caml_equal_undefined; -exports.caml_equal_nullable = caml_equal_nullable; -exports.caml_notequal = caml_notequal; -exports.caml_greaterequal = caml_greaterequal; -exports.caml_greaterthan = caml_greaterthan; -exports.caml_lessthan = caml_lessthan; -exports.caml_lessequal = caml_lessequal; -exports.caml_min = caml_min; -exports.caml_max = caml_max; -exports.caml_obj_set_tag = caml_obj_set_tag; -/* No side effect */ - -},{"./block.js":36,"./caml_builtin_exceptions.js":40,"./caml_primitive.js":51}],50:[function(require,module,exports){ -'use strict'; - - -var undefinedHeader = []; - -function some(x) { - if (x === undefined) { - var block = /* tuple */[ - undefinedHeader, - 0 - ]; - block.tag = 256; - return block; - } else if (x !== null && x[0] === undefinedHeader) { - var nid = x[1] + 1 | 0; - var block$1 = /* tuple */[ - undefinedHeader, - nid - ]; - block$1.tag = 256; - return block$1; - } else { - return x; - } -} - -function nullable_to_opt(x) { - if (x === null || x === undefined) { - return ; - } else { - return some(x); - } -} - -function undefined_to_opt(x) { - if (x === undefined) { - return ; - } else { - return some(x); - } -} - -function null_to_opt(x) { - if (x === null) { - return ; - } else { - return some(x); - } -} - -function valFromOption(x) { - if (x !== null && x[0] === undefinedHeader) { - var depth = x[1]; - if (depth === 0) { - return ; - } else { - return /* tuple */[ - undefinedHeader, - depth - 1 | 0 - ]; - } - } else { - return x; - } -} - -function option_get(x) { - if (x === undefined) { - return ; - } else { - return valFromOption(x); - } -} - -function option_get_unwrap(x) { - if (x === undefined) { - return ; - } else { - return valFromOption(x)[1]; - } -} - -exports.nullable_to_opt = nullable_to_opt; -exports.undefined_to_opt = undefined_to_opt; -exports.null_to_opt = null_to_opt; -exports.valFromOption = valFromOption; -exports.some = some; -exports.option_get = option_get; -exports.option_get_unwrap = option_get_unwrap; -/* No side effect */ - -},{}],51:[function(require,module,exports){ -'use strict'; - - -function caml_int_compare(x, y) { - if (x < y) { - return -1; - } else if (x === y) { - return 0; - } else { - return 1; - } -} - -function caml_bool_compare(x, y) { - if (x) { - if (y) { - return 0; - } else { - return 1; - } - } else if (y) { - return -1; - } else { - return 0; - } -} - -function caml_float_compare(x, y) { - if (x === y) { - return 0; - } else if (x < y) { - return -1; - } else if (x > y || x === x) { - return 1; - } else if (y === y) { - return -1; - } else { - return 0; - } -} - -function caml_string_compare(s1, s2) { - if (s1 === s2) { - return 0; - } else if (s1 < s2) { - return -1; - } else { - return 1; - } -} - -function caml_bytes_compare_aux(s1, s2, _off, len, def) { - while(true) { - var off = _off; - if (off < len) { - var a = s1[off]; - var b = s2[off]; - if (a > b) { - return 1; - } else if (a < b) { - return -1; - } else { - _off = off + 1 | 0; - continue ; - } - } else { - return def; - } - }; -} - -function caml_bytes_compare(s1, s2) { - var len1 = s1.length; - var len2 = s2.length; - if (len1 === len2) { - return caml_bytes_compare_aux(s1, s2, 0, len1, 0); - } else if (len1 < len2) { - return caml_bytes_compare_aux(s1, s2, 0, len1, -1); - } else { - return caml_bytes_compare_aux(s1, s2, 0, len2, 1); - } -} - -function caml_bytes_equal(s1, s2) { - var len1 = s1.length; - var len2 = s2.length; - if (len1 === len2) { - var s1$1 = s1; - var s2$1 = s2; - var _off = 0; - var len = len1; - while(true) { - var off = _off; - if (off === len) { - return true; - } else { - var a = s1$1[off]; - var b = s2$1[off]; - if (a === b) { - _off = off + 1 | 0; - continue ; - } else { - return false; - } - } - }; - } else { - return false; - } -} - -function caml_bool_min(x, y) { - if (x) { - return y; - } else { - return x; - } -} - -function caml_int_min(x, y) { - if (x < y) { - return x; - } else { - return y; - } -} - -function caml_float_min(x, y) { - if (x < y) { - return x; - } else { - return y; - } -} - -function caml_string_min(x, y) { - if (x < y) { - return x; - } else { - return y; - } -} - -function caml_nativeint_min(x, y) { - if (x < y) { - return x; - } else { - return y; - } -} - -function caml_int32_min(x, y) { - if (x < y) { - return x; - } else { - return y; - } -} - -function caml_bool_max(x, y) { - if (x) { - return x; - } else { - return y; - } -} - -function caml_int_max(x, y) { - if (x > y) { - return x; - } else { - return y; - } -} - -function caml_float_max(x, y) { - if (x > y) { - return x; - } else { - return y; - } -} - -function caml_string_max(x, y) { - if (x > y) { - return x; - } else { - return y; - } -} - -function caml_nativeint_max(x, y) { - if (x > y) { - return x; - } else { - return y; - } -} - -function caml_int32_max(x, y) { - if (x > y) { - return x; - } else { - return y; - } -} - -var caml_nativeint_compare = caml_int_compare; - -var caml_int32_compare = caml_int_compare; - -exports.caml_bytes_compare = caml_bytes_compare; -exports.caml_bytes_equal = caml_bytes_equal; -exports.caml_int_compare = caml_int_compare; -exports.caml_bool_compare = caml_bool_compare; -exports.caml_float_compare = caml_float_compare; -exports.caml_nativeint_compare = caml_nativeint_compare; -exports.caml_string_compare = caml_string_compare; -exports.caml_int32_compare = caml_int32_compare; -exports.caml_bool_min = caml_bool_min; -exports.caml_int_min = caml_int_min; -exports.caml_float_min = caml_float_min; -exports.caml_string_min = caml_string_min; -exports.caml_nativeint_min = caml_nativeint_min; -exports.caml_int32_min = caml_int32_min; -exports.caml_bool_max = caml_bool_max; -exports.caml_int_max = caml_int_max; -exports.caml_float_max = caml_float_max; -exports.caml_string_max = caml_string_max; -exports.caml_nativeint_max = caml_nativeint_max; -exports.caml_int32_max = caml_int32_max; -/* No side effect */ - -},{}],52:[function(require,module,exports){ -'use strict'; - -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function caml_string_get(s, i) { - if (i >= s.length || i < 0) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "index out of bounds" - ]; - } - return s.charCodeAt(i); -} - -function caml_string_get16(s, i) { - return s.charCodeAt(i) + (s.charCodeAt(i + 1 | 0) << 8) | 0; -} - -function caml_string_get32(s, i) { - return ((s.charCodeAt(i) + (s.charCodeAt(i + 1 | 0) << 8) | 0) + (s.charCodeAt(i + 2 | 0) << 16) | 0) + (s.charCodeAt(i + 3 | 0) << 24) | 0; -} - -function get(s, i) { - if (i < 0 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "index out of bounds" - ]; - } - return s.charCodeAt(i); -} - -exports.caml_string_get = caml_string_get; -exports.caml_string_get16 = caml_string_get16; -exports.caml_string_get32 = caml_string_get32; -exports.get = get; -/* No side effect */ - -},{"./caml_builtin_exceptions.js":40}],53:[function(require,module,exports){ -(function (process){ -'use strict'; - -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function caml_sys_getenv(s) { - if (typeof process === "undefined" || process.env === undefined) { - throw Caml_builtin_exceptions.not_found; - } - var match = process.env[s]; - if (match !== undefined) { - return match; - } else { - throw Caml_builtin_exceptions.not_found; - } -} - -function caml_sys_time(param) { - if (typeof process === "undefined" || process.uptime === undefined) { - return -1; - } else { - return process.uptime(); - } -} - -function caml_sys_random_seed(param) { - return [((Date.now() | 0) ^ 4294967295) * Math.random() | 0]; -} - -function caml_sys_system_command(_cmd) { - return 127; -} - -var caml_sys_getcwd = (function(param){ - if (typeof process === "undefined" || process.cwd === undefined){ - return "/" - } - return process.cwd() - }); - -function caml_sys_get_argv(param) { - if (typeof process === "undefined") { - return /* tuple */[ - "", - [""] - ]; - } else { - var argv = process.argv; - if (argv == null) { - return /* tuple */[ - "", - [""] - ]; - } else { - return /* tuple */[ - argv[0], - argv - ]; - } - } -} - -function caml_sys_exit(exit_code) { - if (typeof process !== "undefined") { - return process.exit(exit_code); - } else { - return 0; - } -} - -function caml_sys_is_directory(_s) { - throw [ - Caml_builtin_exceptions.failure, - "caml_sys_is_directory not implemented" - ]; -} - -function caml_sys_file_exists(_s) { - throw [ - Caml_builtin_exceptions.failure, - "caml_sys_file_exists not implemented" - ]; -} - -exports.caml_sys_getenv = caml_sys_getenv; -exports.caml_sys_time = caml_sys_time; -exports.caml_sys_random_seed = caml_sys_random_seed; -exports.caml_sys_system_command = caml_sys_system_command; -exports.caml_sys_getcwd = caml_sys_getcwd; -exports.caml_sys_get_argv = caml_sys_get_argv; -exports.caml_sys_exit = caml_sys_exit; -exports.caml_sys_is_directory = caml_sys_is_directory; -exports.caml_sys_file_exists = caml_sys_file_exists; -/* No side effect */ - -}).call(this,require('_process')) -},{"./caml_builtin_exceptions.js":40,"_process":65}],54:[function(require,module,exports){ -'use strict'; - - -var repeat = (function(count,self){ - if (self.repeat){ - return self.repeat(count) - } - if (self.length == 0 || count == 0) { - return ''; - } - // Ensuring count is a 31-bit integer allows us to heavily optimize the - // main part. But anyway, most current (August 2014) browsers can't handle - // strings 1 << 28 chars or longer, so: - if (self.length * count >= 1 << 28) { - throw new RangeError('repeat count must not overflow maximum string size'); - } - var rpt = ''; - for (;;) { - if ((count & 1) == 1) { - rpt += self; - } - count >>>= 1; - if (count == 0) { - break; - } - self += self; - } - return rpt; -}); - -exports.repeat = repeat; -/* No side effect */ - -},{}],55:[function(require,module,exports){ -'use strict'; - -var Char = require("./char.js"); -var Block = require("./block.js"); -var Bytes = require("./bytes.js"); -var Curry = require("./curry.js"); -var $$Buffer = require("./buffer.js"); -var $$String = require("./string.js"); -var Caml_io = require("./caml_io.js"); -var Caml_obj = require("./caml_obj.js"); -var Caml_bytes = require("./caml_bytes.js"); -var Caml_int32 = require("./caml_int32.js"); -var Pervasives = require("./pervasives.js"); -var Caml_format = require("./caml_format.js"); -var Caml_string = require("./caml_string.js"); -var Caml_primitive = require("./caml_primitive.js"); -var Caml_exceptions = require("./caml_exceptions.js"); -var Caml_js_exceptions = require("./caml_js_exceptions.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); -var CamlinternalFormatBasics = require("./camlinternalFormatBasics.js"); - -function create_char_set(param) { - return Bytes.make(32, /* "\000" */0); -} - -function add_in_char_set(char_set, c) { - var str_ind = (c >>> 3); - var mask = (1 << (c & 7)); - char_set[str_ind] = Pervasives.char_of_int(Caml_bytes.get(char_set, str_ind) | mask); - return /* () */0; -} - -var freeze_char_set = Bytes.to_string; - -function rev_char_set(char_set) { - var char_set$prime = Bytes.make(32, /* "\000" */0); - for(var i = 0; i <= 31; ++i){ - char_set$prime[i] = Pervasives.char_of_int(Caml_string.get(char_set, i) ^ 255); - } - return Caml_bytes.bytes_to_string(char_set$prime); -} - -function is_in_char_set(char_set, c) { - var str_ind = (c >>> 3); - var mask = (1 << (c & 7)); - return (Caml_string.get(char_set, str_ind) & mask) !== 0; -} - -function pad_of_pad_opt(pad_opt) { - if (pad_opt !== undefined) { - return /* Lit_padding */Block.__(0, [ - /* Right */1, - pad_opt - ]); - } else { - return /* No_padding */0; - } -} - -function prec_of_prec_opt(prec_opt) { - if (prec_opt !== undefined) { - return /* Lit_precision */[prec_opt]; - } else { - return /* No_precision */0; - } -} - -function param_format_of_ignored_format(ign, fmt) { - if (typeof ign === "number") { - switch (ign) { - case /* Ignored_char */0 : - return /* Param_format_EBB */[/* Char */Block.__(0, [fmt])]; - case /* Ignored_caml_char */1 : - return /* Param_format_EBB */[/* Caml_char */Block.__(1, [fmt])]; - case /* Ignored_reader */2 : - return /* Param_format_EBB */[/* Reader */Block.__(19, [fmt])]; - case /* Ignored_scan_next_char */3 : - return /* Param_format_EBB */[/* Scan_next_char */Block.__(22, [fmt])]; - - } - } else { - switch (ign.tag | 0) { - case /* Ignored_string */0 : - return /* Param_format_EBB */[/* String */Block.__(2, [ - pad_of_pad_opt(ign[0]), - fmt - ])]; - case /* Ignored_caml_string */1 : - return /* Param_format_EBB */[/* Caml_string */Block.__(3, [ - pad_of_pad_opt(ign[0]), - fmt - ])]; - case /* Ignored_int */2 : - return /* Param_format_EBB */[/* Int */Block.__(4, [ - ign[0], - pad_of_pad_opt(ign[1]), - /* No_precision */0, - fmt - ])]; - case /* Ignored_int32 */3 : - return /* Param_format_EBB */[/* Int32 */Block.__(5, [ - ign[0], - pad_of_pad_opt(ign[1]), - /* No_precision */0, - fmt - ])]; - case /* Ignored_nativeint */4 : - return /* Param_format_EBB */[/* Nativeint */Block.__(6, [ - ign[0], - pad_of_pad_opt(ign[1]), - /* No_precision */0, - fmt - ])]; - case /* Ignored_int64 */5 : - return /* Param_format_EBB */[/* Int64 */Block.__(7, [ - ign[0], - pad_of_pad_opt(ign[1]), - /* No_precision */0, - fmt - ])]; - case /* Ignored_float */6 : - return /* Param_format_EBB */[/* Float */Block.__(8, [ - /* Float_f */0, - pad_of_pad_opt(ign[0]), - prec_of_prec_opt(ign[1]), - fmt - ])]; - case /* Ignored_bool */7 : - return /* Param_format_EBB */[/* Bool */Block.__(9, [ - pad_of_pad_opt(ign[0]), - fmt - ])]; - case /* Ignored_format_arg */8 : - return /* Param_format_EBB */[/* Format_arg */Block.__(13, [ - ign[0], - ign[1], - fmt - ])]; - case /* Ignored_format_subst */9 : - return /* Param_format_EBB */[/* Format_subst */Block.__(14, [ - ign[0], - ign[1], - fmt - ])]; - case /* Ignored_scan_char_set */10 : - return /* Param_format_EBB */[/* Scan_char_set */Block.__(20, [ - ign[0], - ign[1], - fmt - ])]; - case /* Ignored_scan_get_counter */11 : - return /* Param_format_EBB */[/* Scan_get_counter */Block.__(21, [ - ign[0], - fmt - ])]; - - } - } -} - -function buffer_check_size(buf, overhead) { - var len = buf.bytes.length; - var min_len = buf.ind + overhead | 0; - if (min_len > len) { - var new_len = Caml_primitive.caml_int_max((len << 1), min_len); - var new_str = Caml_bytes.caml_create_bytes(new_len); - Bytes.blit(buf.bytes, 0, new_str, 0, len); - buf.bytes = new_str; - return /* () */0; - } else { - return 0; - } -} - -function buffer_add_char(buf, c) { - buffer_check_size(buf, 1); - buf.bytes[buf.ind] = c; - buf.ind = buf.ind + 1 | 0; - return /* () */0; -} - -function buffer_add_string(buf, s) { - var str_len = s.length; - buffer_check_size(buf, str_len); - $$String.blit(s, 0, buf.bytes, buf.ind, str_len); - buf.ind = buf.ind + str_len | 0; - return /* () */0; -} - -function buffer_contents(buf) { - return Bytes.sub_string(buf.bytes, 0, buf.ind); -} - -function char_of_iconv(iconv) { - switch (iconv) { - case /* Int_d */0 : - case /* Int_pd */1 : - case /* Int_sd */2 : - return /* "d" */100; - case /* Int_i */3 : - case /* Int_pi */4 : - case /* Int_si */5 : - return /* "i" */105; - case /* Int_x */6 : - case /* Int_Cx */7 : - return /* "x" */120; - case /* Int_X */8 : - case /* Int_CX */9 : - return /* "X" */88; - case /* Int_o */10 : - case /* Int_Co */11 : - return /* "o" */111; - case /* Int_u */12 : - return /* "u" */117; - - } -} - -function char_of_fconv(fconv) { - switch (fconv) { - case /* Float_f */0 : - case /* Float_pf */1 : - case /* Float_sf */2 : - return /* "f" */102; - case /* Float_e */3 : - case /* Float_pe */4 : - case /* Float_se */5 : - return /* "e" */101; - case /* Float_E */6 : - case /* Float_pE */7 : - case /* Float_sE */8 : - return /* "E" */69; - case /* Float_g */9 : - case /* Float_pg */10 : - case /* Float_sg */11 : - return /* "g" */103; - case /* Float_G */12 : - case /* Float_pG */13 : - case /* Float_sG */14 : - return /* "G" */71; - case /* Float_F */15 : - return /* "F" */70; - case /* Float_h */16 : - case /* Float_ph */17 : - case /* Float_sh */18 : - return /* "h" */104; - case /* Float_H */19 : - case /* Float_pH */20 : - case /* Float_sH */21 : - return /* "H" */72; - - } -} - -function char_of_counter(counter) { - switch (counter) { - case /* Line_counter */0 : - return /* "l" */108; - case /* Char_counter */1 : - return /* "n" */110; - case /* Token_counter */2 : - return /* "N" */78; - - } -} - -function bprint_char_set(buf, char_set) { - var print_char = function (buf, i) { - var c = Pervasives.char_of_int(i); - if (c !== 37) { - if (c !== 64) { - return buffer_add_char(buf, c); - } else { - buffer_add_char(buf, /* "%" */37); - return buffer_add_char(buf, /* "@" */64); - } - } else { - buffer_add_char(buf, /* "%" */37); - return buffer_add_char(buf, /* "%" */37); - } - }; - var print_out = function (set, _i) { - while(true) { - var i = _i; - if (i < 256) { - if (is_in_char_set(set, Pervasives.char_of_int(i))) { - var set$1 = set; - var i$1 = i; - var match = Pervasives.char_of_int(i$1); - var switcher = match - 45 | 0; - if (switcher > 48 || switcher < 0) { - if (switcher >= 210) { - return print_char(buf, 255); - } else { - return print_second(set$1, i$1 + 1 | 0); - } - } else if (switcher > 47 || switcher < 1) { - return print_out(set$1, i$1 + 1 | 0); - } else { - return print_second(set$1, i$1 + 1 | 0); - } - } else { - _i = i + 1 | 0; - continue ; - } - } else { - return 0; - } - }; - }; - var print_second = function (set, i) { - if (is_in_char_set(set, Pervasives.char_of_int(i))) { - var match = Pervasives.char_of_int(i); - var switcher = match - 45 | 0; - if (switcher > 48 || switcher < 0) { - if (switcher >= 210) { - print_char(buf, 254); - return print_char(buf, 255); - } - - } else if ((switcher > 47 || switcher < 1) && !is_in_char_set(set, Pervasives.char_of_int(i + 1 | 0))) { - print_char(buf, i - 1 | 0); - return print_out(set, i + 1 | 0); - } - if (is_in_char_set(set, Pervasives.char_of_int(i + 1 | 0))) { - var set$1 = set; - var i$1 = i - 1 | 0; - var _j = i + 2 | 0; - while(true) { - var j = _j; - if (j === 256 || !is_in_char_set(set$1, Pervasives.char_of_int(j))) { - print_char(buf, i$1); - print_char(buf, /* "-" */45); - print_char(buf, j - 1 | 0); - if (j < 256) { - return print_out(set$1, j + 1 | 0); - } else { - return 0; - } - } else { - _j = j + 1 | 0; - continue ; - } - }; - } else { - print_char(buf, i - 1 | 0); - print_char(buf, i); - return print_out(set, i + 2 | 0); - } - } else { - print_char(buf, i - 1 | 0); - return print_out(set, i + 1 | 0); - } - }; - var print_start = function (set) { - var is_alone = function (c) { - var before = Char.chr(c - 1 | 0); - var after = Char.chr(c + 1 | 0); - if (is_in_char_set(set, c)) { - return !(is_in_char_set(set, before) && is_in_char_set(set, after)); - } else { - return false; - } - }; - if (is_alone(/* "]" */93)) { - buffer_add_char(buf, /* "]" */93); - } - print_out(set, 1); - if (is_alone(/* "-" */45)) { - return buffer_add_char(buf, /* "-" */45); - } else { - return 0; - } - }; - buffer_add_char(buf, /* "[" */91); - print_start(is_in_char_set(char_set, /* "\000" */0) ? (buffer_add_char(buf, /* "^" */94), rev_char_set(char_set)) : char_set); - return buffer_add_char(buf, /* "]" */93); -} - -function bprint_padty(buf, padty) { - switch (padty) { - case /* Left */0 : - return buffer_add_char(buf, /* "-" */45); - case /* Right */1 : - return /* () */0; - case /* Zeros */2 : - return buffer_add_char(buf, /* "0" */48); - - } -} - -function bprint_ignored_flag(buf, ign_flag) { - if (ign_flag) { - return buffer_add_char(buf, /* "_" */95); - } else { - return 0; - } -} - -function bprint_pad_opt(buf, pad_opt) { - if (pad_opt !== undefined) { - return buffer_add_string(buf, String(pad_opt)); - } else { - return /* () */0; - } -} - -function bprint_padding(buf, pad) { - if (typeof pad === "number") { - return /* () */0; - } else { - bprint_padty(buf, pad[0]); - if (pad.tag) { - return buffer_add_char(buf, /* "*" */42); - } else { - return buffer_add_string(buf, String(pad[1])); - } - } -} - -function bprint_precision(buf, prec) { - if (typeof prec === "number") { - if (prec !== 0) { - return buffer_add_string(buf, ".*"); - } else { - return /* () */0; - } - } else { - buffer_add_char(buf, /* "." */46); - return buffer_add_string(buf, String(prec[0])); - } -} - -function bprint_iconv_flag(buf, iconv) { - switch (iconv) { - case /* Int_pd */1 : - case /* Int_pi */4 : - return buffer_add_char(buf, /* "+" */43); - case /* Int_sd */2 : - case /* Int_si */5 : - return buffer_add_char(buf, /* " " */32); - case /* Int_Cx */7 : - case /* Int_CX */9 : - case /* Int_Co */11 : - return buffer_add_char(buf, /* "#" */35); - case /* Int_d */0 : - case /* Int_i */3 : - case /* Int_x */6 : - case /* Int_X */8 : - case /* Int_o */10 : - case /* Int_u */12 : - return /* () */0; - - } -} - -function bprint_int_fmt(buf, ign_flag, iconv, pad, prec) { - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_iconv_flag(buf, iconv); - bprint_padding(buf, pad); - bprint_precision(buf, prec); - return buffer_add_char(buf, char_of_iconv(iconv)); -} - -function bprint_altint_fmt(buf, ign_flag, iconv, pad, prec, c) { - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_iconv_flag(buf, iconv); - bprint_padding(buf, pad); - bprint_precision(buf, prec); - buffer_add_char(buf, c); - return buffer_add_char(buf, char_of_iconv(iconv)); -} - -function bprint_fconv_flag(buf, fconv) { - switch (fconv) { - case /* Float_f */0 : - case /* Float_e */3 : - case /* Float_E */6 : - case /* Float_g */9 : - case /* Float_G */12 : - case /* Float_F */15 : - case /* Float_h */16 : - case /* Float_H */19 : - return /* () */0; - case /* Float_pf */1 : - case /* Float_pe */4 : - case /* Float_pE */7 : - case /* Float_pg */10 : - case /* Float_pG */13 : - case /* Float_ph */17 : - case /* Float_pH */20 : - return buffer_add_char(buf, /* "+" */43); - case /* Float_sf */2 : - case /* Float_se */5 : - case /* Float_sE */8 : - case /* Float_sg */11 : - case /* Float_sG */14 : - case /* Float_sh */18 : - case /* Float_sH */21 : - return buffer_add_char(buf, /* " " */32); - - } -} - -function bprint_float_fmt(buf, ign_flag, fconv, pad, prec) { - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_fconv_flag(buf, fconv); - bprint_padding(buf, pad); - bprint_precision(buf, prec); - return buffer_add_char(buf, char_of_fconv(fconv)); -} - -function string_of_formatting_lit(formatting_lit) { - if (typeof formatting_lit === "number") { - switch (formatting_lit) { - case /* Close_box */0 : - return "@]"; - case /* Close_tag */1 : - return "@}"; - case /* FFlush */2 : - return "@?"; - case /* Force_newline */3 : - return "@\n"; - case /* Flush_newline */4 : - return "@."; - case /* Escaped_at */5 : - return "@@"; - case /* Escaped_percent */6 : - return "@%"; - - } - } else { - switch (formatting_lit.tag | 0) { - case /* Break */0 : - case /* Magic_size */1 : - return formatting_lit[0]; - case /* Scan_indic */2 : - return "@" + Caml_bytes.bytes_to_string(Bytes.make(1, formatting_lit[0])); - - } - } -} - -function string_of_formatting_gen(formatting_gen) { - return formatting_gen[0][1]; -} - -function bprint_char_literal(buf, chr) { - if (chr !== 37) { - return buffer_add_char(buf, chr); - } else { - return buffer_add_string(buf, "%%"); - } -} - -function bprint_string_literal(buf, str) { - for(var i = 0 ,i_finish = str.length - 1 | 0; i <= i_finish; ++i){ - bprint_char_literal(buf, Caml_string.get(str, i)); - } - return /* () */0; -} - -function bprint_fmtty(buf, _fmtty) { - while(true) { - var fmtty = _fmtty; - if (typeof fmtty === "number") { - return /* () */0; - } else { - switch (fmtty.tag | 0) { - case /* Char_ty */0 : - buffer_add_string(buf, "%c"); - _fmtty = fmtty[0]; - continue ; - case /* String_ty */1 : - buffer_add_string(buf, "%s"); - _fmtty = fmtty[0]; - continue ; - case /* Int_ty */2 : - buffer_add_string(buf, "%i"); - _fmtty = fmtty[0]; - continue ; - case /* Int32_ty */3 : - buffer_add_string(buf, "%li"); - _fmtty = fmtty[0]; - continue ; - case /* Nativeint_ty */4 : - buffer_add_string(buf, "%ni"); - _fmtty = fmtty[0]; - continue ; - case /* Int64_ty */5 : - buffer_add_string(buf, "%Li"); - _fmtty = fmtty[0]; - continue ; - case /* Float_ty */6 : - buffer_add_string(buf, "%f"); - _fmtty = fmtty[0]; - continue ; - case /* Bool_ty */7 : - buffer_add_string(buf, "%B"); - _fmtty = fmtty[0]; - continue ; - case /* Format_arg_ty */8 : - buffer_add_string(buf, "%{"); - bprint_fmtty(buf, fmtty[0]); - buffer_add_string(buf, "%}"); - _fmtty = fmtty[1]; - continue ; - case /* Format_subst_ty */9 : - buffer_add_string(buf, "%("); - bprint_fmtty(buf, fmtty[0]); - buffer_add_string(buf, "%)"); - _fmtty = fmtty[2]; - continue ; - case /* Alpha_ty */10 : - buffer_add_string(buf, "%a"); - _fmtty = fmtty[0]; - continue ; - case /* Theta_ty */11 : - buffer_add_string(buf, "%t"); - _fmtty = fmtty[0]; - continue ; - case /* Any_ty */12 : - buffer_add_string(buf, "%?"); - _fmtty = fmtty[0]; - continue ; - case /* Reader_ty */13 : - buffer_add_string(buf, "%r"); - _fmtty = fmtty[0]; - continue ; - case /* Ignored_reader_ty */14 : - buffer_add_string(buf, "%_r"); - _fmtty = fmtty[0]; - continue ; - - } - } - }; -} - -function int_of_custom_arity(param) { - if (param) { - return 1 + int_of_custom_arity(param[0]) | 0; - } else { - return 0; - } -} - -function bprint_fmt(buf, fmt) { - var _fmt = fmt; - var _ign_flag = false; - while(true) { - var ign_flag = _ign_flag; - var fmt$1 = _fmt; - if (typeof fmt$1 === "number") { - return /* () */0; - } else { - switch (fmt$1.tag | 0) { - case /* Char */0 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - buffer_add_char(buf, /* "c" */99); - _ign_flag = false; - _fmt = fmt$1[0]; - continue ; - case /* Caml_char */1 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - buffer_add_char(buf, /* "C" */67); - _ign_flag = false; - _fmt = fmt$1[0]; - continue ; - case /* String */2 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_padding(buf, fmt$1[0]); - buffer_add_char(buf, /* "s" */115); - _ign_flag = false; - _fmt = fmt$1[1]; - continue ; - case /* Caml_string */3 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_padding(buf, fmt$1[0]); - buffer_add_char(buf, /* "S" */83); - _ign_flag = false; - _fmt = fmt$1[1]; - continue ; - case /* Int */4 : - bprint_int_fmt(buf, ign_flag, fmt$1[0], fmt$1[1], fmt$1[2]); - _ign_flag = false; - _fmt = fmt$1[3]; - continue ; - case /* Int32 */5 : - bprint_altint_fmt(buf, ign_flag, fmt$1[0], fmt$1[1], fmt$1[2], /* "l" */108); - _ign_flag = false; - _fmt = fmt$1[3]; - continue ; - case /* Nativeint */6 : - bprint_altint_fmt(buf, ign_flag, fmt$1[0], fmt$1[1], fmt$1[2], /* "n" */110); - _ign_flag = false; - _fmt = fmt$1[3]; - continue ; - case /* Int64 */7 : - bprint_altint_fmt(buf, ign_flag, fmt$1[0], fmt$1[1], fmt$1[2], /* "L" */76); - _ign_flag = false; - _fmt = fmt$1[3]; - continue ; - case /* Float */8 : - bprint_float_fmt(buf, ign_flag, fmt$1[0], fmt$1[1], fmt$1[2]); - _ign_flag = false; - _fmt = fmt$1[3]; - continue ; - case /* Bool */9 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_padding(buf, fmt$1[0]); - buffer_add_char(buf, /* "B" */66); - _ign_flag = false; - _fmt = fmt$1[1]; - continue ; - case /* Flush */10 : - buffer_add_string(buf, "%!"); - _fmt = fmt$1[0]; - continue ; - case /* String_literal */11 : - bprint_string_literal(buf, fmt$1[0]); - _fmt = fmt$1[1]; - continue ; - case /* Char_literal */12 : - bprint_char_literal(buf, fmt$1[0]); - _fmt = fmt$1[1]; - continue ; - case /* Format_arg */13 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_pad_opt(buf, fmt$1[0]); - buffer_add_char(buf, /* "{" */123); - bprint_fmtty(buf, fmt$1[1]); - buffer_add_char(buf, /* "%" */37); - buffer_add_char(buf, /* "}" */125); - _ign_flag = false; - _fmt = fmt$1[2]; - continue ; - case /* Format_subst */14 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_pad_opt(buf, fmt$1[0]); - buffer_add_char(buf, /* "(" */40); - bprint_fmtty(buf, fmt$1[1]); - buffer_add_char(buf, /* "%" */37); - buffer_add_char(buf, /* ")" */41); - _ign_flag = false; - _fmt = fmt$1[2]; - continue ; - case /* Alpha */15 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - buffer_add_char(buf, /* "a" */97); - _ign_flag = false; - _fmt = fmt$1[0]; - continue ; - case /* Theta */16 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - buffer_add_char(buf, /* "t" */116); - _ign_flag = false; - _fmt = fmt$1[0]; - continue ; - case /* Formatting_lit */17 : - bprint_string_literal(buf, string_of_formatting_lit(fmt$1[0])); - _fmt = fmt$1[1]; - continue ; - case /* Formatting_gen */18 : - bprint_string_literal(buf, "@{"); - bprint_string_literal(buf, string_of_formatting_gen(fmt$1[0])); - _fmt = fmt$1[1]; - continue ; - case /* Reader */19 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - buffer_add_char(buf, /* "r" */114); - _ign_flag = false; - _fmt = fmt$1[0]; - continue ; - case /* Scan_char_set */20 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_pad_opt(buf, fmt$1[0]); - bprint_char_set(buf, fmt$1[1]); - _ign_flag = false; - _fmt = fmt$1[2]; - continue ; - case /* Scan_get_counter */21 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - buffer_add_char(buf, char_of_counter(fmt$1[0])); - _ign_flag = false; - _fmt = fmt$1[1]; - continue ; - case /* Scan_next_char */22 : - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - bprint_string_literal(buf, "0c"); - _ign_flag = false; - _fmt = fmt$1[0]; - continue ; - case /* Ignored_param */23 : - var match = param_format_of_ignored_format(fmt$1[0], fmt$1[1]); - _ign_flag = true; - _fmt = match[0]; - continue ; - case /* Custom */24 : - for(var _i = 1 ,_i_finish = int_of_custom_arity(fmt$1[0]); _i <= _i_finish; ++_i){ - buffer_add_char(buf, /* "%" */37); - bprint_ignored_flag(buf, ign_flag); - buffer_add_char(buf, /* "?" */63); - } - _ign_flag = false; - _fmt = fmt$1[2]; - continue ; - - } - } - }; -} - -function string_of_fmt(fmt) { - var buf = { - ind: 0, - bytes: Caml_bytes.caml_create_bytes(16) - }; - bprint_fmt(buf, fmt); - return buffer_contents(buf); -} - -function symm(param) { - if (typeof param === "number") { - return /* End_of_fmtty */0; - } else { - switch (param.tag | 0) { - case /* Char_ty */0 : - return /* Char_ty */Block.__(0, [symm(param[0])]); - case /* String_ty */1 : - return /* String_ty */Block.__(1, [symm(param[0])]); - case /* Int_ty */2 : - return /* Int_ty */Block.__(2, [symm(param[0])]); - case /* Int32_ty */3 : - return /* Int32_ty */Block.__(3, [symm(param[0])]); - case /* Nativeint_ty */4 : - return /* Nativeint_ty */Block.__(4, [symm(param[0])]); - case /* Int64_ty */5 : - return /* Int64_ty */Block.__(5, [symm(param[0])]); - case /* Float_ty */6 : - return /* Float_ty */Block.__(6, [symm(param[0])]); - case /* Bool_ty */7 : - return /* Bool_ty */Block.__(7, [symm(param[0])]); - case /* Format_arg_ty */8 : - return /* Format_arg_ty */Block.__(8, [ - param[0], - symm(param[1]) - ]); - case /* Format_subst_ty */9 : - return /* Format_subst_ty */Block.__(9, [ - param[1], - param[0], - symm(param[2]) - ]); - case /* Alpha_ty */10 : - return /* Alpha_ty */Block.__(10, [symm(param[0])]); - case /* Theta_ty */11 : - return /* Theta_ty */Block.__(11, [symm(param[0])]); - case /* Any_ty */12 : - return /* Any_ty */Block.__(12, [symm(param[0])]); - case /* Reader_ty */13 : - return /* Reader_ty */Block.__(13, [symm(param[0])]); - case /* Ignored_reader_ty */14 : - return /* Ignored_reader_ty */Block.__(14, [symm(param[0])]); - - } - } -} - -function fmtty_rel_det(param) { - if (typeof param === "number") { - return /* tuple */[ - (function (param) { - return /* Refl */0; - }), - (function (param) { - return /* Refl */0; - }), - (function (param) { - return /* Refl */0; - }), - (function (param) { - return /* Refl */0; - }) - ]; - } else { - switch (param.tag | 0) { - case /* Char_ty */0 : - var match = fmtty_rel_det(param[0]); - var af = match[1]; - var fa = match[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af, /* Refl */0); - return /* Refl */0; - }), - match[2], - match[3] - ]; - case /* String_ty */1 : - var match$1 = fmtty_rel_det(param[0]); - var af$1 = match$1[1]; - var fa$1 = match$1[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$1, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$1, /* Refl */0); - return /* Refl */0; - }), - match$1[2], - match$1[3] - ]; - case /* Int_ty */2 : - var match$2 = fmtty_rel_det(param[0]); - var af$2 = match$2[1]; - var fa$2 = match$2[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$2, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$2, /* Refl */0); - return /* Refl */0; - }), - match$2[2], - match$2[3] - ]; - case /* Int32_ty */3 : - var match$3 = fmtty_rel_det(param[0]); - var af$3 = match$3[1]; - var fa$3 = match$3[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$3, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$3, /* Refl */0); - return /* Refl */0; - }), - match$3[2], - match$3[3] - ]; - case /* Nativeint_ty */4 : - var match$4 = fmtty_rel_det(param[0]); - var af$4 = match$4[1]; - var fa$4 = match$4[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$4, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$4, /* Refl */0); - return /* Refl */0; - }), - match$4[2], - match$4[3] - ]; - case /* Int64_ty */5 : - var match$5 = fmtty_rel_det(param[0]); - var af$5 = match$5[1]; - var fa$5 = match$5[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$5, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$5, /* Refl */0); - return /* Refl */0; - }), - match$5[2], - match$5[3] - ]; - case /* Float_ty */6 : - var match$6 = fmtty_rel_det(param[0]); - var af$6 = match$6[1]; - var fa$6 = match$6[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$6, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$6, /* Refl */0); - return /* Refl */0; - }), - match$6[2], - match$6[3] - ]; - case /* Bool_ty */7 : - var match$7 = fmtty_rel_det(param[0]); - var af$7 = match$7[1]; - var fa$7 = match$7[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$7, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$7, /* Refl */0); - return /* Refl */0; - }), - match$7[2], - match$7[3] - ]; - case /* Format_arg_ty */8 : - var match$8 = fmtty_rel_det(param[1]); - var af$8 = match$8[1]; - var fa$8 = match$8[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$8, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$8, /* Refl */0); - return /* Refl */0; - }), - match$8[2], - match$8[3] - ]; - case /* Format_subst_ty */9 : - var match$9 = fmtty_rel_det(param[2]); - var de = match$9[3]; - var ed = match$9[2]; - var af$9 = match$9[1]; - var fa$9 = match$9[0]; - var ty = trans(symm(param[0]), param[1]); - var match$10 = fmtty_rel_det(ty); - var jd = match$10[3]; - var dj = match$10[2]; - var ga = match$10[1]; - var ag = match$10[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$9, /* Refl */0); - Curry._1(ag, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(ga, /* Refl */0); - Curry._1(af$9, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(ed, /* Refl */0); - Curry._1(dj, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(jd, /* Refl */0); - Curry._1(de, /* Refl */0); - return /* Refl */0; - }) - ]; - case /* Alpha_ty */10 : - var match$11 = fmtty_rel_det(param[0]); - var af$10 = match$11[1]; - var fa$10 = match$11[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$10, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$10, /* Refl */0); - return /* Refl */0; - }), - match$11[2], - match$11[3] - ]; - case /* Theta_ty */11 : - var match$12 = fmtty_rel_det(param[0]); - var af$11 = match$12[1]; - var fa$11 = match$12[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$11, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$11, /* Refl */0); - return /* Refl */0; - }), - match$12[2], - match$12[3] - ]; - case /* Any_ty */12 : - var match$13 = fmtty_rel_det(param[0]); - var af$12 = match$13[1]; - var fa$12 = match$13[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$12, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$12, /* Refl */0); - return /* Refl */0; - }), - match$13[2], - match$13[3] - ]; - case /* Reader_ty */13 : - var match$14 = fmtty_rel_det(param[0]); - var de$1 = match$14[3]; - var ed$1 = match$14[2]; - var af$13 = match$14[1]; - var fa$13 = match$14[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$13, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$13, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(ed$1, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(de$1, /* Refl */0); - return /* Refl */0; - }) - ]; - case /* Ignored_reader_ty */14 : - var match$15 = fmtty_rel_det(param[0]); - var de$2 = match$15[3]; - var ed$2 = match$15[2]; - var af$14 = match$15[1]; - var fa$14 = match$15[0]; - return /* tuple */[ - (function (param) { - Curry._1(fa$14, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(af$14, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(ed$2, /* Refl */0); - return /* Refl */0; - }), - (function (param) { - Curry._1(de$2, /* Refl */0); - return /* Refl */0; - }) - ]; - - } - } -} - -function trans(ty1, ty2) { - var exit = 0; - if (typeof ty1 === "number") { - if (typeof ty2 === "number") { - return /* End_of_fmtty */0; - } else { - switch (ty2.tag | 0) { - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - default: - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 846, - 23 - ] - ]; - } - } - } else { - switch (ty1.tag | 0) { - case /* Char_ty */0 : - if (typeof ty2 === "number") { - exit = 8; - } else { - switch (ty2.tag | 0) { - case /* Char_ty */0 : - return /* Char_ty */Block.__(0, [trans(ty1[0], ty2[0])]); - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - - } - } - break; - case /* String_ty */1 : - if (typeof ty2 === "number") { - exit = 8; - } else { - switch (ty2.tag | 0) { - case /* String_ty */1 : - return /* String_ty */Block.__(1, [trans(ty1[0], ty2[0])]); - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - - } - } - break; - case /* Int_ty */2 : - if (typeof ty2 === "number") { - exit = 8; - } else { - switch (ty2.tag | 0) { - case /* Int_ty */2 : - return /* Int_ty */Block.__(2, [trans(ty1[0], ty2[0])]); - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - - } - } - break; - case /* Int32_ty */3 : - if (typeof ty2 === "number") { - exit = 8; - } else { - switch (ty2.tag | 0) { - case /* Int32_ty */3 : - return /* Int32_ty */Block.__(3, [trans(ty1[0], ty2[0])]); - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - - } - } - break; - case /* Nativeint_ty */4 : - if (typeof ty2 === "number") { - exit = 8; - } else { - switch (ty2.tag | 0) { - case /* Nativeint_ty */4 : - return /* Nativeint_ty */Block.__(4, [trans(ty1[0], ty2[0])]); - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - - } - } - break; - case /* Int64_ty */5 : - if (typeof ty2 === "number") { - exit = 8; - } else { - switch (ty2.tag | 0) { - case /* Int64_ty */5 : - return /* Int64_ty */Block.__(5, [trans(ty1[0], ty2[0])]); - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - - } - } - break; - case /* Float_ty */6 : - if (typeof ty2 === "number") { - exit = 8; - } else { - switch (ty2.tag | 0) { - case /* Float_ty */6 : - return /* Float_ty */Block.__(6, [trans(ty1[0], ty2[0])]); - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - - } - } - break; - case /* Bool_ty */7 : - if (typeof ty2 === "number") { - exit = 8; - } else { - switch (ty2.tag | 0) { - case /* Bool_ty */7 : - return /* Bool_ty */Block.__(7, [trans(ty1[0], ty2[0])]); - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - exit = 7; - break; - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - - } - } - break; - case /* Format_arg_ty */8 : - if (typeof ty2 === "number") { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 832, - 26 - ] - ]; - } else { - switch (ty2.tag | 0) { - case /* Format_arg_ty */8 : - return /* Format_arg_ty */Block.__(8, [ - trans(ty1[0], ty2[0]), - trans(ty1[1], ty2[1]) - ]); - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - default: - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 832, - 26 - ] - ]; - } - } - break; - case /* Format_subst_ty */9 : - if (typeof ty2 === "number") { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 842, - 28 - ] - ]; - } else { - switch (ty2.tag | 0) { - case /* Format_arg_ty */8 : - exit = 6; - break; - case /* Format_subst_ty */9 : - var ty = trans(symm(ty1[1]), ty2[0]); - var match = fmtty_rel_det(ty); - Curry._1(match[1], /* Refl */0); - Curry._1(match[3], /* Refl */0); - return /* Format_subst_ty */Block.__(9, [ - ty1[0], - ty2[1], - trans(ty1[2], ty2[2]) - ]); - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - exit = 5; - break; - default: - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 842, - 28 - ] - ]; - } - } - break; - case /* Alpha_ty */10 : - if (typeof ty2 === "number") { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 810, - 21 - ] - ]; - } else if (ty2.tag === /* Alpha_ty */10) { - return /* Alpha_ty */Block.__(10, [trans(ty1[0], ty2[0])]); - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 810, - 21 - ] - ]; - } - case /* Theta_ty */11 : - if (typeof ty2 === "number") { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 814, - 21 - ] - ]; - } else { - switch (ty2.tag | 0) { - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - return /* Theta_ty */Block.__(11, [trans(ty1[0], ty2[0])]); - default: - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 814, - 21 - ] - ]; - } - } - break; - case /* Any_ty */12 : - if (typeof ty2 === "number") { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 818, - 19 - ] - ]; - } else { - switch (ty2.tag | 0) { - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - return /* Any_ty */Block.__(12, [trans(ty1[0], ty2[0])]); - default: - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 818, - 19 - ] - ]; - } - } - break; - case /* Reader_ty */13 : - if (typeof ty2 === "number") { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 822, - 22 - ] - ]; - } else { - switch (ty2.tag | 0) { - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - return /* Reader_ty */Block.__(13, [trans(ty1[0], ty2[0])]); - default: - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 822, - 22 - ] - ]; - } - } - break; - case /* Ignored_reader_ty */14 : - if (typeof ty2 === "number") { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 827, - 30 - ] - ]; - } else { - switch (ty2.tag | 0) { - case /* Alpha_ty */10 : - exit = 1; - break; - case /* Theta_ty */11 : - exit = 2; - break; - case /* Any_ty */12 : - exit = 3; - break; - case /* Reader_ty */13 : - exit = 4; - break; - case /* Ignored_reader_ty */14 : - return /* Ignored_reader_ty */Block.__(14, [trans(ty1[0], ty2[0])]); - default: - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 827, - 30 - ] - ]; - } - } - break; - - } - } - switch (exit) { - case 1 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 811, - 21 - ] - ]; - case 2 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 815, - 21 - ] - ]; - case 3 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 819, - 19 - ] - ]; - case 4 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 823, - 22 - ] - ]; - case 5 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 828, - 30 - ] - ]; - case 6 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 833, - 26 - ] - ]; - case 7 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 843, - 28 - ] - ]; - case 8 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 847, - 23 - ] - ]; - - } -} - -function fmtty_of_formatting_gen(formatting_gen) { - return fmtty_of_fmt(formatting_gen[0][0]); -} - -function fmtty_of_fmt(_fmtty) { - while(true) { - var fmtty = _fmtty; - if (typeof fmtty === "number") { - return /* End_of_fmtty */0; - } else { - switch (fmtty.tag | 0) { - case /* String */2 : - case /* Caml_string */3 : - break; - case /* Int */4 : - var ty_rest = fmtty_of_fmt(fmtty[3]); - var prec_ty = fmtty_of_precision_fmtty(fmtty[2], /* Int_ty */Block.__(2, [ty_rest])); - return fmtty_of_padding_fmtty(fmtty[1], prec_ty); - case /* Int32 */5 : - var ty_rest$1 = fmtty_of_fmt(fmtty[3]); - var prec_ty$1 = fmtty_of_precision_fmtty(fmtty[2], /* Int32_ty */Block.__(3, [ty_rest$1])); - return fmtty_of_padding_fmtty(fmtty[1], prec_ty$1); - case /* Nativeint */6 : - var ty_rest$2 = fmtty_of_fmt(fmtty[3]); - var prec_ty$2 = fmtty_of_precision_fmtty(fmtty[2], /* Nativeint_ty */Block.__(4, [ty_rest$2])); - return fmtty_of_padding_fmtty(fmtty[1], prec_ty$2); - case /* Int64 */7 : - var ty_rest$3 = fmtty_of_fmt(fmtty[3]); - var prec_ty$3 = fmtty_of_precision_fmtty(fmtty[2], /* Int64_ty */Block.__(5, [ty_rest$3])); - return fmtty_of_padding_fmtty(fmtty[1], prec_ty$3); - case /* Float */8 : - var ty_rest$4 = fmtty_of_fmt(fmtty[3]); - var prec_ty$4 = fmtty_of_precision_fmtty(fmtty[2], /* Float_ty */Block.__(6, [ty_rest$4])); - return fmtty_of_padding_fmtty(fmtty[1], prec_ty$4); - case /* Bool */9 : - return fmtty_of_padding_fmtty(fmtty[0], /* Bool_ty */Block.__(7, [fmtty_of_fmt(fmtty[1])])); - case /* Flush */10 : - _fmtty = fmtty[0]; - continue ; - case /* Format_arg */13 : - return /* Format_arg_ty */Block.__(8, [ - fmtty[1], - fmtty_of_fmt(fmtty[2]) - ]); - case /* Format_subst */14 : - var ty = fmtty[1]; - return /* Format_subst_ty */Block.__(9, [ - ty, - ty, - fmtty_of_fmt(fmtty[2]) - ]); - case /* Alpha */15 : - return /* Alpha_ty */Block.__(10, [fmtty_of_fmt(fmtty[0])]); - case /* Theta */16 : - return /* Theta_ty */Block.__(11, [fmtty_of_fmt(fmtty[0])]); - case /* String_literal */11 : - case /* Char_literal */12 : - case /* Formatting_lit */17 : - _fmtty = fmtty[1]; - continue ; - case /* Formatting_gen */18 : - return CamlinternalFormatBasics.concat_fmtty(fmtty_of_formatting_gen(fmtty[0]), fmtty_of_fmt(fmtty[1])); - case /* Reader */19 : - return /* Reader_ty */Block.__(13, [fmtty_of_fmt(fmtty[0])]); - case /* Scan_char_set */20 : - return /* String_ty */Block.__(1, [fmtty_of_fmt(fmtty[2])]); - case /* Scan_get_counter */21 : - return /* Int_ty */Block.__(2, [fmtty_of_fmt(fmtty[1])]); - case /* Ignored_param */23 : - var ign = fmtty[0]; - var fmt = fmtty[1]; - if (typeof ign === "number") { - if (ign === /* Ignored_reader */2) { - return /* Ignored_reader_ty */Block.__(14, [fmtty_of_fmt(fmt)]); - } else { - return fmtty_of_fmt(fmt); - } - } else if (ign.tag === /* Ignored_format_subst */9) { - return CamlinternalFormatBasics.concat_fmtty(ign[1], fmtty_of_fmt(fmt)); - } else { - return fmtty_of_fmt(fmt); - } - case /* Custom */24 : - return fmtty_of_custom(fmtty[0], fmtty_of_fmt(fmtty[2])); - default: - return /* Char_ty */Block.__(0, [fmtty_of_fmt(fmtty[0])]); - } - } - return fmtty_of_padding_fmtty(fmtty[0], /* String_ty */Block.__(1, [fmtty_of_fmt(fmtty[1])])); - }; -} - -function fmtty_of_custom(arity, fmtty) { - if (arity) { - return /* Any_ty */Block.__(12, [fmtty_of_custom(arity[0], fmtty)]); - } else { - return fmtty; - } -} - -function fmtty_of_padding_fmtty(pad, fmtty) { - if (typeof pad === "number" || !pad.tag) { - return fmtty; - } else { - return /* Int_ty */Block.__(2, [fmtty]); - } -} - -function fmtty_of_precision_fmtty(prec, fmtty) { - if (typeof prec === "number" && prec !== 0) { - return /* Int_ty */Block.__(2, [fmtty]); - } else { - return fmtty; - } -} - -var Type_mismatch = Caml_exceptions.create("CamlinternalFormat.Type_mismatch"); - -function type_padding(pad, fmtty) { - if (typeof pad === "number") { - return /* Padding_fmtty_EBB */[ - /* No_padding */0, - fmtty - ]; - } else if (pad.tag) { - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Int_ty */2) { - return /* Padding_fmtty_EBB */[ - /* Arg_padding */Block.__(1, [pad[0]]), - fmtty[0] - ]; - } else { - throw Type_mismatch; - } - } else { - return /* Padding_fmtty_EBB */[ - /* Lit_padding */Block.__(0, [ - pad[0], - pad[1] - ]), - fmtty - ]; - } -} - -function type_padprec(pad, prec, fmtty) { - var match = type_padding(pad, fmtty); - if (typeof prec === "number") { - if (prec !== 0) { - var match$1 = match[1]; - if (typeof match$1 === "number") { - throw Type_mismatch; - } else if (match$1.tag === /* Int_ty */2) { - return /* Padprec_fmtty_EBB */[ - match[0], - /* Arg_precision */1, - match$1[0] - ]; - } else { - throw Type_mismatch; - } - } else { - return /* Padprec_fmtty_EBB */[ - match[0], - /* No_precision */0, - match[1] - ]; - } - } else { - return /* Padprec_fmtty_EBB */[ - match[0], - /* Lit_precision */[prec[0]], - match[1] - ]; - } -} - -function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { - if (typeof sub_fmtty === "number") { - return /* Fmtty_fmt_EBB */[ - /* End_of_fmtty */0, - type_format_gen(fmt, fmtty) - ]; - } else { - switch (sub_fmtty.tag | 0) { - case /* Char_ty */0 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag) { - throw Type_mismatch; - } else { - var match = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Char_ty */Block.__(0, [match[0]]), - match[1] - ]; - } - case /* String_ty */1 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* String_ty */1) { - var match$1 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* String_ty */Block.__(1, [match$1[0]]), - match$1[1] - ]; - } else { - throw Type_mismatch; - } - case /* Int_ty */2 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Int_ty */2) { - var match$2 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Int_ty */Block.__(2, [match$2[0]]), - match$2[1] - ]; - } else { - throw Type_mismatch; - } - case /* Int32_ty */3 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Int32_ty */3) { - var match$3 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Int32_ty */Block.__(3, [match$3[0]]), - match$3[1] - ]; - } else { - throw Type_mismatch; - } - case /* Nativeint_ty */4 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Nativeint_ty */4) { - var match$4 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Nativeint_ty */Block.__(4, [match$4[0]]), - match$4[1] - ]; - } else { - throw Type_mismatch; - } - case /* Int64_ty */5 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Int64_ty */5) { - var match$5 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Int64_ty */Block.__(5, [match$5[0]]), - match$5[1] - ]; - } else { - throw Type_mismatch; - } - case /* Float_ty */6 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Float_ty */6) { - var match$6 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Float_ty */Block.__(6, [match$6[0]]), - match$6[1] - ]; - } else { - throw Type_mismatch; - } - case /* Bool_ty */7 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Bool_ty */7) { - var match$7 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Bool_ty */Block.__(7, [match$7[0]]), - match$7[1] - ]; - } else { - throw Type_mismatch; - } - case /* Format_arg_ty */8 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Format_arg_ty */8) { - var sub2_fmtty$prime = fmtty[0]; - if (Caml_obj.caml_notequal(/* Fmtty_EBB */[sub_fmtty[0]], /* Fmtty_EBB */[sub2_fmtty$prime])) { - throw Type_mismatch; - } - var match$8 = type_ignored_format_substitution(sub_fmtty[1], fmt, fmtty[1]); - return /* Fmtty_fmt_EBB */[ - /* Format_arg_ty */Block.__(8, [ - sub2_fmtty$prime, - match$8[0] - ]), - match$8[1] - ]; - } else { - throw Type_mismatch; - } - case /* Format_subst_ty */9 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Format_subst_ty */9) { - var sub2_fmtty$prime$1 = fmtty[1]; - var sub1_fmtty$prime = fmtty[0]; - if (Caml_obj.caml_notequal(/* Fmtty_EBB */[CamlinternalFormatBasics.erase_rel(sub_fmtty[0])], /* Fmtty_EBB */[CamlinternalFormatBasics.erase_rel(sub1_fmtty$prime)])) { - throw Type_mismatch; - } - if (Caml_obj.caml_notequal(/* Fmtty_EBB */[CamlinternalFormatBasics.erase_rel(sub_fmtty[1])], /* Fmtty_EBB */[CamlinternalFormatBasics.erase_rel(sub2_fmtty$prime$1)])) { - throw Type_mismatch; - } - var sub_fmtty$prime = trans(symm(sub1_fmtty$prime), sub2_fmtty$prime$1); - var match$9 = fmtty_rel_det(sub_fmtty$prime); - Curry._1(match$9[1], /* Refl */0); - Curry._1(match$9[3], /* Refl */0); - var match$10 = type_ignored_format_substitution(CamlinternalFormatBasics.erase_rel(sub_fmtty[2]), fmt, fmtty[2]); - return /* Fmtty_fmt_EBB */[ - /* Format_subst_ty */Block.__(9, [ - sub1_fmtty$prime, - sub2_fmtty$prime$1, - symm(match$10[0]) - ]), - match$10[1] - ]; - } else { - throw Type_mismatch; - } - case /* Alpha_ty */10 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Alpha_ty */10) { - var match$11 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Alpha_ty */Block.__(10, [match$11[0]]), - match$11[1] - ]; - } else { - throw Type_mismatch; - } - case /* Theta_ty */11 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Theta_ty */11) { - var match$12 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Theta_ty */Block.__(11, [match$12[0]]), - match$12[1] - ]; - } else { - throw Type_mismatch; - } - case /* Any_ty */12 : - throw Type_mismatch; - case /* Reader_ty */13 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Reader_ty */13) { - var match$13 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Reader_ty */Block.__(13, [match$13[0]]), - match$13[1] - ]; - } else { - throw Type_mismatch; - } - case /* Ignored_reader_ty */14 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Ignored_reader_ty */14) { - var match$14 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); - return /* Fmtty_fmt_EBB */[ - /* Ignored_reader_ty */Block.__(14, [match$14[0]]), - match$14[1] - ]; - } else { - throw Type_mismatch; - } - - } - } -} - -function type_format_gen(fmt, fmtty) { - if (typeof fmt === "number") { - return /* Fmt_fmtty_EBB */[ - /* End_of_format */0, - fmtty - ]; - } else { - switch (fmt.tag | 0) { - case /* Char */0 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag) { - throw Type_mismatch; - } else { - var match = type_format_gen(fmt[0], fmtty[0]); - return /* Fmt_fmtty_EBB */[ - /* Char */Block.__(0, [match[0]]), - match[1] - ]; - } - case /* Caml_char */1 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag) { - throw Type_mismatch; - } else { - var match$1 = type_format_gen(fmt[0], fmtty[0]); - return /* Fmt_fmtty_EBB */[ - /* Caml_char */Block.__(1, [match$1[0]]), - match$1[1] - ]; - } - case /* String */2 : - var match$2 = type_padding(fmt[0], fmtty); - var match$3 = match$2[1]; - if (typeof match$3 === "number") { - throw Type_mismatch; - } else if (match$3.tag === /* String_ty */1) { - var match$4 = type_format_gen(fmt[1], match$3[0]); - return /* Fmt_fmtty_EBB */[ - /* String */Block.__(2, [ - match$2[0], - match$4[0] - ]), - match$4[1] - ]; - } else { - throw Type_mismatch; - } - case /* Caml_string */3 : - var match$5 = type_padding(fmt[0], fmtty); - var match$6 = match$5[1]; - if (typeof match$6 === "number") { - throw Type_mismatch; - } else if (match$6.tag === /* String_ty */1) { - var match$7 = type_format_gen(fmt[1], match$6[0]); - return /* Fmt_fmtty_EBB */[ - /* Caml_string */Block.__(3, [ - match$5[0], - match$7[0] - ]), - match$7[1] - ]; - } else { - throw Type_mismatch; - } - case /* Int */4 : - var match$8 = type_padprec(fmt[1], fmt[2], fmtty); - var match$9 = match$8[2]; - if (typeof match$9 === "number") { - throw Type_mismatch; - } else if (match$9.tag === /* Int_ty */2) { - var match$10 = type_format_gen(fmt[3], match$9[0]); - return /* Fmt_fmtty_EBB */[ - /* Int */Block.__(4, [ - fmt[0], - match$8[0], - match$8[1], - match$10[0] - ]), - match$10[1] - ]; - } else { - throw Type_mismatch; - } - case /* Int32 */5 : - var match$11 = type_padprec(fmt[1], fmt[2], fmtty); - var match$12 = match$11[2]; - if (typeof match$12 === "number") { - throw Type_mismatch; - } else if (match$12.tag === /* Int32_ty */3) { - var match$13 = type_format_gen(fmt[3], match$12[0]); - return /* Fmt_fmtty_EBB */[ - /* Int32 */Block.__(5, [ - fmt[0], - match$11[0], - match$11[1], - match$13[0] - ]), - match$13[1] - ]; - } else { - throw Type_mismatch; - } - case /* Nativeint */6 : - var match$14 = type_padprec(fmt[1], fmt[2], fmtty); - var match$15 = match$14[2]; - if (typeof match$15 === "number") { - throw Type_mismatch; - } else if (match$15.tag === /* Nativeint_ty */4) { - var match$16 = type_format_gen(fmt[3], match$15[0]); - return /* Fmt_fmtty_EBB */[ - /* Nativeint */Block.__(6, [ - fmt[0], - match$14[0], - match$14[1], - match$16[0] - ]), - match$16[1] - ]; - } else { - throw Type_mismatch; - } - case /* Int64 */7 : - var match$17 = type_padprec(fmt[1], fmt[2], fmtty); - var match$18 = match$17[2]; - if (typeof match$18 === "number") { - throw Type_mismatch; - } else if (match$18.tag === /* Int64_ty */5) { - var match$19 = type_format_gen(fmt[3], match$18[0]); - return /* Fmt_fmtty_EBB */[ - /* Int64 */Block.__(7, [ - fmt[0], - match$17[0], - match$17[1], - match$19[0] - ]), - match$19[1] - ]; - } else { - throw Type_mismatch; - } - case /* Float */8 : - var match$20 = type_padprec(fmt[1], fmt[2], fmtty); - var match$21 = match$20[2]; - if (typeof match$21 === "number") { - throw Type_mismatch; - } else if (match$21.tag === /* Float_ty */6) { - var match$22 = type_format_gen(fmt[3], match$21[0]); - return /* Fmt_fmtty_EBB */[ - /* Float */Block.__(8, [ - fmt[0], - match$20[0], - match$20[1], - match$22[0] - ]), - match$22[1] - ]; - } else { - throw Type_mismatch; - } - case /* Bool */9 : - var match$23 = type_padding(fmt[0], fmtty); - var match$24 = match$23[1]; - if (typeof match$24 === "number") { - throw Type_mismatch; - } else if (match$24.tag === /* Bool_ty */7) { - var match$25 = type_format_gen(fmt[1], match$24[0]); - return /* Fmt_fmtty_EBB */[ - /* Bool */Block.__(9, [ - match$23[0], - match$25[0] - ]), - match$25[1] - ]; - } else { - throw Type_mismatch; - } - case /* Flush */10 : - var match$26 = type_format_gen(fmt[0], fmtty); - return /* Fmt_fmtty_EBB */[ - /* Flush */Block.__(10, [match$26[0]]), - match$26[1] - ]; - case /* String_literal */11 : - var match$27 = type_format_gen(fmt[1], fmtty); - return /* Fmt_fmtty_EBB */[ - /* String_literal */Block.__(11, [ - fmt[0], - match$27[0] - ]), - match$27[1] - ]; - case /* Char_literal */12 : - var match$28 = type_format_gen(fmt[1], fmtty); - return /* Fmt_fmtty_EBB */[ - /* Char_literal */Block.__(12, [ - fmt[0], - match$28[0] - ]), - match$28[1] - ]; - case /* Format_arg */13 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Format_arg_ty */8) { - var sub_fmtty$prime = fmtty[0]; - if (Caml_obj.caml_notequal(/* Fmtty_EBB */[fmt[1]], /* Fmtty_EBB */[sub_fmtty$prime])) { - throw Type_mismatch; - } - var match$29 = type_format_gen(fmt[2], fmtty[1]); - return /* Fmt_fmtty_EBB */[ - /* Format_arg */Block.__(13, [ - fmt[0], - sub_fmtty$prime, - match$29[0] - ]), - match$29[1] - ]; - } else { - throw Type_mismatch; - } - case /* Format_subst */14 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Format_subst_ty */9) { - var sub_fmtty1 = fmtty[0]; - if (Caml_obj.caml_notequal(/* Fmtty_EBB */[CamlinternalFormatBasics.erase_rel(fmt[1])], /* Fmtty_EBB */[CamlinternalFormatBasics.erase_rel(sub_fmtty1)])) { - throw Type_mismatch; - } - var match$30 = type_format_gen(fmt[2], CamlinternalFormatBasics.erase_rel(fmtty[2])); - return /* Fmt_fmtty_EBB */[ - /* Format_subst */Block.__(14, [ - fmt[0], - sub_fmtty1, - match$30[0] - ]), - match$30[1] - ]; - } else { - throw Type_mismatch; - } - case /* Alpha */15 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Alpha_ty */10) { - var match$31 = type_format_gen(fmt[0], fmtty[0]); - return /* Fmt_fmtty_EBB */[ - /* Alpha */Block.__(15, [match$31[0]]), - match$31[1] - ]; - } else { - throw Type_mismatch; - } - case /* Theta */16 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Theta_ty */11) { - var match$32 = type_format_gen(fmt[0], fmtty[0]); - return /* Fmt_fmtty_EBB */[ - /* Theta */Block.__(16, [match$32[0]]), - match$32[1] - ]; - } else { - throw Type_mismatch; - } - case /* Formatting_lit */17 : - var match$33 = type_format_gen(fmt[1], fmtty); - return /* Fmt_fmtty_EBB */[ - /* Formatting_lit */Block.__(17, [ - fmt[0], - match$33[0] - ]), - match$33[1] - ]; - case /* Formatting_gen */18 : - var formatting_gen = fmt[0]; - var fmt0 = fmt[1]; - var fmtty0 = fmtty; - if (formatting_gen.tag) { - var match$34 = formatting_gen[0]; - var match$35 = type_format_gen(match$34[0], fmtty0); - var match$36 = type_format_gen(fmt0, match$35[1]); - return /* Fmt_fmtty_EBB */[ - /* Formatting_gen */Block.__(18, [ - /* Open_box */Block.__(1, [/* Format */[ - match$35[0], - match$34[1] - ]]), - match$36[0] - ]), - match$36[1] - ]; - } else { - var match$37 = formatting_gen[0]; - var match$38 = type_format_gen(match$37[0], fmtty0); - var match$39 = type_format_gen(fmt0, match$38[1]); - return /* Fmt_fmtty_EBB */[ - /* Formatting_gen */Block.__(18, [ - /* Open_tag */Block.__(0, [/* Format */[ - match$38[0], - match$37[1] - ]]), - match$39[0] - ]), - match$39[1] - ]; - } - case /* Reader */19 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Reader_ty */13) { - var match$40 = type_format_gen(fmt[0], fmtty[0]); - return /* Fmt_fmtty_EBB */[ - /* Reader */Block.__(19, [match$40[0]]), - match$40[1] - ]; - } else { - throw Type_mismatch; - } - case /* Scan_char_set */20 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* String_ty */1) { - var match$41 = type_format_gen(fmt[2], fmtty[0]); - return /* Fmt_fmtty_EBB */[ - /* Scan_char_set */Block.__(20, [ - fmt[0], - fmt[1], - match$41[0] - ]), - match$41[1] - ]; - } else { - throw Type_mismatch; - } - case /* Scan_get_counter */21 : - if (typeof fmtty === "number") { - throw Type_mismatch; - } else if (fmtty.tag === /* Int_ty */2) { - var match$42 = type_format_gen(fmt[1], fmtty[0]); - return /* Fmt_fmtty_EBB */[ - /* Scan_get_counter */Block.__(21, [ - fmt[0], - match$42[0] - ]), - match$42[1] - ]; - } else { - throw Type_mismatch; - } - case /* Ignored_param */23 : - var ign = fmt[0]; - var fmt$1 = fmt[1]; - var fmtty$1 = fmtty; - if (typeof ign === "number") { - if (ign === /* Ignored_reader */2) { - if (typeof fmtty$1 === "number") { - throw Type_mismatch; - } else if (fmtty$1.tag === /* Ignored_reader_ty */14) { - var match$43 = type_format_gen(fmt$1, fmtty$1[0]); - return /* Fmt_fmtty_EBB */[ - /* Ignored_param */Block.__(23, [ - /* Ignored_reader */2, - match$43[0] - ]), - match$43[1] - ]; - } else { - throw Type_mismatch; - } - } else { - return type_ignored_param_one(ign, fmt$1, fmtty$1); - } - } else { - switch (ign.tag | 0) { - case /* Ignored_format_arg */8 : - return type_ignored_param_one(/* Ignored_format_arg */Block.__(8, [ - ign[0], - ign[1] - ]), fmt$1, fmtty$1); - case /* Ignored_format_subst */9 : - var match$44 = type_ignored_format_substitution(ign[1], fmt$1, fmtty$1); - var match$45 = match$44[1]; - return /* Fmt_fmtty_EBB */[ - /* Ignored_param */Block.__(23, [ - /* Ignored_format_subst */Block.__(9, [ - ign[0], - match$44[0] - ]), - match$45[0] - ]), - match$45[1] - ]; - default: - return type_ignored_param_one(ign, fmt$1, fmtty$1); - } - } - case /* Scan_next_char */22 : - case /* Custom */24 : - throw Type_mismatch; - - } - } -} - -function type_ignored_param_one(ign, fmt, fmtty) { - var match = type_format_gen(fmt, fmtty); - return /* Fmt_fmtty_EBB */[ - /* Ignored_param */Block.__(23, [ - ign, - match[0] - ]), - match[1] - ]; -} - -function type_format(fmt, fmtty) { - var match = type_format_gen(fmt, fmtty); - if (typeof match[1] === "number") { - return match[0]; - } else { - throw Type_mismatch; - } -} - -function recast(fmt, fmtty) { - return type_format(fmt, CamlinternalFormatBasics.erase_rel(symm(fmtty))); -} - -function fix_padding(padty, width, str) { - var len = str.length; - var width$1 = Pervasives.abs(width); - var padty$1 = width < 0 ? /* Left */0 : padty; - if (width$1 <= len) { - return str; - } else { - var res = Bytes.make(width$1, padty$1 === /* Zeros */2 ? /* "0" */48 : /* " " */32); - switch (padty$1) { - case /* Left */0 : - $$String.blit(str, 0, res, 0, len); - break; - case /* Right */1 : - $$String.blit(str, 0, res, width$1 - len | 0, len); - break; - case /* Zeros */2 : - if (len > 0 && (Caml_string.get(str, 0) === /* "+" */43 || Caml_string.get(str, 0) === /* "-" */45 || Caml_string.get(str, 0) === /* " " */32)) { - res[0] = Caml_string.get(str, 0); - $$String.blit(str, 1, res, (width$1 - len | 0) + 1 | 0, len - 1 | 0); - } else if (len > 1 && Caml_string.get(str, 0) === /* "0" */48 && (Caml_string.get(str, 1) === /* "x" */120 || Caml_string.get(str, 1) === /* "X" */88)) { - res[1] = Caml_string.get(str, 1); - $$String.blit(str, 2, res, (width$1 - len | 0) + 2 | 0, len - 2 | 0); - } else { - $$String.blit(str, 0, res, width$1 - len | 0, len); - } - break; - - } - return Caml_bytes.bytes_to_string(res); - } -} - -function fix_int_precision(prec, str) { - var prec$1 = Pervasives.abs(prec); - var len = str.length; - var c = Caml_string.get(str, 0); - var exit = 0; - if (c >= 58) { - if (c >= 71) { - if (c > 102 || c < 97) { - return str; - } else { - exit = 2; - } - } else if (c >= 65) { - exit = 2; - } else { - return str; - } - } else if (c !== 32) { - if (c >= 43) { - switch (c - 43 | 0) { - case 0 : - case 2 : - exit = 1; - break; - case 1 : - case 3 : - case 4 : - return str; - case 5 : - if ((prec$1 + 2 | 0) > len && len > 1 && (Caml_string.get(str, 1) === /* "x" */120 || Caml_string.get(str, 1) === /* "X" */88)) { - var res = Bytes.make(prec$1 + 2 | 0, /* "0" */48); - res[1] = Caml_string.get(str, 1); - $$String.blit(str, 2, res, (prec$1 - len | 0) + 4 | 0, len - 2 | 0); - return Caml_bytes.bytes_to_string(res); - } else { - exit = 2; - } - break; - case 6 : - case 7 : - case 8 : - case 9 : - case 10 : - case 11 : - case 12 : - case 13 : - case 14 : - exit = 2; - break; - - } - } else { - return str; - } - } else { - exit = 1; - } - switch (exit) { - case 1 : - if ((prec$1 + 1 | 0) > len) { - var res$1 = Bytes.make(prec$1 + 1 | 0, /* "0" */48); - res$1[0] = c; - $$String.blit(str, 1, res$1, (prec$1 - len | 0) + 2 | 0, len - 1 | 0); - return Caml_bytes.bytes_to_string(res$1); - } else { - return str; - } - case 2 : - if (prec$1 > len) { - var res$2 = Bytes.make(prec$1, /* "0" */48); - $$String.blit(str, 0, res$2, prec$1 - len | 0, len); - return Caml_bytes.bytes_to_string(res$2); - } else { - return str; - } - - } -} - -function string_to_caml_string(str) { - var str$1 = $$String.escaped(str); - var l = str$1.length; - var res = Bytes.make(l + 2 | 0, /* "\"" */34); - Caml_bytes.caml_blit_string(str$1, 0, res, 1, l); - return Caml_bytes.bytes_to_string(res); -} - -function format_of_iconv(param) { - switch (param) { - case /* Int_d */0 : - return "%d"; - case /* Int_pd */1 : - return "%+d"; - case /* Int_sd */2 : - return "% d"; - case /* Int_i */3 : - return "%i"; - case /* Int_pi */4 : - return "%+i"; - case /* Int_si */5 : - return "% i"; - case /* Int_x */6 : - return "%x"; - case /* Int_Cx */7 : - return "%#x"; - case /* Int_X */8 : - return "%X"; - case /* Int_CX */9 : - return "%#X"; - case /* Int_o */10 : - return "%o"; - case /* Int_Co */11 : - return "%#o"; - case /* Int_u */12 : - return "%u"; - - } -} - -function format_of_iconvL(param) { - switch (param) { - case /* Int_d */0 : - return "%Ld"; - case /* Int_pd */1 : - return "%+Ld"; - case /* Int_sd */2 : - return "% Ld"; - case /* Int_i */3 : - return "%Li"; - case /* Int_pi */4 : - return "%+Li"; - case /* Int_si */5 : - return "% Li"; - case /* Int_x */6 : - return "%Lx"; - case /* Int_Cx */7 : - return "%#Lx"; - case /* Int_X */8 : - return "%LX"; - case /* Int_CX */9 : - return "%#LX"; - case /* Int_o */10 : - return "%Lo"; - case /* Int_Co */11 : - return "%#Lo"; - case /* Int_u */12 : - return "%Lu"; - - } -} - -function format_of_iconvl(param) { - switch (param) { - case /* Int_d */0 : - return "%ld"; - case /* Int_pd */1 : - return "%+ld"; - case /* Int_sd */2 : - return "% ld"; - case /* Int_i */3 : - return "%li"; - case /* Int_pi */4 : - return "%+li"; - case /* Int_si */5 : - return "% li"; - case /* Int_x */6 : - return "%lx"; - case /* Int_Cx */7 : - return "%#lx"; - case /* Int_X */8 : - return "%lX"; - case /* Int_CX */9 : - return "%#lX"; - case /* Int_o */10 : - return "%lo"; - case /* Int_Co */11 : - return "%#lo"; - case /* Int_u */12 : - return "%lu"; - - } -} - -function format_of_iconvn(param) { - switch (param) { - case /* Int_d */0 : - return "%nd"; - case /* Int_pd */1 : - return "%+nd"; - case /* Int_sd */2 : - return "% nd"; - case /* Int_i */3 : - return "%ni"; - case /* Int_pi */4 : - return "%+ni"; - case /* Int_si */5 : - return "% ni"; - case /* Int_x */6 : - return "%nx"; - case /* Int_Cx */7 : - return "%#nx"; - case /* Int_X */8 : - return "%nX"; - case /* Int_CX */9 : - return "%#nX"; - case /* Int_o */10 : - return "%no"; - case /* Int_Co */11 : - return "%#no"; - case /* Int_u */12 : - return "%nu"; - - } -} - -function format_of_fconv(fconv, prec) { - if (fconv === /* Float_F */15) { - return "%.12g"; - } else { - var prec$1 = Pervasives.abs(prec); - var symb = char_of_fconv(fconv); - var buf = { - ind: 0, - bytes: Caml_bytes.caml_create_bytes(16) - }; - buffer_add_char(buf, /* "%" */37); - bprint_fconv_flag(buf, fconv); - buffer_add_char(buf, /* "." */46); - buffer_add_string(buf, String(prec$1)); - buffer_add_char(buf, symb); - return buffer_contents(buf); - } -} - -function convert_int(iconv, n) { - return Caml_format.caml_format_int(format_of_iconv(iconv), n); -} - -function convert_int32(iconv, n) { - return Caml_format.caml_int32_format(format_of_iconvl(iconv), n); -} - -function convert_nativeint(iconv, n) { - return Caml_format.caml_nativeint_format(format_of_iconvn(iconv), n); -} - -function convert_int64(iconv, n) { - return Caml_format.caml_int64_format(format_of_iconvL(iconv), n); -} - -function convert_float(fconv, prec, x) { - if (fconv >= 16) { - var sign; - if (fconv >= 17) { - switch (fconv - 17 | 0) { - case /* Float_sf */2 : - sign = /* "-" */45; - break; - case /* Float_f */0 : - case /* Float_e */3 : - sign = /* "+" */43; - break; - case /* Float_pf */1 : - case /* Float_pe */4 : - sign = /* " " */32; - break; - - } - } else { - sign = /* "-" */45; - } - var str = Caml_format.caml_hexstring_of_float(x, prec, sign); - if (fconv >= 19) { - return Caml_bytes.bytes_to_string(Bytes.uppercase_ascii(Caml_bytes.bytes_of_string(str))); - } else { - return str; - } - } else { - var str$1 = Caml_format.caml_format_float(format_of_fconv(fconv, prec), x); - if (fconv !== /* Float_F */15) { - return str$1; - } else { - var len = str$1.length; - var is_valid = function (_i) { - while(true) { - var i = _i; - if (i === len) { - return false; - } else { - var match = Caml_string.get(str$1, i); - var switcher = match - 46 | 0; - if (switcher > 23 || switcher < 0) { - if (switcher !== 55) { - _i = i + 1 | 0; - continue ; - } else { - return true; - } - } else if (switcher > 22 || switcher < 1) { - return true; - } else { - _i = i + 1 | 0; - continue ; - } - } - }; - }; - var match = Pervasives.classify_float(x); - if (match !== 3) { - if (match >= 4) { - return "nan"; - } else if (is_valid(0)) { - return str$1; - } else { - return str$1 + "."; - } - } else if (x < 0.0) { - return "neg_infinity"; - } else { - return "infinity"; - } - } - } -} - -function format_caml_char(c) { - var str = Char.escaped(c); - var l = str.length; - var res = Bytes.make(l + 2 | 0, /* "'" */39); - Caml_bytes.caml_blit_string(str, 0, res, 1, l); - return Caml_bytes.bytes_to_string(res); -} - -function string_of_fmtty(fmtty) { - var buf = { - ind: 0, - bytes: Caml_bytes.caml_create_bytes(16) - }; - bprint_fmtty(buf, fmtty); - return buffer_contents(buf); -} - -function make_printf(_k, o, _acc, _fmt) { - while(true) { - var fmt = _fmt; - var acc = _acc; - var k = _k; - if (typeof fmt === "number") { - return Curry._2(k, o, acc); - } else { - switch (fmt.tag | 0) { - case /* Char */0 : - var rest = fmt[0]; - return (function(k,acc,rest){ - return function (c) { - var new_acc = /* Acc_data_char */Block.__(5, [ - acc, - c - ]); - return make_printf(k, o, new_acc, rest); - } - }(k,acc,rest)); - case /* Caml_char */1 : - var rest$1 = fmt[0]; - return (function(k,acc,rest$1){ - return function (c) { - var new_acc_001 = format_caml_char(c); - var new_acc = /* Acc_data_string */Block.__(4, [ - acc, - new_acc_001 - ]); - return make_printf(k, o, new_acc, rest$1); - } - }(k,acc,rest$1)); - case /* String */2 : - return make_padding(k, o, acc, fmt[1], fmt[0], (function (str) { - return str; - })); - case /* Caml_string */3 : - return make_padding(k, o, acc, fmt[1], fmt[0], string_to_caml_string); - case /* Int */4 : - return make_int_padding_precision(k, o, acc, fmt[3], fmt[1], fmt[2], convert_int, fmt[0]); - case /* Int32 */5 : - return make_int_padding_precision(k, o, acc, fmt[3], fmt[1], fmt[2], convert_int32, fmt[0]); - case /* Nativeint */6 : - return make_int_padding_precision(k, o, acc, fmt[3], fmt[1], fmt[2], convert_nativeint, fmt[0]); - case /* Int64 */7 : - return make_int_padding_precision(k, o, acc, fmt[3], fmt[1], fmt[2], convert_int64, fmt[0]); - case /* Float */8 : - var k$1 = k; - var o$1 = o; - var acc$1 = acc; - var fmt$1 = fmt[3]; - var pad = fmt[1]; - var prec = fmt[2]; - var fconv = fmt[0]; - if (typeof pad === "number") { - if (typeof prec === "number") { - if (prec !== 0) { - return (function(k$1,o$1,acc$1,fmt$1,fconv){ - return function (p, x) { - var str = convert_float(fconv, p, x); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv)); - } else { - return (function(k$1,o$1,acc$1,fmt$1,fconv){ - return function (x) { - var str = convert_float(fconv, -6, x); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv)); - } - } else { - var p = prec[0]; - return (function(k$1,o$1,acc$1,fmt$1,fconv,p){ - return function (x) { - var str = convert_float(fconv, p, x); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv,p)); - } - } else if (pad.tag) { - var padty = pad[0]; - if (typeof prec === "number") { - if (prec !== 0) { - return (function(k$1,o$1,acc$1,fmt$1,fconv,padty){ - return function (w, p, x) { - var str = fix_padding(padty, w, convert_float(fconv, p, x)); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv,padty)); - } else { - return (function(k$1,o$1,acc$1,fmt$1,fconv,padty){ - return function (w, x) { - var str = convert_float(fconv, -6, x); - var str$prime = fix_padding(padty, w, str); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str$prime - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv,padty)); - } - } else { - var p$1 = prec[0]; - return (function(k$1,o$1,acc$1,fmt$1,fconv,padty,p$1){ - return function (w, x) { - var str = fix_padding(padty, w, convert_float(fconv, p$1, x)); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv,padty,p$1)); - } - } else { - var w = pad[1]; - var padty$1 = pad[0]; - if (typeof prec === "number") { - if (prec !== 0) { - return (function(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w){ - return function (p, x) { - var str = fix_padding(padty$1, w, convert_float(fconv, p, x)); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w)); - } else { - return (function(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w){ - return function (x) { - var str = convert_float(fconv, -6, x); - var str$prime = fix_padding(padty$1, w, str); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str$prime - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w)); - } - } else { - var p$2 = prec[0]; - return (function(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w,p$2){ - return function (x) { - var str = fix_padding(padty$1, w, convert_float(fconv, p$2, x)); - return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ - acc$1, - str - ]), fmt$1); - } - }(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w,p$2)); - } - } - case /* Bool */9 : - return make_padding(k, o, acc, fmt[1], fmt[0], Pervasives.string_of_bool); - case /* Flush */10 : - _fmt = fmt[0]; - _acc = /* Acc_flush */Block.__(7, [acc]); - continue ; - case /* String_literal */11 : - _fmt = fmt[1]; - _acc = /* Acc_string_literal */Block.__(2, [ - acc, - fmt[0] - ]); - continue ; - case /* Char_literal */12 : - _fmt = fmt[1]; - _acc = /* Acc_char_literal */Block.__(3, [ - acc, - fmt[0] - ]); - continue ; - case /* Format_arg */13 : - var rest$2 = fmt[2]; - var ty = string_of_fmtty(fmt[1]); - return (function(k,acc,rest$2,ty){ - return function (str) { - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - ty - ]), rest$2); - } - }(k,acc,rest$2,ty)); - case /* Format_subst */14 : - var rest$3 = fmt[2]; - var fmtty = fmt[1]; - return (function(k,acc,fmtty,rest$3){ - return function (param) { - return make_printf(k, o, acc, CamlinternalFormatBasics.concat_fmt(recast(param[0], fmtty), rest$3)); - } - }(k,acc,fmtty,rest$3)); - case /* Alpha */15 : - var rest$4 = fmt[0]; - return (function(k,acc,rest$4){ - return function (f, x) { - return make_printf(k, o, /* Acc_delay */Block.__(6, [ - acc, - (function (o) { - return Curry._2(f, o, x); - }) - ]), rest$4); - } - }(k,acc,rest$4)); - case /* Theta */16 : - var rest$5 = fmt[0]; - return (function(k,acc,rest$5){ - return function (f) { - return make_printf(k, o, /* Acc_delay */Block.__(6, [ - acc, - f - ]), rest$5); - } - }(k,acc,rest$5)); - case /* Formatting_lit */17 : - _fmt = fmt[1]; - _acc = /* Acc_formatting_lit */Block.__(0, [ - acc, - fmt[0] - ]); - continue ; - case /* Formatting_gen */18 : - var match = fmt[0]; - if (match.tag) { - var rest$6 = fmt[1]; - var k$prime = (function(k,acc,rest$6){ - return function k$prime(koc, kacc) { - return make_printf(k, koc, /* Acc_formatting_gen */Block.__(1, [ - acc, - /* Acc_open_box */Block.__(1, [kacc]) - ]), rest$6); - } - }(k,acc,rest$6)); - _fmt = match[0][0]; - _acc = /* End_of_acc */0; - _k = k$prime; - continue ; - } else { - var rest$7 = fmt[1]; - var k$prime$1 = (function(k,acc,rest$7){ - return function k$prime$1(koc, kacc) { - return make_printf(k, koc, /* Acc_formatting_gen */Block.__(1, [ - acc, - /* Acc_open_tag */Block.__(0, [kacc]) - ]), rest$7); - } - }(k,acc,rest$7)); - _fmt = match[0][0]; - _acc = /* End_of_acc */0; - _k = k$prime$1; - continue ; - } - case /* Reader */19 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 1525, - 4 - ] - ]; - case /* Scan_char_set */20 : - var rest$8 = fmt[2]; - var new_acc = /* Acc_invalid_arg */Block.__(8, [ - acc, - "Printf: bad conversion %[" - ]); - return (function(k,rest$8,new_acc){ - return function (param) { - return make_printf(k, o, new_acc, rest$8); - } - }(k,rest$8,new_acc)); - case /* Scan_get_counter */21 : - var rest$9 = fmt[1]; - return (function(k,acc,rest$9){ - return function (n) { - var new_acc_001 = Caml_format.caml_format_int("%u", n); - var new_acc = /* Acc_data_string */Block.__(4, [ - acc, - new_acc_001 - ]); - return make_printf(k, o, new_acc, rest$9); - } - }(k,acc,rest$9)); - case /* Scan_next_char */22 : - var rest$10 = fmt[0]; - return (function(k,acc,rest$10){ - return function (c) { - var new_acc = /* Acc_data_char */Block.__(5, [ - acc, - c - ]); - return make_printf(k, o, new_acc, rest$10); - } - }(k,acc,rest$10)); - case /* Ignored_param */23 : - return make_ignored_param(k, o, acc, fmt[0], fmt[1]); - case /* Custom */24 : - return make_custom(k, o, acc, fmt[2], fmt[0], Curry._1(fmt[1], /* () */0)); - - } - } - }; -} - -function make_ignored_param(k, o, acc, ign, fmt) { - if (typeof ign === "number") { - if (ign === /* Ignored_reader */2) { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 1593, - 39 - ] - ]; - } else { - return make_invalid_arg(k, o, acc, fmt); - } - } else if (ign.tag === /* Ignored_format_subst */9) { - return make_from_fmtty(k, o, acc, ign[1], fmt); - } else { - return make_invalid_arg(k, o, acc, fmt); - } -} - -function make_from_fmtty(k, o, acc, fmtty, fmt) { - if (typeof fmtty === "number") { - return make_invalid_arg(k, o, acc, fmt); - } else { - switch (fmtty.tag | 0) { - case /* Char_ty */0 : - var rest = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest, fmt); - }); - case /* String_ty */1 : - var rest$1 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$1, fmt); - }); - case /* Int_ty */2 : - var rest$2 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$2, fmt); - }); - case /* Int32_ty */3 : - var rest$3 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$3, fmt); - }); - case /* Nativeint_ty */4 : - var rest$4 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$4, fmt); - }); - case /* Int64_ty */5 : - var rest$5 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$5, fmt); - }); - case /* Float_ty */6 : - var rest$6 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$6, fmt); - }); - case /* Bool_ty */7 : - var rest$7 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$7, fmt); - }); - case /* Format_arg_ty */8 : - var rest$8 = fmtty[1]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$8, fmt); - }); - case /* Format_subst_ty */9 : - var rest$9 = fmtty[2]; - var ty = trans(symm(fmtty[0]), fmtty[1]); - return (function (param) { - return make_from_fmtty(k, o, acc, CamlinternalFormatBasics.concat_fmtty(ty, rest$9), fmt); - }); - case /* Alpha_ty */10 : - var rest$10 = fmtty[0]; - return (function (param, param$1) { - return make_from_fmtty(k, o, acc, rest$10, fmt); - }); - case /* Theta_ty */11 : - var rest$11 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$11, fmt); - }); - case /* Any_ty */12 : - var rest$12 = fmtty[0]; - return (function (param) { - return make_from_fmtty(k, o, acc, rest$12, fmt); - }); - case /* Reader_ty */13 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 1616, - 31 - ] - ]; - case /* Ignored_reader_ty */14 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 1617, - 31 - ] - ]; - - } - } -} - -function make_invalid_arg(k, o, acc, fmt) { - return make_printf(k, o, /* Acc_invalid_arg */Block.__(8, [ - acc, - "Printf: bad conversion %_" - ]), fmt); -} - -function make_padding(k, o, acc, fmt, pad, trans) { - if (typeof pad === "number") { - return (function (x) { - var new_acc_001 = Curry._1(trans, x); - var new_acc = /* Acc_data_string */Block.__(4, [ - acc, - new_acc_001 - ]); - return make_printf(k, o, new_acc, fmt); - }); - } else if (pad.tag) { - var padty = pad[0]; - return (function (w, x) { - var new_acc_001 = fix_padding(padty, w, Curry._1(trans, x)); - var new_acc = /* Acc_data_string */Block.__(4, [ - acc, - new_acc_001 - ]); - return make_printf(k, o, new_acc, fmt); - }); - } else { - var width = pad[1]; - var padty$1 = pad[0]; - return (function (x) { - var new_acc_001 = fix_padding(padty$1, width, Curry._1(trans, x)); - var new_acc = /* Acc_data_string */Block.__(4, [ - acc, - new_acc_001 - ]); - return make_printf(k, o, new_acc, fmt); - }); - } -} - -function make_int_padding_precision(k, o, acc, fmt, pad, prec, trans, iconv) { - if (typeof pad === "number") { - if (typeof prec === "number") { - if (prec !== 0) { - return (function (p, x) { - var str = fix_int_precision(p, Curry._2(trans, iconv, x)); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } else { - return (function (x) { - var str = Curry._2(trans, iconv, x); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } - } else { - var p = prec[0]; - return (function (x) { - var str = fix_int_precision(p, Curry._2(trans, iconv, x)); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } - } else if (pad.tag) { - var padty = pad[0]; - if (typeof prec === "number") { - if (prec !== 0) { - return (function (w, p, x) { - var str = fix_padding(padty, w, fix_int_precision(p, Curry._2(trans, iconv, x))); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } else { - return (function (w, x) { - var str = fix_padding(padty, w, Curry._2(trans, iconv, x)); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } - } else { - var p$1 = prec[0]; - return (function (w, x) { - var str = fix_padding(padty, w, fix_int_precision(p$1, Curry._2(trans, iconv, x))); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } - } else { - var w = pad[1]; - var padty$1 = pad[0]; - if (typeof prec === "number") { - if (prec !== 0) { - return (function (p, x) { - var str = fix_padding(padty$1, w, fix_int_precision(p, Curry._2(trans, iconv, x))); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } else { - return (function (x) { - var str = fix_padding(padty$1, w, Curry._2(trans, iconv, x)); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } - } else { - var p$2 = prec[0]; - return (function (x) { - var str = fix_padding(padty$1, w, fix_int_precision(p$2, Curry._2(trans, iconv, x))); - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - str - ]), fmt); - }); - } - } -} - -function make_custom(k, o, acc, rest, arity, f) { - if (arity) { - var arity$1 = arity[0]; - return (function (x) { - return make_custom(k, o, acc, rest, arity$1, Curry._1(f, x)); - }); - } else { - return make_printf(k, o, /* Acc_data_string */Block.__(4, [ - acc, - f - ]), rest); - } -} - -function make_iprintf(_k, o, _fmt) { - while(true) { - var fmt = _fmt; - var k = _k; - var exit = 0; - if (typeof fmt === "number") { - return Curry._1(k, o); - } else { - switch (fmt.tag | 0) { - case /* String */2 : - var tmp = fmt[0]; - if (typeof tmp !== "number" && tmp.tag) { - var partial_arg = make_iprintf(k, o, fmt[1]); - var partial_arg$1 = (function(partial_arg){ - return function partial_arg$1(param) { - return partial_arg; - } - }(partial_arg)); - return (function (param) { - return partial_arg$1; - }); - } - var partial_arg$2 = make_iprintf(k, o, fmt[1]); - return (function(partial_arg$2){ - return function (param) { - return partial_arg$2; - } - }(partial_arg$2)); - case /* Caml_string */3 : - var tmp$1 = fmt[0]; - if (typeof tmp$1 !== "number" && tmp$1.tag) { - var partial_arg$3 = make_iprintf(k, o, fmt[1]); - var partial_arg$4 = (function(partial_arg$3){ - return function partial_arg$4(param) { - return partial_arg$3; - } - }(partial_arg$3)); - return (function (param) { - return partial_arg$4; - }); - } - var partial_arg$5 = make_iprintf(k, o, fmt[1]); - return (function(partial_arg$5){ - return function (param) { - return partial_arg$5; - } - }(partial_arg$5)); - case /* Bool */9 : - var tmp$2 = fmt[0]; - if (typeof tmp$2 !== "number" && tmp$2.tag) { - var partial_arg$6 = make_iprintf(k, o, fmt[1]); - var partial_arg$7 = (function(partial_arg$6){ - return function partial_arg$7(param) { - return partial_arg$6; - } - }(partial_arg$6)); - return (function (param) { - return partial_arg$7; - }); - } - var partial_arg$8 = make_iprintf(k, o, fmt[1]); - return (function(partial_arg$8){ - return function (param) { - return partial_arg$8; - } - }(partial_arg$8)); - case /* Flush */10 : - _fmt = fmt[0]; - continue ; - case /* Format_subst */14 : - var rest = fmt[2]; - var fmtty = fmt[1]; - return (function(k,fmtty,rest){ - return function (param) { - return make_iprintf(k, o, CamlinternalFormatBasics.concat_fmt(recast(param[0], fmtty), rest)); - } - }(k,fmtty,rest)); - case /* Alpha */15 : - var partial_arg$9 = make_iprintf(k, o, fmt[0]); - var partial_arg$10 = (function(partial_arg$9){ - return function partial_arg$10(param) { - return partial_arg$9; - } - }(partial_arg$9)); - return (function (param) { - return partial_arg$10; - }); - case /* String_literal */11 : - case /* Char_literal */12 : - case /* Formatting_lit */17 : - exit = 2; - break; - case /* Formatting_gen */18 : - var match = fmt[0]; - if (match.tag) { - var rest$1 = fmt[1]; - _fmt = match[0][0]; - _k = (function(k,rest$1){ - return function (koc) { - return make_iprintf(k, koc, rest$1); - } - }(k,rest$1)); - continue ; - } else { - var rest$2 = fmt[1]; - _fmt = match[0][0]; - _k = (function(k,rest$2){ - return function (koc) { - return make_iprintf(k, koc, rest$2); - } - }(k,rest$2)); - continue ; - } - case /* Reader */19 : - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 1797, - 8 - ] - ]; - case /* Format_arg */13 : - case /* Scan_char_set */20 : - exit = 3; - break; - case /* Scan_get_counter */21 : - var partial_arg$11 = make_iprintf(k, o, fmt[1]); - return (function(partial_arg$11){ - return function (param) { - return partial_arg$11; - } - }(partial_arg$11)); - case /* Char */0 : - case /* Caml_char */1 : - case /* Theta */16 : - case /* Scan_next_char */22 : - exit = 1; - break; - case /* Ignored_param */23 : - return make_ignored_param((function(k){ - return function (x, param) { - return Curry._1(k, x); - } - }(k)), o, /* End_of_acc */0, fmt[0], fmt[1]); - case /* Custom */24 : - return fn_of_custom_arity(k, o, fmt[2], fmt[0]); - default: - var k$1 = k; - var o$1 = o; - var fmt$1 = fmt[3]; - var pad = fmt[1]; - var prec = fmt[2]; - if (typeof pad === "number") { - if (typeof prec === "number") { - if (prec !== 0) { - var partial_arg$12 = make_iprintf(k$1, o$1, fmt$1); - var partial_arg$13 = (function(partial_arg$12){ - return function partial_arg$13(param) { - return partial_arg$12; - } - }(partial_arg$12)); - return (function (param) { - return partial_arg$13; - }); - } else { - var partial_arg$14 = make_iprintf(k$1, o$1, fmt$1); - return (function(partial_arg$14){ - return function (param) { - return partial_arg$14; - } - }(partial_arg$14)); - } - } else { - var partial_arg$15 = make_iprintf(k$1, o$1, fmt$1); - return (function(partial_arg$15){ - return function (param) { - return partial_arg$15; - } - }(partial_arg$15)); - } - } else if (pad.tag) { - if (typeof prec === "number") { - if (prec !== 0) { - var partial_arg$16 = make_iprintf(k$1, o$1, fmt$1); - var partial_arg$17 = (function(partial_arg$16){ - return function partial_arg$17(param) { - return partial_arg$16; - } - }(partial_arg$16)); - var partial_arg$18 = function (param) { - return partial_arg$17; - }; - return (function (param) { - return partial_arg$18; - }); - } else { - var partial_arg$19 = make_iprintf(k$1, o$1, fmt$1); - var partial_arg$20 = (function(partial_arg$19){ - return function partial_arg$20(param) { - return partial_arg$19; - } - }(partial_arg$19)); - return (function (param) { - return partial_arg$20; - }); - } - } else { - var partial_arg$21 = make_iprintf(k$1, o$1, fmt$1); - var partial_arg$22 = (function(partial_arg$21){ - return function partial_arg$22(param) { - return partial_arg$21; - } - }(partial_arg$21)); - return (function (param) { - return partial_arg$22; - }); - } - } else if (typeof prec === "number") { - if (prec !== 0) { - var partial_arg$23 = make_iprintf(k$1, o$1, fmt$1); - var partial_arg$24 = (function(partial_arg$23){ - return function partial_arg$24(param) { - return partial_arg$23; - } - }(partial_arg$23)); - return (function (param) { - return partial_arg$24; - }); - } else { - var partial_arg$25 = make_iprintf(k$1, o$1, fmt$1); - return (function(partial_arg$25){ - return function (param) { - return partial_arg$25; - } - }(partial_arg$25)); - } - } else { - var partial_arg$26 = make_iprintf(k$1, o$1, fmt$1); - return (function(partial_arg$26){ - return function (param) { - return partial_arg$26; - } - }(partial_arg$26)); - } - } - } - switch (exit) { - case 1 : - var partial_arg$27 = make_iprintf(k, o, fmt[0]); - return (function(partial_arg$27){ - return function (param) { - return partial_arg$27; - } - }(partial_arg$27)); - case 2 : - _fmt = fmt[1]; - continue ; - case 3 : - var partial_arg$28 = make_iprintf(k, o, fmt[2]); - return (function(partial_arg$28){ - return function (param) { - return partial_arg$28; - } - }(partial_arg$28)); - - } - }; -} - -function fn_of_custom_arity(k, o, fmt, param) { - if (param) { - var partial_arg = fn_of_custom_arity(k, o, fmt, param[0]); - return (function (param) { - return partial_arg; - }); - } else { - return make_iprintf(k, o, fmt); - } -} - -function output_acc(o, _acc) { - while(true) { - var acc = _acc; - var exit = 0; - if (typeof acc === "number") { - return /* () */0; - } else { - switch (acc.tag | 0) { - case /* Acc_formatting_lit */0 : - var s = string_of_formatting_lit(acc[1]); - output_acc(o, acc[0]); - return Pervasives.output_string(o, s); - case /* Acc_formatting_gen */1 : - var match = acc[1]; - var p = acc[0]; - output_acc(o, p); - if (match.tag) { - Pervasives.output_string(o, "@["); - _acc = match[0]; - continue ; - } else { - Pervasives.output_string(o, "@{"); - _acc = match[0]; - continue ; - } - case /* Acc_string_literal */2 : - case /* Acc_data_string */4 : - exit = 1; - break; - case /* Acc_char_literal */3 : - case /* Acc_data_char */5 : - exit = 2; - break; - case /* Acc_delay */6 : - output_acc(o, acc[0]); - return Curry._1(acc[1], o); - case /* Acc_flush */7 : - output_acc(o, acc[0]); - return Caml_io.caml_ml_flush(o); - case /* Acc_invalid_arg */8 : - output_acc(o, acc[0]); - throw [ - Caml_builtin_exceptions.invalid_argument, - acc[1] - ]; - - } - } - switch (exit) { - case 1 : - output_acc(o, acc[0]); - return Pervasives.output_string(o, acc[1]); - case 2 : - output_acc(o, acc[0]); - return Caml_io.caml_ml_output_char(o, acc[1]); - - } - }; -} - -function bufput_acc(b, _acc) { - while(true) { - var acc = _acc; - var exit = 0; - if (typeof acc === "number") { - return /* () */0; - } else { - switch (acc.tag | 0) { - case /* Acc_formatting_lit */0 : - var s = string_of_formatting_lit(acc[1]); - bufput_acc(b, acc[0]); - return $$Buffer.add_string(b, s); - case /* Acc_formatting_gen */1 : - var match = acc[1]; - var p = acc[0]; - bufput_acc(b, p); - if (match.tag) { - $$Buffer.add_string(b, "@["); - _acc = match[0]; - continue ; - } else { - $$Buffer.add_string(b, "@{"); - _acc = match[0]; - continue ; - } - case /* Acc_string_literal */2 : - case /* Acc_data_string */4 : - exit = 1; - break; - case /* Acc_char_literal */3 : - case /* Acc_data_char */5 : - exit = 2; - break; - case /* Acc_delay */6 : - bufput_acc(b, acc[0]); - return Curry._1(acc[1], b); - case /* Acc_flush */7 : - _acc = acc[0]; - continue ; - case /* Acc_invalid_arg */8 : - bufput_acc(b, acc[0]); - throw [ - Caml_builtin_exceptions.invalid_argument, - acc[1] - ]; - - } - } - switch (exit) { - case 1 : - bufput_acc(b, acc[0]); - return $$Buffer.add_string(b, acc[1]); - case 2 : - bufput_acc(b, acc[0]); - return $$Buffer.add_char(b, acc[1]); - - } - }; -} - -function strput_acc(b, _acc) { - while(true) { - var acc = _acc; - var exit = 0; - if (typeof acc === "number") { - return /* () */0; - } else { - switch (acc.tag | 0) { - case /* Acc_formatting_lit */0 : - var s = string_of_formatting_lit(acc[1]); - strput_acc(b, acc[0]); - return $$Buffer.add_string(b, s); - case /* Acc_formatting_gen */1 : - var match = acc[1]; - var p = acc[0]; - strput_acc(b, p); - if (match.tag) { - $$Buffer.add_string(b, "@["); - _acc = match[0]; - continue ; - } else { - $$Buffer.add_string(b, "@{"); - _acc = match[0]; - continue ; - } - case /* Acc_string_literal */2 : - case /* Acc_data_string */4 : - exit = 1; - break; - case /* Acc_char_literal */3 : - case /* Acc_data_char */5 : - exit = 2; - break; - case /* Acc_delay */6 : - strput_acc(b, acc[0]); - return $$Buffer.add_string(b, Curry._1(acc[1], /* () */0)); - case /* Acc_flush */7 : - _acc = acc[0]; - continue ; - case /* Acc_invalid_arg */8 : - strput_acc(b, acc[0]); - throw [ - Caml_builtin_exceptions.invalid_argument, - acc[1] - ]; - - } - } - switch (exit) { - case 1 : - strput_acc(b, acc[0]); - return $$Buffer.add_string(b, acc[1]); - case 2 : - strput_acc(b, acc[0]); - return $$Buffer.add_char(b, acc[1]); - - } - }; -} - -function failwith_message(param) { - var buf = $$Buffer.create(256); - var k = function (param, acc) { - strput_acc(buf, acc); - var s = $$Buffer.contents(buf); - throw [ - Caml_builtin_exceptions.failure, - s - ]; - }; - return make_printf(k, /* () */0, /* End_of_acc */0, param[0]); -} - -function open_box_of_string(str) { - if (str === "") { - return /* tuple */[ - 0, - /* Pp_box */4 - ]; - } else { - var len = str.length; - var invalid_box = function (param) { - return Curry._1(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid box description ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* End_of_format */0 - ]) - ]), - "invalid box description %S" - ]), str); - }; - var parse_spaces = function (_i) { - while(true) { - var i = _i; - if (i === len) { - return i; - } else { - var match = Caml_string.get(str, i); - if (match !== 9) { - if (match !== 32) { - return i; - } else { - _i = i + 1 | 0; - continue ; - } - } else { - _i = i + 1 | 0; - continue ; - } - } - }; - }; - var parse_lword = function (i, _j) { - while(true) { - var j = _j; - if (j === len) { - return j; - } else { - var match = Caml_string.get(str, j); - if (match > 122 || match < 97) { - return j; - } else { - _j = j + 1 | 0; - continue ; - } - } - }; - }; - var parse_int = function (i, _j) { - while(true) { - var j = _j; - if (j === len) { - return j; - } else { - var match = Caml_string.get(str, j); - if (match >= 48) { - if (match >= 58) { - return j; - } else { - _j = j + 1 | 0; - continue ; - } - } else if (match !== 45) { - return j; - } else { - _j = j + 1 | 0; - continue ; - } - } - }; - }; - var wstart = parse_spaces(0); - var wend = parse_lword(wstart, wstart); - var box_name = $$String.sub(str, wstart, wend - wstart | 0); - var nstart = parse_spaces(wend); - var nend = parse_int(nstart, nstart); - var indent; - if (nstart === nend) { - indent = 0; - } else { - try { - indent = Caml_format.caml_int_of_string($$String.sub(str, nstart, nend - nstart | 0)); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === Caml_builtin_exceptions.failure) { - indent = invalid_box(/* () */0); - } else { - throw exn; - } - } - } - var exp_end = parse_spaces(nend); - if (exp_end !== len) { - invalid_box(/* () */0); - } - var box_type; - switch (box_name) { - case "" : - case "b" : - box_type = /* Pp_box */4; - break; - case "h" : - box_type = /* Pp_hbox */0; - break; - case "hov" : - box_type = /* Pp_hovbox */3; - break; - case "hv" : - box_type = /* Pp_hvbox */2; - break; - case "v" : - box_type = /* Pp_vbox */1; - break; - default: - box_type = invalid_box(/* () */0); - } - return /* tuple */[ - indent, - box_type - ]; - } -} - -function make_padding_fmt_ebb(pad, fmt) { - if (typeof pad === "number") { - return /* Padding_fmt_EBB */[ - /* No_padding */0, - fmt - ]; - } else if (pad.tag) { - return /* Padding_fmt_EBB */[ - /* Arg_padding */Block.__(1, [pad[0]]), - fmt - ]; - } else { - return /* Padding_fmt_EBB */[ - /* Lit_padding */Block.__(0, [ - pad[0], - pad[1] - ]), - fmt - ]; - } -} - -function make_precision_fmt_ebb(prec, fmt) { - if (typeof prec === "number") { - if (prec !== 0) { - return /* Precision_fmt_EBB */[ - /* Arg_precision */1, - fmt - ]; - } else { - return /* Precision_fmt_EBB */[ - /* No_precision */0, - fmt - ]; - } - } else { - return /* Precision_fmt_EBB */[ - /* Lit_precision */[prec[0]], - fmt - ]; - } -} - -function make_padprec_fmt_ebb(pad, prec, fmt) { - var match = make_precision_fmt_ebb(prec, fmt); - var fmt$prime = match[1]; - var prec$1 = match[0]; - if (typeof pad === "number") { - return /* Padprec_fmt_EBB */[ - /* No_padding */0, - prec$1, - fmt$prime - ]; - } else if (pad.tag) { - return /* Padprec_fmt_EBB */[ - /* Arg_padding */Block.__(1, [pad[0]]), - prec$1, - fmt$prime - ]; - } else { - return /* Padprec_fmt_EBB */[ - /* Lit_padding */Block.__(0, [ - pad[0], - pad[1] - ]), - prec$1, - fmt$prime - ]; - } -} - -function fmt_ebb_of_string(legacy_behavior, str) { - var legacy_behavior$1 = legacy_behavior !== undefined ? legacy_behavior : true; - var invalid_format_message = function (str_ind, msg) { - return Curry._3(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": at character number ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* String_literal */Block.__(11, [ - ", ", - /* String */Block.__(2, [ - /* No_padding */0, - /* End_of_format */0 - ]) - ]) - ]) - ]) - ]) - ]), - "invalid format %S: at character number %d, %s" - ]), str, str_ind, msg); - }; - var invalid_format_without = function (str_ind, c, s) { - return Curry._4(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": at character number ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* String_literal */Block.__(11, [ - ", '", - /* Char */Block.__(0, [/* String_literal */Block.__(11, [ - "' without ", - /* String */Block.__(2, [ - /* No_padding */0, - /* End_of_format */0 - ]) - ])]) - ]) - ]) - ]) - ]) - ]), - "invalid format %S: at character number %d, '%c' without %s" - ]), str, str_ind, c, s); - }; - var expected_character = function (str_ind, expected, read) { - return Curry._4(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": at character number ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* String_literal */Block.__(11, [ - ", ", - /* String */Block.__(2, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - " expected, read ", - /* Caml_char */Block.__(1, [/* End_of_format */0]) - ]) - ]) - ]) - ]) - ]) - ]) - ]), - "invalid format %S: at character number %d, %s expected, read %C" - ]), str, str_ind, expected, read); - }; - var parse_after_at = function (str_ind, end_ind) { - if (str_ind === end_ind) { - return /* Fmt_EBB */[/* Char_literal */Block.__(12, [ - /* "@" */64, - /* End_of_format */0 - ])]; - } else { - var c = Caml_string.get(str, str_ind); - if (c >= 65) { - if (c >= 94) { - switch (c) { - case 123 : - return parse_tag(true, str_ind + 1 | 0, end_ind); - case 124 : - break; - case 125 : - var beg_ind = str_ind + 1 | 0; - var match = parse_literal(beg_ind, beg_ind, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Close_tag */1, - match[0] - ])]; - default: - - } - } else if (c >= 91) { - switch (c - 91 | 0) { - case 0 : - return parse_tag(false, str_ind + 1 | 0, end_ind); - case 1 : - break; - case 2 : - var beg_ind$1 = str_ind + 1 | 0; - var match$1 = parse_literal(beg_ind$1, beg_ind$1, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Close_box */0, - match$1[0] - ])]; - - } - } - - } else if (c !== 10) { - if (c >= 32) { - switch (c - 32 | 0) { - case 0 : - var beg_ind$2 = str_ind + 1 | 0; - var match$2 = parse_literal(beg_ind$2, beg_ind$2, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Break */Block.__(0, [ - "@ ", - 1, - 0 - ]), - match$2[0] - ])]; - case 5 : - if ((str_ind + 1 | 0) < end_ind && Caml_string.get(str, str_ind + 1 | 0) === /* "%" */37) { - var beg_ind$3 = str_ind + 2 | 0; - var match$3 = parse_literal(beg_ind$3, beg_ind$3, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Escaped_percent */6, - match$3[0] - ])]; - } else { - var match$4 = parse_literal(str_ind, str_ind, end_ind); - return /* Fmt_EBB */[/* Char_literal */Block.__(12, [ - /* "@" */64, - match$4[0] - ])]; - } - case 12 : - var beg_ind$4 = str_ind + 1 | 0; - var match$5 = parse_literal(beg_ind$4, beg_ind$4, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Break */Block.__(0, [ - "@,", - 0, - 0 - ]), - match$5[0] - ])]; - case 14 : - var beg_ind$5 = str_ind + 1 | 0; - var match$6 = parse_literal(beg_ind$5, beg_ind$5, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Flush_newline */4, - match$6[0] - ])]; - case 27 : - var str_ind$1 = str_ind + 1 | 0; - var end_ind$1 = end_ind; - var match$7; - try { - if (str_ind$1 === end_ind$1 || Caml_string.get(str, str_ind$1) !== /* "<" */60) { - throw Caml_builtin_exceptions.not_found; - } - var str_ind_1 = parse_spaces(str_ind$1 + 1 | 0, end_ind$1); - var match$8 = Caml_string.get(str, str_ind_1); - var exit = 0; - if (match$8 >= 48) { - if (match$8 >= 58) { - throw Caml_builtin_exceptions.not_found; - } - exit = 1; - } else { - if (match$8 !== 45) { - throw Caml_builtin_exceptions.not_found; - } - exit = 1; - } - if (exit === 1) { - var match$9 = parse_integer(str_ind_1, end_ind$1); - var width = match$9[1]; - var str_ind_3 = parse_spaces(match$9[0], end_ind$1); - var match$10 = Caml_string.get(str, str_ind_3); - var switcher = match$10 - 45 | 0; - if (switcher > 12 || switcher < 0) { - if (switcher !== 17) { - throw Caml_builtin_exceptions.not_found; - } - var s = $$String.sub(str, str_ind$1 - 2 | 0, (str_ind_3 - str_ind$1 | 0) + 3 | 0); - match$7 = /* tuple */[ - str_ind_3 + 1 | 0, - /* Break */Block.__(0, [ - s, - width, - 0 - ]) - ]; - } else if (switcher === 2 || switcher === 1) { - throw Caml_builtin_exceptions.not_found; - } else { - var match$11 = parse_integer(str_ind_3, end_ind$1); - var str_ind_5 = parse_spaces(match$11[0], end_ind$1); - if (Caml_string.get(str, str_ind_5) !== /* ">" */62) { - throw Caml_builtin_exceptions.not_found; - } - var s$1 = $$String.sub(str, str_ind$1 - 2 | 0, (str_ind_5 - str_ind$1 | 0) + 3 | 0); - match$7 = /* tuple */[ - str_ind_5 + 1 | 0, - /* Break */Block.__(0, [ - s$1, - width, - match$11[1] - ]) - ]; - } - } - - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn === Caml_builtin_exceptions.not_found || exn[0] === Caml_builtin_exceptions.failure) { - match$7 = /* tuple */[ - str_ind$1, - /* Break */Block.__(0, [ - "@;", - 1, - 0 - ]) - ]; - } else { - throw exn; - } - } - var next_ind = match$7[0]; - var match$12 = parse_literal(next_ind, next_ind, end_ind$1); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - match$7[1], - match$12[0] - ])]; - case 28 : - var str_ind$2 = str_ind + 1 | 0; - var end_ind$2 = end_ind; - var match$13; - try { - var str_ind_1$1 = parse_spaces(str_ind$2, end_ind$2); - var match$14 = Caml_string.get(str, str_ind_1$1); - var exit$1 = 0; - if (match$14 >= 48) { - if (match$14 >= 58) { - match$13 = undefined; - } else { - exit$1 = 1; - } - } else if (match$14 !== 45) { - match$13 = undefined; - } else { - exit$1 = 1; - } - if (exit$1 === 1) { - var match$15 = parse_integer(str_ind_1$1, end_ind$2); - var str_ind_3$1 = parse_spaces(match$15[0], end_ind$2); - if (Caml_string.get(str, str_ind_3$1) !== /* ">" */62) { - throw Caml_builtin_exceptions.not_found; - } - var s$2 = $$String.sub(str, str_ind$2 - 2 | 0, (str_ind_3$1 - str_ind$2 | 0) + 3 | 0); - match$13 = /* tuple */[ - str_ind_3$1 + 1 | 0, - /* Magic_size */Block.__(1, [ - s$2, - match$15[1] - ]) - ]; - } - - } - catch (raw_exn$1){ - var exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1 === Caml_builtin_exceptions.not_found || exn$1[0] === Caml_builtin_exceptions.failure) { - match$13 = undefined; - } else { - throw exn$1; - } - } - if (match$13 !== undefined) { - var match$16 = match$13; - var next_ind$1 = match$16[0]; - var match$17 = parse_literal(next_ind$1, next_ind$1, end_ind$2); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - match$16[1], - match$17[0] - ])]; - } else { - var match$18 = parse_literal(str_ind$2, str_ind$2, end_ind$2); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Scan_indic */Block.__(2, [/* "<" */60]), - match$18[0] - ])]; - } - case 1 : - case 2 : - case 3 : - case 4 : - case 6 : - case 7 : - case 8 : - case 9 : - case 10 : - case 11 : - case 13 : - case 15 : - case 16 : - case 17 : - case 18 : - case 19 : - case 20 : - case 21 : - case 22 : - case 23 : - case 24 : - case 25 : - case 26 : - case 29 : - case 30 : - break; - case 31 : - var beg_ind$6 = str_ind + 1 | 0; - var match$19 = parse_literal(beg_ind$6, beg_ind$6, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* FFlush */2, - match$19[0] - ])]; - case 32 : - var beg_ind$7 = str_ind + 1 | 0; - var match$20 = parse_literal(beg_ind$7, beg_ind$7, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Escaped_at */5, - match$20[0] - ])]; - - } - } - - } else { - var beg_ind$8 = str_ind + 1 | 0; - var match$21 = parse_literal(beg_ind$8, beg_ind$8, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Force_newline */3, - match$21[0] - ])]; - } - var beg_ind$9 = str_ind + 1 | 0; - var match$22 = parse_literal(beg_ind$9, beg_ind$9, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ - /* Scan_indic */Block.__(2, [c]), - match$22[0] - ])]; - } - }; - var add_literal = function (lit_start, str_ind, fmt) { - var size = str_ind - lit_start | 0; - if (size !== 0) { - if (size !== 1) { - return /* Fmt_EBB */[/* String_literal */Block.__(11, [ - $$String.sub(str, lit_start, size), - fmt - ])]; - } else { - return /* Fmt_EBB */[/* Char_literal */Block.__(12, [ - Caml_string.get(str, lit_start), - fmt - ])]; - } - } else { - return /* Fmt_EBB */[fmt]; - } - }; - var parse_format = function (pct_ind, end_ind) { - var pct_ind$1 = pct_ind; - var str_ind = pct_ind + 1 | 0; - var end_ind$1 = end_ind; - if (str_ind === end_ind$1) { - invalid_format_message(end_ind$1, "unexpected end of format"); - } - var match = Caml_string.get(str, str_ind); - if (match !== 95) { - return parse_flags(pct_ind$1, str_ind, end_ind$1, false); - } else { - return parse_flags(pct_ind$1, str_ind + 1 | 0, end_ind$1, true); - } - }; - var parse_literal = function (lit_start, _str_ind, end_ind) { - while(true) { - var str_ind = _str_ind; - if (str_ind === end_ind) { - return add_literal(lit_start, str_ind, /* End_of_format */0); - } else { - var match = Caml_string.get(str, str_ind); - if (match !== 37) { - if (match !== 64) { - _str_ind = str_ind + 1 | 0; - continue ; - } else { - var match$1 = parse_after_at(str_ind + 1 | 0, end_ind); - return add_literal(lit_start, str_ind, match$1[0]); - } - } else { - var match$2 = parse_format(str_ind, end_ind); - return add_literal(lit_start, str_ind, match$2[0]); - } - } - }; - }; - var parse_spaces = function (_str_ind, end_ind) { - while(true) { - var str_ind = _str_ind; - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - if (Caml_string.get(str, str_ind) === /* " " */32) { - _str_ind = str_ind + 1 | 0; - continue ; - } else { - return str_ind; - } - }; - }; - var parse_flags = function (pct_ind, str_ind, end_ind, ign) { - var zero = { - contents: false - }; - var minus = { - contents: false - }; - var plus = { - contents: false - }; - var space = { - contents: false - }; - var hash = { - contents: false - }; - var set_flag = function (str_ind, flag) { - if (flag.contents && !legacy_behavior$1) { - Curry._3(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": at character number ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* String_literal */Block.__(11, [ - ", duplicate flag ", - /* Caml_char */Block.__(1, [/* End_of_format */0]) - ]) - ]) - ]) - ]) - ]), - "invalid format %S: at character number %d, duplicate flag %C" - ]), str, str_ind, Caml_string.get(str, str_ind)); - } - flag.contents = true; - return /* () */0; - }; - var _str_ind = str_ind; - while(true) { - var str_ind$1 = _str_ind; - if (str_ind$1 === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var match = Caml_string.get(str, str_ind$1); - switch (match) { - case 32 : - set_flag(str_ind$1, space); - _str_ind = str_ind$1 + 1 | 0; - continue ; - case 35 : - set_flag(str_ind$1, hash); - _str_ind = str_ind$1 + 1 | 0; - continue ; - case 43 : - set_flag(str_ind$1, plus); - _str_ind = str_ind$1 + 1 | 0; - continue ; - case 45 : - set_flag(str_ind$1, minus); - _str_ind = str_ind$1 + 1 | 0; - continue ; - case 33 : - case 34 : - case 36 : - case 37 : - case 38 : - case 39 : - case 40 : - case 41 : - case 42 : - case 44 : - case 46 : - case 47 : - break; - case 48 : - set_flag(str_ind$1, zero); - _str_ind = str_ind$1 + 1 | 0; - continue ; - default: - - } - var pct_ind$1 = pct_ind; - var str_ind$2 = str_ind$1; - var end_ind$1 = end_ind; - var zero$1 = zero.contents; - var minus$1 = minus.contents; - var plus$1 = plus.contents; - var hash$1 = hash.contents; - var space$1 = space.contents; - var ign$1 = ign; - if (str_ind$2 === end_ind$1) { - invalid_format_message(end_ind$1, "unexpected end of format"); - } - var padty = zero$1 ? ( - minus$1 ? ( - legacy_behavior$1 ? /* Left */0 : incompatible_flag(pct_ind$1, str_ind$2, /* "-" */45, "0") - ) : /* Zeros */2 - ) : ( - minus$1 ? /* Left */0 : /* Right */1 - ); - var match$1 = Caml_string.get(str, str_ind$2); - if (match$1 >= 48) { - if (match$1 < 58) { - var match$2 = parse_positive(str_ind$2, end_ind$1, 0); - return parse_after_padding(pct_ind$1, match$2[0], end_ind$1, minus$1, plus$1, hash$1, space$1, ign$1, /* Lit_padding */Block.__(0, [ - padty, - match$2[1] - ])); - } - - } else if (match$1 === 42) { - return parse_after_padding(pct_ind$1, str_ind$2 + 1 | 0, end_ind$1, minus$1, plus$1, hash$1, space$1, ign$1, /* Arg_padding */Block.__(1, [padty])); - } - switch (padty) { - case /* Left */0 : - if (!legacy_behavior$1) { - invalid_format_without(str_ind$2 - 1 | 0, /* "-" */45, "padding"); - } - return parse_after_padding(pct_ind$1, str_ind$2, end_ind$1, minus$1, plus$1, hash$1, space$1, ign$1, /* No_padding */0); - case /* Right */1 : - return parse_after_padding(pct_ind$1, str_ind$2, end_ind$1, minus$1, plus$1, hash$1, space$1, ign$1, /* No_padding */0); - case /* Zeros */2 : - return parse_after_padding(pct_ind$1, str_ind$2, end_ind$1, minus$1, plus$1, hash$1, space$1, ign$1, /* Lit_padding */Block.__(0, [ - /* Right */1, - 0 - ])); - - } - }; - }; - var search_subformat_end = function (_str_ind, end_ind, c) { - while(true) { - var str_ind = _str_ind; - if (str_ind === end_ind) { - Curry._3(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": unclosed sub-format, expected \"", - /* Char_literal */Block.__(12, [ - /* "%" */37, - /* Char */Block.__(0, [/* String_literal */Block.__(11, [ - "\" at character number ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* End_of_format */0 - ]) - ])]) - ]) - ]) - ]) - ]), - "invalid format %S: unclosed sub-format, expected \"%%%c\" at character number %d" - ]), str, c, end_ind); - } - var match = Caml_string.get(str, str_ind); - if (match !== 37) { - _str_ind = str_ind + 1 | 0; - continue ; - } else { - if ((str_ind + 1 | 0) === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - if (Caml_string.get(str, str_ind + 1 | 0) === c) { - return str_ind; - } else { - var match$1 = Caml_string.get(str, str_ind + 1 | 0); - if (match$1 >= 95) { - if (match$1 >= 123) { - if (match$1 < 126) { - switch (match$1 - 123 | 0) { - case 0 : - var sub_end = search_subformat_end(str_ind + 2 | 0, end_ind, /* "}" */125); - _str_ind = sub_end + 2 | 0; - continue ; - case 1 : - break; - case 2 : - return expected_character(str_ind + 1 | 0, "character ')'", /* "}" */125); - - } - } - - } else if (match$1 < 96) { - if ((str_ind + 2 | 0) === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var match$2 = Caml_string.get(str, str_ind + 2 | 0); - if (match$2 !== 40) { - if (match$2 !== 123) { - _str_ind = str_ind + 3 | 0; - continue ; - } else { - var sub_end$1 = search_subformat_end(str_ind + 3 | 0, end_ind, /* "}" */125); - _str_ind = sub_end$1 + 2 | 0; - continue ; - } - } else { - var sub_end$2 = search_subformat_end(str_ind + 3 | 0, end_ind, /* ")" */41); - _str_ind = sub_end$2 + 2 | 0; - continue ; - } - } - - } else if (match$1 !== 40) { - if (match$1 === 41) { - return expected_character(str_ind + 1 | 0, "character '}'", /* ")" */41); - } - - } else { - var sub_end$3 = search_subformat_end(str_ind + 2 | 0, end_ind, /* ")" */41); - _str_ind = sub_end$3 + 2 | 0; - continue ; - } - _str_ind = str_ind + 2 | 0; - continue ; - } - } - }; - }; - var parse_positive = function (_str_ind, end_ind, _acc) { - while(true) { - var acc = _acc; - var str_ind = _str_ind; - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var c = Caml_string.get(str, str_ind); - if (c > 57 || c < 48) { - return /* tuple */[ - str_ind, - acc - ]; - } else { - var new_acc = Caml_int32.imul(acc, 10) + (c - /* "0" */48 | 0) | 0; - _acc = new_acc; - _str_ind = str_ind + 1 | 0; - continue ; - } - }; - }; - var check_open_box = function (fmt) { - if (typeof fmt === "number" || !(fmt.tag === /* String_literal */11 && typeof fmt[1] === "number")) { - return /* () */0; - } else { - try { - open_box_of_string(fmt[0]); - return /* () */0; - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === Caml_builtin_exceptions.failure) { - return /* () */0; - } else { - throw exn; - } - } - } - }; - var parse_conversion = function (pct_ind, str_ind, end_ind, plus, hash, space, ign, pad, prec, padprec, symb) { - var plus_used = false; - var hash_used = false; - var space_used = false; - var ign_used = { - contents: false - }; - var pad_used = { - contents: false - }; - var prec_used = { - contents: false - }; - var get_int_pad = function (param) { - pad_used.contents = true; - prec_used.contents = true; - if (typeof prec === "number" && prec === 0) { - return pad; - } - if (typeof pad === "number") { - return /* No_padding */0; - } else if (pad.tag) { - if (pad[0] >= 2) { - if (legacy_behavior$1) { - return /* Arg_padding */Block.__(1, [/* Right */1]); - } else { - return incompatible_flag(pct_ind, str_ind, /* "0" */48, "precision"); - } - } else { - return pad; - } - } else if (pad[0] >= 2) { - if (legacy_behavior$1) { - return /* Lit_padding */Block.__(0, [ - /* Right */1, - pad[1] - ]); - } else { - return incompatible_flag(pct_ind, str_ind, /* "0" */48, "precision"); - } - } else { - return pad; - } - }; - var check_no_0 = function (symb, pad) { - if (typeof pad === "number") { - return pad; - } else if (pad.tag) { - if (pad[0] >= 2) { - if (legacy_behavior$1) { - return /* Arg_padding */Block.__(1, [/* Right */1]); - } else { - return incompatible_flag(pct_ind, str_ind, symb, "0"); - } - } else { - return pad; - } - } else if (pad[0] >= 2) { - if (legacy_behavior$1) { - return /* Lit_padding */Block.__(0, [ - /* Right */1, - pad[1] - ]); - } else { - return incompatible_flag(pct_ind, str_ind, symb, "0"); - } - } else { - return pad; - } - }; - var opt_of_pad = function (c, pad) { - if (typeof pad === "number") { - return ; - } else if (pad.tag) { - return incompatible_flag(pct_ind, str_ind, c, "'*'"); - } else { - switch (pad[0]) { - case /* Left */0 : - if (legacy_behavior$1) { - return pad[1]; - } else { - return incompatible_flag(pct_ind, str_ind, c, "'-'"); - } - case /* Right */1 : - return pad[1]; - case /* Zeros */2 : - if (legacy_behavior$1) { - return pad[1]; - } else { - return incompatible_flag(pct_ind, str_ind, c, "'0'"); - } - - } - } - }; - var get_prec_opt = function (param) { - prec_used.contents = true; - if (typeof prec === "number") { - if (prec !== 0) { - return incompatible_flag(pct_ind, str_ind, /* "_" */95, "'*'"); - } else { - return ; - } - } else { - return prec[0]; - } - }; - var fmt_result; - var exit = 0; - var exit$1 = 0; - var exit$2 = 0; - if (symb >= 124) { - exit$1 = 6; - } else { - switch (symb) { - case 33 : - var match = parse_literal(str_ind, str_ind, end_ind); - fmt_result = /* Fmt_EBB */[/* Flush */Block.__(10, [match[0]])]; - break; - case 40 : - var sub_end = search_subformat_end(str_ind, end_ind, /* ")" */41); - var beg_ind = sub_end + 2 | 0; - var match$1 = parse_literal(beg_ind, beg_ind, end_ind); - var fmt_rest = match$1[0]; - var match$2 = parse_literal(str_ind, str_ind, sub_end); - var sub_fmtty = fmtty_of_fmt(match$2[0]); - if (ign_used.contents = true, ign) { - var ignored_000 = opt_of_pad(/* "_" */95, (pad_used.contents = true, pad)); - var ignored = /* Ignored_format_subst */Block.__(9, [ - ignored_000, - sub_fmtty - ]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored, - fmt_rest - ])]; - } else { - fmt_result = /* Fmt_EBB */[/* Format_subst */Block.__(14, [ - opt_of_pad(/* "(" */40, (pad_used.contents = true, pad)), - sub_fmtty, - fmt_rest - ])]; - } - break; - case 44 : - fmt_result = parse_literal(str_ind, str_ind, end_ind); - break; - case 37 : - case 64 : - exit$1 = 4; - break; - case 67 : - var match$3 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$1 = match$3[0]; - fmt_result = (ign_used.contents = true, ign) ? /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - /* Ignored_caml_char */1, - fmt_rest$1 - ])] : /* Fmt_EBB */[/* Caml_char */Block.__(1, [fmt_rest$1])]; - break; - case 78 : - var match$4 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$2 = match$4[0]; - if (ign_used.contents = true, ign) { - var ignored$1 = /* Ignored_scan_get_counter */Block.__(11, [/* Token_counter */2]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$1, - fmt_rest$2 - ])]; - } else { - fmt_result = /* Fmt_EBB */[/* Scan_get_counter */Block.__(21, [ - /* Token_counter */2, - fmt_rest$2 - ])]; - } - break; - case 83 : - var pad$1 = check_no_0(symb, (pad_used.contents = true, padprec)); - var match$5 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$3 = match$5[0]; - if (ign_used.contents = true, ign) { - var ignored$2 = /* Ignored_caml_string */Block.__(1, [opt_of_pad(/* "_" */95, (pad_used.contents = true, padprec))]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$2, - fmt_rest$3 - ])]; - } else { - var match$6 = make_padding_fmt_ebb(pad$1, fmt_rest$3); - fmt_result = /* Fmt_EBB */[/* Caml_string */Block.__(3, [ - match$6[0], - match$6[1] - ])]; - } - break; - case 91 : - var match$7 = parse_char_set(str_ind, end_ind); - var char_set = match$7[1]; - var next_ind = match$7[0]; - var match$8 = parse_literal(next_ind, next_ind, end_ind); - var fmt_rest$4 = match$8[0]; - if (ign_used.contents = true, ign) { - var ignored_000$1 = opt_of_pad(/* "_" */95, (pad_used.contents = true, pad)); - var ignored$3 = /* Ignored_scan_char_set */Block.__(10, [ - ignored_000$1, - char_set - ]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$3, - fmt_rest$4 - ])]; - } else { - fmt_result = /* Fmt_EBB */[/* Scan_char_set */Block.__(20, [ - opt_of_pad(/* "[" */91, (pad_used.contents = true, pad)), - char_set, - fmt_rest$4 - ])]; - } - break; - case 32 : - case 35 : - case 43 : - case 45 : - case 95 : - exit$1 = 5; - break; - case 97 : - var match$9 = parse_literal(str_ind, str_ind, end_ind); - fmt_result = /* Fmt_EBB */[/* Alpha */Block.__(15, [match$9[0]])]; - break; - case 66 : - case 98 : - exit$1 = 3; - break; - case 99 : - var char_format = function (fmt_rest) { - if (ign_used.contents = true, ign) { - return /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - /* Ignored_char */0, - fmt_rest - ])]; - } else { - return /* Fmt_EBB */[/* Char */Block.__(0, [fmt_rest])]; - } - }; - var scan_format = function (fmt_rest) { - if (ign_used.contents = true, ign) { - return /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - /* Ignored_scan_next_char */3, - fmt_rest - ])]; - } else { - return /* Fmt_EBB */[/* Scan_next_char */Block.__(22, [fmt_rest])]; - } - }; - var match$10 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$5 = match$10[0]; - var match$11 = opt_of_pad(/* "c" */99, (pad_used.contents = true, pad)); - fmt_result = match$11 !== undefined ? ( - match$11 !== 0 ? ( - legacy_behavior$1 ? char_format(fmt_rest$5) : invalid_format_message(str_ind, "non-zero widths are unsupported for %c conversions") - ) : scan_format(fmt_rest$5) - ) : char_format(fmt_rest$5); - break; - case 69 : - case 70 : - case 71 : - case 72 : - case 101 : - case 102 : - case 103 : - case 104 : - exit$1 = 2; - break; - case 76 : - case 108 : - case 110 : - exit$2 = 8; - break; - case 114 : - var match$12 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$6 = match$12[0]; - fmt_result = (ign_used.contents = true, ign) ? /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - /* Ignored_reader */2, - fmt_rest$6 - ])] : /* Fmt_EBB */[/* Reader */Block.__(19, [fmt_rest$6])]; - break; - case 115 : - var pad$2 = check_no_0(symb, (pad_used.contents = true, padprec)); - var match$13 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$7 = match$13[0]; - if (ign_used.contents = true, ign) { - var ignored$4 = /* Ignored_string */Block.__(0, [opt_of_pad(/* "_" */95, (pad_used.contents = true, padprec))]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$4, - fmt_rest$7 - ])]; - } else { - var match$14 = make_padding_fmt_ebb(pad$2, fmt_rest$7); - fmt_result = /* Fmt_EBB */[/* String */Block.__(2, [ - match$14[0], - match$14[1] - ])]; - } - break; - case 116 : - var match$15 = parse_literal(str_ind, str_ind, end_ind); - fmt_result = /* Fmt_EBB */[/* Theta */Block.__(16, [match$15[0]])]; - break; - case 88 : - case 100 : - case 105 : - case 111 : - case 117 : - case 120 : - exit$2 = 7; - break; - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - case 8 : - case 9 : - case 10 : - case 11 : - case 12 : - case 13 : - case 14 : - case 15 : - case 16 : - case 17 : - case 18 : - case 19 : - case 20 : - case 21 : - case 22 : - case 23 : - case 24 : - case 25 : - case 26 : - case 27 : - case 28 : - case 29 : - case 30 : - case 31 : - case 34 : - case 36 : - case 38 : - case 39 : - case 41 : - case 42 : - case 46 : - case 47 : - case 48 : - case 49 : - case 50 : - case 51 : - case 52 : - case 53 : - case 54 : - case 55 : - case 56 : - case 57 : - case 58 : - case 59 : - case 60 : - case 61 : - case 62 : - case 63 : - case 65 : - case 68 : - case 73 : - case 74 : - case 75 : - case 77 : - case 79 : - case 80 : - case 81 : - case 82 : - case 84 : - case 85 : - case 86 : - case 87 : - case 89 : - case 90 : - case 92 : - case 93 : - case 94 : - case 96 : - case 106 : - case 107 : - case 109 : - case 112 : - case 113 : - case 118 : - case 119 : - case 121 : - case 122 : - exit$1 = 6; - break; - case 123 : - var sub_end$1 = search_subformat_end(str_ind, end_ind, /* "}" */125); - var match$16 = parse_literal(str_ind, str_ind, sub_end$1); - var beg_ind$1 = sub_end$1 + 2 | 0; - var match$17 = parse_literal(beg_ind$1, beg_ind$1, end_ind); - var fmt_rest$8 = match$17[0]; - var sub_fmtty$1 = fmtty_of_fmt(match$16[0]); - if (ign_used.contents = true, ign) { - var ignored_000$2 = opt_of_pad(/* "_" */95, (pad_used.contents = true, pad)); - var ignored$5 = /* Ignored_format_arg */Block.__(8, [ - ignored_000$2, - sub_fmtty$1 - ]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$5, - fmt_rest$8 - ])]; - } else { - fmt_result = /* Fmt_EBB */[/* Format_arg */Block.__(13, [ - opt_of_pad(/* "{" */123, (pad_used.contents = true, pad)), - sub_fmtty$1, - fmt_rest$8 - ])]; - } - break; - - } - } - switch (exit$2) { - case 7 : - plus_used = true; - hash_used = true; - space_used = true; - var iconv = compute_int_conv(pct_ind, str_ind, plus, hash, space, symb); - var match$18 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$9 = match$18[0]; - if (ign_used.contents = true, ign) { - var ignored_001 = opt_of_pad(/* "_" */95, (pad_used.contents = true, pad)); - var ignored$6 = /* Ignored_int */Block.__(2, [ - iconv, - ignored_001 - ]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$6, - fmt_rest$9 - ])]; - } else { - var match$19 = make_padprec_fmt_ebb(get_int_pad(/* () */0), (prec_used.contents = true, prec), fmt_rest$9); - fmt_result = /* Fmt_EBB */[/* Int */Block.__(4, [ - iconv, - match$19[0], - match$19[1], - match$19[2] - ])]; - } - break; - case 8 : - if (str_ind === end_ind || !is_int_base(Caml_string.get(str, str_ind))) { - var match$20 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$10 = match$20[0]; - var counter = counter_of_char(symb); - if (ign_used.contents = true, ign) { - var ignored$7 = /* Ignored_scan_get_counter */Block.__(11, [counter]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$7, - fmt_rest$10 - ])]; - } else { - fmt_result = /* Fmt_EBB */[/* Scan_get_counter */Block.__(21, [ - counter, - fmt_rest$10 - ])]; - } - } else { - exit$1 = 6; - } - break; - - } - switch (exit$1) { - case 2 : - plus_used = true; - space_used = true; - var fconv = compute_float_conv(pct_ind, str_ind, plus, space, symb); - var match$21 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$11 = match$21[0]; - if (ign_used.contents = true, ign) { - var ignored_000$3 = opt_of_pad(/* "_" */95, (pad_used.contents = true, pad)); - var ignored_001$1 = get_prec_opt(/* () */0); - var ignored$8 = /* Ignored_float */Block.__(6, [ - ignored_000$3, - ignored_001$1 - ]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$8, - fmt_rest$11 - ])]; - } else { - var match$22 = make_padprec_fmt_ebb((pad_used.contents = true, pad), (prec_used.contents = true, prec), fmt_rest$11); - fmt_result = /* Fmt_EBB */[/* Float */Block.__(8, [ - fconv, - match$22[0], - match$22[1], - match$22[2] - ])]; - } - break; - case 3 : - var pad$3 = check_no_0(symb, (pad_used.contents = true, padprec)); - var match$23 = parse_literal(str_ind, str_ind, end_ind); - var fmt_rest$12 = match$23[0]; - if (ign_used.contents = true, ign) { - var ignored$9 = /* Ignored_bool */Block.__(7, [opt_of_pad(/* "_" */95, (pad_used.contents = true, padprec))]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$9, - fmt_rest$12 - ])]; - } else { - var match$24 = make_padding_fmt_ebb(pad$3, fmt_rest$12); - fmt_result = /* Fmt_EBB */[/* Bool */Block.__(9, [ - match$24[0], - match$24[1] - ])]; - } - break; - case 4 : - var match$25 = parse_literal(str_ind, str_ind, end_ind); - fmt_result = /* Fmt_EBB */[/* Char_literal */Block.__(12, [ - symb, - match$25[0] - ])]; - break; - case 5 : - fmt_result = Curry._3(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": at character number ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* String_literal */Block.__(11, [ - ", flag ", - /* Caml_char */Block.__(1, [/* String_literal */Block.__(11, [ - " is only allowed after the '", - /* Char_literal */Block.__(12, [ - /* "%" */37, - /* String_literal */Block.__(11, [ - "', before padding and precision", - /* End_of_format */0 - ]) - ]) - ])]) - ]) - ]) - ]) - ]) - ]), - "invalid format %S: at character number %d, flag %C is only allowed after the '%%', before padding and precision" - ]), str, pct_ind, symb); - break; - case 6 : - if (symb >= 108) { - if (symb >= 111) { - exit = 1; - } else { - switch (symb - 108 | 0) { - case 0 : - plus_used = true; - hash_used = true; - space_used = true; - var iconv$1 = compute_int_conv(pct_ind, str_ind + 1 | 0, plus, hash, space, Caml_string.get(str, str_ind)); - var beg_ind$2 = str_ind + 1 | 0; - var match$26 = parse_literal(beg_ind$2, beg_ind$2, end_ind); - var fmt_rest$13 = match$26[0]; - if (ign_used.contents = true, ign) { - var ignored_001$2 = opt_of_pad(/* "_" */95, (pad_used.contents = true, pad)); - var ignored$10 = /* Ignored_int32 */Block.__(3, [ - iconv$1, - ignored_001$2 - ]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$10, - fmt_rest$13 - ])]; - } else { - var match$27 = make_padprec_fmt_ebb(get_int_pad(/* () */0), (prec_used.contents = true, prec), fmt_rest$13); - fmt_result = /* Fmt_EBB */[/* Int32 */Block.__(5, [ - iconv$1, - match$27[0], - match$27[1], - match$27[2] - ])]; - } - break; - case 1 : - exit = 1; - break; - case 2 : - plus_used = true; - hash_used = true; - space_used = true; - var iconv$2 = compute_int_conv(pct_ind, str_ind + 1 | 0, plus, hash, space, Caml_string.get(str, str_ind)); - var beg_ind$3 = str_ind + 1 | 0; - var match$28 = parse_literal(beg_ind$3, beg_ind$3, end_ind); - var fmt_rest$14 = match$28[0]; - if (ign_used.contents = true, ign) { - var ignored_001$3 = opt_of_pad(/* "_" */95, (pad_used.contents = true, pad)); - var ignored$11 = /* Ignored_nativeint */Block.__(4, [ - iconv$2, - ignored_001$3 - ]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$11, - fmt_rest$14 - ])]; - } else { - var match$29 = make_padprec_fmt_ebb(get_int_pad(/* () */0), (prec_used.contents = true, prec), fmt_rest$14); - fmt_result = /* Fmt_EBB */[/* Nativeint */Block.__(6, [ - iconv$2, - match$29[0], - match$29[1], - match$29[2] - ])]; - } - break; - - } - } - } else if (symb !== 76) { - exit = 1; - } else { - plus_used = true; - hash_used = true; - space_used = true; - var iconv$3 = compute_int_conv(pct_ind, str_ind + 1 | 0, plus, hash, space, Caml_string.get(str, str_ind)); - var beg_ind$4 = str_ind + 1 | 0; - var match$30 = parse_literal(beg_ind$4, beg_ind$4, end_ind); - var fmt_rest$15 = match$30[0]; - if (ign_used.contents = true, ign) { - var ignored_001$4 = opt_of_pad(/* "_" */95, (pad_used.contents = true, pad)); - var ignored$12 = /* Ignored_int64 */Block.__(5, [ - iconv$3, - ignored_001$4 - ]); - fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ - ignored$12, - fmt_rest$15 - ])]; - } else { - var match$31 = make_padprec_fmt_ebb(get_int_pad(/* () */0), (prec_used.contents = true, prec), fmt_rest$15); - fmt_result = /* Fmt_EBB */[/* Int64 */Block.__(7, [ - iconv$3, - match$31[0], - match$31[1], - match$31[2] - ])]; - } - } - break; - - } - if (exit === 1) { - fmt_result = Curry._3(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": at character number ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* String_literal */Block.__(11, [ - ", invalid conversion \"", - /* Char_literal */Block.__(12, [ - /* "%" */37, - /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ - /* "\"" */34, - /* End_of_format */0 - ])]) - ]) - ]) - ]) - ]) - ]) - ]), - "invalid format %S: at character number %d, invalid conversion \"%%%c\"" - ]), str, str_ind - 1 | 0, symb); - } - if (!legacy_behavior$1) { - if (!plus_used && plus) { - incompatible_flag(pct_ind, str_ind, symb, "'+'"); - } - if (!hash_used && hash) { - incompatible_flag(pct_ind, str_ind, symb, "'#'"); - } - if (!space_used && space) { - incompatible_flag(pct_ind, str_ind, symb, "' '"); - } - if (!pad_used.contents && Caml_obj.caml_notequal(/* Padding_EBB */[pad], /* Padding_EBB */[/* No_padding */0])) { - incompatible_flag(pct_ind, str_ind, symb, "`padding'"); - } - if (!prec_used.contents && Caml_obj.caml_notequal(/* Precision_EBB */[prec], /* Precision_EBB */[/* No_precision */0])) { - incompatible_flag(pct_ind, str_ind, ign ? /* "_" */95 : symb, "`precision'"); - } - if (ign && plus) { - incompatible_flag(pct_ind, str_ind, /* "_" */95, "'+'"); - } - - } - if (!ign_used.contents && ign) { - var exit$3 = 0; - if (symb >= 38) { - if (symb !== 44) { - if (symb !== 64 || !legacy_behavior$1) { - exit$3 = 1; - } - - } else if (!legacy_behavior$1) { - exit$3 = 1; - } - - } else if (symb !== 33) { - if (!(symb >= 37 && legacy_behavior$1)) { - exit$3 = 1; - } - - } else if (!legacy_behavior$1) { - exit$3 = 1; - } - if (exit$3 === 1) { - incompatible_flag(pct_ind, str_ind, symb, "'_'"); - } - - } - return fmt_result; - }; - var parse_integer = function (str_ind, end_ind) { - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var match = Caml_string.get(str, str_ind); - if (match >= 48) { - if (match >= 58) { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 2814, - 11 - ] - ]; - } - return parse_positive(str_ind, end_ind, 0); - } else { - if (match !== 45) { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 2814, - 11 - ] - ]; - } - if ((str_ind + 1 | 0) === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var c = Caml_string.get(str, str_ind + 1 | 0); - if (c > 57 || c < 48) { - return expected_character(str_ind + 1 | 0, "digit", c); - } else { - var match$1 = parse_positive(str_ind + 1 | 0, end_ind, 0); - return /* tuple */[ - match$1[0], - -match$1[1] | 0 - ]; - } - } - }; - var incompatible_flag = function (pct_ind, str_ind, symb, option) { - var subfmt = $$String.sub(str, pct_ind, str_ind - pct_ind | 0); - return Curry._5(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": at character number ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* String_literal */Block.__(11, [ - ", ", - /* String */Block.__(2, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - " is incompatible with '", - /* Char */Block.__(0, [/* String_literal */Block.__(11, [ - "' in sub-format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* End_of_format */0 - ]) - ])]) - ]) - ]) - ]) - ]) - ]) - ]) - ]), - "invalid format %S: at character number %d, %s is incompatible with '%c' in sub-format %S" - ]), str, pct_ind, option, symb, subfmt); - }; - var parse_after_padding = function (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad) { - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var symb = Caml_string.get(str, str_ind); - if (symb !== 46) { - return parse_conversion(pct_ind, str_ind + 1 | 0, end_ind, plus, hash, space, ign, pad, /* No_precision */0, pad, symb); - } else { - var pct_ind$1 = pct_ind; - var str_ind$1 = str_ind + 1 | 0; - var end_ind$1 = end_ind; - var minus$1 = minus; - var plus$1 = plus; - var hash$1 = hash; - var space$1 = space; - var ign$1 = ign; - var pad$1 = pad; - if (str_ind$1 === end_ind$1) { - invalid_format_message(end_ind$1, "unexpected end of format"); - } - var parse_literal = function (minus, str_ind) { - var match = parse_positive(str_ind, end_ind$1, 0); - return parse_after_precision(pct_ind$1, match[0], end_ind$1, minus, plus$1, hash$1, space$1, ign$1, pad$1, /* Lit_precision */[match[1]]); - }; - var symb$1 = Caml_string.get(str, str_ind$1); - var exit = 0; - if (symb$1 >= 48) { - if (symb$1 < 58) { - return parse_literal(minus$1, str_ind$1); - } - - } else if (symb$1 >= 42) { - switch (symb$1 - 42 | 0) { - case 0 : - return parse_after_precision(pct_ind$1, str_ind$1 + 1 | 0, end_ind$1, minus$1, plus$1, hash$1, space$1, ign$1, pad$1, /* Arg_precision */1); - case 1 : - case 3 : - exit = 2; - break; - case 2 : - case 4 : - case 5 : - break; - - } - } - if (exit === 2 && legacy_behavior$1) { - return parse_literal(minus$1 || symb$1 === /* "-" */45, str_ind$1 + 1 | 0); - } - if (legacy_behavior$1) { - return parse_after_precision(pct_ind$1, str_ind$1, end_ind$1, minus$1, plus$1, hash$1, space$1, ign$1, pad$1, /* Lit_precision */[0]); - } else { - return invalid_format_without(str_ind$1 - 1 | 0, /* "." */46, "precision"); - } - } - }; - var is_int_base = function (symb) { - switch (symb) { - case 89 : - case 90 : - case 91 : - case 92 : - case 93 : - case 94 : - case 95 : - case 96 : - case 97 : - case 98 : - case 99 : - case 101 : - case 102 : - case 103 : - case 104 : - case 106 : - case 107 : - case 108 : - case 109 : - case 110 : - case 112 : - case 113 : - case 114 : - case 115 : - case 116 : - case 118 : - case 119 : - return false; - case 88 : - case 100 : - case 105 : - case 111 : - case 117 : - case 120 : - return true; - default: - return false; - } - }; - var counter_of_char = function (symb) { - if (symb >= 108) { - if (symb < 111) { - switch (symb - 108 | 0) { - case 0 : - return /* Line_counter */0; - case 1 : - break; - case 2 : - return /* Char_counter */1; - - } - } - - } else if (symb === 76) { - return /* Token_counter */2; - } - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 2876, - 34 - ] - ]; - }; - var parse_char_set = function (str_ind, end_ind) { - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var char_set = Bytes.make(32, /* "\000" */0); - var add_range = function (c, c$prime) { - for(var i = c; i <= c$prime; ++i){ - add_in_char_set(char_set, Pervasives.char_of_int(i)); - } - return /* () */0; - }; - var fail_single_percent = function (str_ind) { - return Curry._2(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "invalid format ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - ": '", - /* Char_literal */Block.__(12, [ - /* "%" */37, - /* String_literal */Block.__(11, [ - "' alone is not accepted in character sets, use ", - /* Char_literal */Block.__(12, [ - /* "%" */37, - /* Char_literal */Block.__(12, [ - /* "%" */37, - /* String_literal */Block.__(11, [ - " instead at position ", - /* Int */Block.__(4, [ - /* Int_d */0, - /* No_padding */0, - /* No_precision */0, - /* Char_literal */Block.__(12, [ - /* "." */46, - /* End_of_format */0 - ]) - ]) - ]) - ]) - ]) - ]) - ]) - ]) - ]) - ]), - "invalid format %S: '%%' alone is not accepted in character sets, use %%%% instead at position %d." - ]), str, str_ind); - }; - var parse_char_set_content = function (_str_ind, end_ind) { - while(true) { - var str_ind = _str_ind; - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var c = Caml_string.get(str, str_ind); - if (c !== 45) { - if (c !== 93) { - return parse_char_set_after_char(str_ind + 1 | 0, end_ind, c); - } else { - return str_ind + 1 | 0; - } - } else { - add_in_char_set(char_set, /* "-" */45); - _str_ind = str_ind + 1 | 0; - continue ; - } - }; - }; - var parse_char_set_after_char = function (_str_ind, end_ind, _c) { - while(true) { - var c = _c; - var str_ind = _str_ind; - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var c$prime = Caml_string.get(str, str_ind); - var exit = 0; - if (c$prime >= 46) { - if (c$prime !== 64) { - if (c$prime === 93) { - add_in_char_set(char_set, c); - return str_ind + 1 | 0; - } - - } else { - exit = 2; - } - } else if (c$prime !== 37) { - if (c$prime >= 45) { - var str_ind$1 = str_ind + 1 | 0; - var end_ind$1 = end_ind; - var c$1 = c; - if (str_ind$1 === end_ind$1) { - invalid_format_message(end_ind$1, "unexpected end of format"); - } - var c$prime$1 = Caml_string.get(str, str_ind$1); - if (c$prime$1 !== 37) { - if (c$prime$1 !== 93) { - add_range(c$1, c$prime$1); - return parse_char_set_content(str_ind$1 + 1 | 0, end_ind$1); - } else { - add_in_char_set(char_set, c$1); - add_in_char_set(char_set, /* "-" */45); - return str_ind$1 + 1 | 0; - } - } else { - if ((str_ind$1 + 1 | 0) === end_ind$1) { - invalid_format_message(end_ind$1, "unexpected end of format"); - } - var c$prime$2 = Caml_string.get(str, str_ind$1 + 1 | 0); - if (c$prime$2 !== 37 && c$prime$2 !== 64) { - return fail_single_percent(str_ind$1); - } - add_range(c$1, c$prime$2); - return parse_char_set_content(str_ind$1 + 2 | 0, end_ind$1); - } - } - - } else { - exit = 2; - } - if (exit === 2 && c === /* "%" */37) { - add_in_char_set(char_set, c$prime); - return parse_char_set_content(str_ind + 1 | 0, end_ind); - } - if (c === /* "%" */37) { - fail_single_percent(str_ind); - } - add_in_char_set(char_set, c); - _c = c$prime; - _str_ind = str_ind + 1 | 0; - continue ; - }; - }; - var parse_char_set_start = function (str_ind, end_ind) { - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var c = Caml_string.get(str, str_ind); - return parse_char_set_after_char(str_ind + 1 | 0, end_ind, c); - }; - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var match = Caml_string.get(str, str_ind); - var match$1 = match !== 94 ? /* tuple */[ - str_ind, - false - ] : /* tuple */[ - str_ind + 1 | 0, - true - ]; - var next_ind = parse_char_set_start(match$1[0], end_ind); - var char_set$1 = Bytes.to_string(char_set); - return /* tuple */[ - next_ind, - match$1[1] ? rev_char_set(char_set$1) : char_set$1 - ]; - }; - var compute_int_conv = function (pct_ind, str_ind, _plus, _hash, _space, symb) { - while(true) { - var space = _space; - var hash = _hash; - var plus = _plus; - var exit = 0; - if (plus) { - if (hash) { - exit = 2; - } else if (!space) { - if (symb !== 100) { - if (symb === 105) { - return /* Int_pi */4; - } - - } else { - return /* Int_pd */1; - } - } - - } else if (hash) { - if (space) { - exit = 2; - } else if (symb !== 88) { - if (symb !== 111) { - if (symb !== 120) { - exit = 2; - } else { - return /* Int_Cx */7; - } - } else { - return /* Int_Co */11; - } - } else { - return /* Int_CX */9; - } - } else if (space) { - if (symb !== 100) { - if (symb === 105) { - return /* Int_si */5; - } - - } else { - return /* Int_sd */2; - } - } else { - switch (symb) { - case 88 : - return /* Int_X */8; - case 100 : - return /* Int_d */0; - case 105 : - return /* Int_i */3; - case 111 : - return /* Int_o */10; - case 117 : - return /* Int_u */12; - case 89 : - case 90 : - case 91 : - case 92 : - case 93 : - case 94 : - case 95 : - case 96 : - case 97 : - case 98 : - case 99 : - case 101 : - case 102 : - case 103 : - case 104 : - case 106 : - case 107 : - case 108 : - case 109 : - case 110 : - case 112 : - case 113 : - case 114 : - case 115 : - case 116 : - case 118 : - case 119 : - break; - case 120 : - return /* Int_x */6; - default: - - } - } - if (exit === 2) { - var exit$1 = 0; - switch (symb) { - case 88 : - if (legacy_behavior$1) { - return /* Int_CX */9; - } - break; - case 111 : - if (legacy_behavior$1) { - return /* Int_Co */11; - } - break; - case 100 : - case 105 : - case 117 : - exit$1 = 3; - break; - case 89 : - case 90 : - case 91 : - case 92 : - case 93 : - case 94 : - case 95 : - case 96 : - case 97 : - case 98 : - case 99 : - case 101 : - case 102 : - case 103 : - case 104 : - case 106 : - case 107 : - case 108 : - case 109 : - case 110 : - case 112 : - case 113 : - case 114 : - case 115 : - case 116 : - case 118 : - case 119 : - break; - case 120 : - if (legacy_behavior$1) { - return /* Int_Cx */7; - } - break; - default: - - } - if (exit$1 === 3) { - if (legacy_behavior$1) { - _hash = false; - continue ; - } else { - return incompatible_flag(pct_ind, str_ind, symb, "'#'"); - } - } - - } - if (plus) { - if (space) { - if (legacy_behavior$1) { - _space = false; - continue ; - } else { - return incompatible_flag(pct_ind, str_ind, /* " " */32, "'+'"); - } - } else if (legacy_behavior$1) { - _plus = false; - continue ; - } else { - return incompatible_flag(pct_ind, str_ind, symb, "'+'"); - } - } else if (space) { - if (legacy_behavior$1) { - _space = false; - continue ; - } else { - return incompatible_flag(pct_ind, str_ind, symb, "' '"); - } - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 2909, - 28 - ] - ]; - } - }; - }; - var compute_float_conv = function (pct_ind, str_ind, _plus, _space, symb) { - while(true) { - var space = _space; - var plus = _plus; - if (plus) { - if (space) { - if (legacy_behavior$1) { - _space = false; - continue ; - } else { - return incompatible_flag(pct_ind, str_ind, /* " " */32, "'+'"); - } - } else { - if (symb >= 73) { - switch (symb) { - case 101 : - return /* Float_pe */4; - case 102 : - return /* Float_pf */1; - case 103 : - return /* Float_pg */10; - case 104 : - return /* Float_ph */17; - default: - - } - } else if (symb >= 69) { - switch (symb - 69 | 0) { - case 0 : - return /* Float_pE */7; - case 1 : - break; - case 2 : - return /* Float_pG */13; - case 3 : - return /* Float_pH */20; - - } - } - if (legacy_behavior$1) { - _plus = false; - continue ; - } else { - return incompatible_flag(pct_ind, str_ind, symb, "'+'"); - } - } - } else if (space) { - if (symb >= 73) { - switch (symb) { - case 101 : - return /* Float_se */5; - case 102 : - return /* Float_sf */2; - case 103 : - return /* Float_sg */11; - case 104 : - return /* Float_sh */18; - default: - - } - } else if (symb >= 69) { - switch (symb - 69 | 0) { - case 0 : - return /* Float_sE */8; - case 1 : - break; - case 2 : - return /* Float_sG */14; - case 3 : - return /* Float_sH */21; - - } - } - if (legacy_behavior$1) { - _space = false; - continue ; - } else { - return incompatible_flag(pct_ind, str_ind, symb, "' '"); - } - } else if (symb >= 73) { - switch (symb) { - case 101 : - return /* Float_e */3; - case 102 : - return /* Float_f */0; - case 103 : - return /* Float_g */9; - case 104 : - return /* Float_h */16; - default: - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 2943, - 25 - ] - ]; - } - } else if (symb >= 69) { - switch (symb - 69 | 0) { - case 0 : - return /* Float_E */6; - case 1 : - return /* Float_F */15; - case 2 : - return /* Float_G */12; - case 3 : - return /* Float_H */19; - - } - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "camlinternalFormat.ml", - 2943, - 25 - ] - ]; - } - }; - }; - var parse_after_precision = function (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad, prec) { - if (str_ind === end_ind) { - invalid_format_message(end_ind, "unexpected end of format"); - } - var parse_conv = function (padprec) { - return parse_conversion(pct_ind, str_ind + 1 | 0, end_ind, plus, hash, space, ign, pad, prec, padprec, Caml_string.get(str, str_ind)); - }; - if (typeof pad === "number") { - if (typeof prec === "number" && prec === 0) { - return parse_conv(/* No_padding */0); - } - if (minus) { - if (typeof prec === "number") { - return parse_conv(/* Arg_padding */Block.__(1, [/* Left */0])); - } else { - return parse_conv(/* Lit_padding */Block.__(0, [ - /* Left */0, - prec[0] - ])); - } - } else if (typeof prec === "number") { - return parse_conv(/* Arg_padding */Block.__(1, [/* Right */1])); - } else { - return parse_conv(/* Lit_padding */Block.__(0, [ - /* Right */1, - prec[0] - ])); - } - } else { - return parse_conv(pad); - } - }; - var parse_tag = function (is_open_tag, str_ind, end_ind) { - try { - if (str_ind === end_ind) { - throw Caml_builtin_exceptions.not_found; - } - var match = Caml_string.get(str, str_ind); - if (match !== 60) { - throw Caml_builtin_exceptions.not_found; - } - var ind = $$String.index_from(str, str_ind + 1 | 0, /* ">" */62); - if (ind >= end_ind) { - throw Caml_builtin_exceptions.not_found; - } - var sub_str = $$String.sub(str, str_ind, (ind - str_ind | 0) + 1 | 0); - var beg_ind = ind + 1 | 0; - var match$1 = parse_literal(beg_ind, beg_ind, end_ind); - var match$2 = parse_literal(str_ind, str_ind, ind + 1 | 0); - var sub_fmt = match$2[0]; - var sub_format = /* Format */[ - sub_fmt, - sub_str - ]; - var formatting = is_open_tag ? /* Open_tag */Block.__(0, [sub_format]) : (check_open_box(sub_fmt), /* Open_box */Block.__(1, [sub_format])); - return /* Fmt_EBB */[/* Formatting_gen */Block.__(18, [ - formatting, - match$1[0] - ])]; - } - catch (exn){ - if (exn === Caml_builtin_exceptions.not_found) { - var match$3 = parse_literal(str_ind, str_ind, end_ind); - var sub_format$1 = /* Format */[ - /* End_of_format */0, - "" - ]; - var formatting$1 = is_open_tag ? /* Open_tag */Block.__(0, [sub_format$1]) : /* Open_box */Block.__(1, [sub_format$1]); - return /* Fmt_EBB */[/* Formatting_gen */Block.__(18, [ - formatting$1, - match$3[0] - ])]; - } else { - throw exn; - } - } - }; - return parse_literal(0, 0, str.length); -} - -function format_of_string_fmtty(str, fmtty) { - var match = fmt_ebb_of_string(undefined, str); - try { - return /* Format */[ - type_format(match[0], fmtty), - str - ]; - } - catch (exn){ - if (exn === Type_mismatch) { - return Curry._2(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "bad input: format type mismatch between ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - " and ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* End_of_format */0 - ]) - ]) - ]) - ]), - "bad input: format type mismatch between %S and %S" - ]), str, string_of_fmtty(fmtty)); - } else { - throw exn; - } - } -} - -function format_of_string_format(str, param) { - var match = fmt_ebb_of_string(undefined, str); - try { - return /* Format */[ - type_format(match[0], fmtty_of_fmt(param[0])), - str - ]; - } - catch (exn){ - if (exn === Type_mismatch) { - return Curry._2(failwith_message(/* Format */[ - /* String_literal */Block.__(11, [ - "bad input: format type mismatch between ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* String_literal */Block.__(11, [ - " and ", - /* Caml_string */Block.__(3, [ - /* No_padding */0, - /* End_of_format */0 - ]) - ]) - ]) - ]), - "bad input: format type mismatch between %S and %S" - ]), str, param[1]); - } else { - throw exn; - } - } -} - -exports.is_in_char_set = is_in_char_set; -exports.rev_char_set = rev_char_set; -exports.create_char_set = create_char_set; -exports.add_in_char_set = add_in_char_set; -exports.freeze_char_set = freeze_char_set; -exports.param_format_of_ignored_format = param_format_of_ignored_format; -exports.make_printf = make_printf; -exports.make_iprintf = make_iprintf; -exports.output_acc = output_acc; -exports.bufput_acc = bufput_acc; -exports.strput_acc = strput_acc; -exports.type_format = type_format; -exports.fmt_ebb_of_string = fmt_ebb_of_string; -exports.format_of_string_fmtty = format_of_string_fmtty; -exports.format_of_string_format = format_of_string_format; -exports.char_of_iconv = char_of_iconv; -exports.string_of_formatting_lit = string_of_formatting_lit; -exports.string_of_formatting_gen = string_of_formatting_gen; -exports.string_of_fmtty = string_of_fmtty; -exports.string_of_fmt = string_of_fmt; -exports.open_box_of_string = open_box_of_string; -exports.symm = symm; -exports.trans = trans; -exports.recast = recast; -/* No side effect */ - -},{"./block.js":36,"./buffer.js":37,"./bytes.js":38,"./caml_builtin_exceptions.js":40,"./caml_bytes.js":41,"./caml_exceptions.js":42,"./caml_format.js":44,"./caml_int32.js":45,"./caml_io.js":47,"./caml_js_exceptions.js":48,"./caml_obj.js":49,"./caml_primitive.js":51,"./caml_string.js":52,"./camlinternalFormatBasics.js":56,"./char.js":57,"./curry.js":58,"./pervasives.js":62,"./string.js":64}],56:[function(require,module,exports){ -'use strict'; - -var Block = require("./block.js"); - -function erase_rel(param) { - if (typeof param === "number") { - return /* End_of_fmtty */0; - } else { - switch (param.tag | 0) { - case /* Char_ty */0 : - return /* Char_ty */Block.__(0, [erase_rel(param[0])]); - case /* String_ty */1 : - return /* String_ty */Block.__(1, [erase_rel(param[0])]); - case /* Int_ty */2 : - return /* Int_ty */Block.__(2, [erase_rel(param[0])]); - case /* Int32_ty */3 : - return /* Int32_ty */Block.__(3, [erase_rel(param[0])]); - case /* Nativeint_ty */4 : - return /* Nativeint_ty */Block.__(4, [erase_rel(param[0])]); - case /* Int64_ty */5 : - return /* Int64_ty */Block.__(5, [erase_rel(param[0])]); - case /* Float_ty */6 : - return /* Float_ty */Block.__(6, [erase_rel(param[0])]); - case /* Bool_ty */7 : - return /* Bool_ty */Block.__(7, [erase_rel(param[0])]); - case /* Format_arg_ty */8 : - return /* Format_arg_ty */Block.__(8, [ - param[0], - erase_rel(param[1]) - ]); - case /* Format_subst_ty */9 : - var ty1 = param[0]; - return /* Format_subst_ty */Block.__(9, [ - ty1, - ty1, - erase_rel(param[2]) - ]); - case /* Alpha_ty */10 : - return /* Alpha_ty */Block.__(10, [erase_rel(param[0])]); - case /* Theta_ty */11 : - return /* Theta_ty */Block.__(11, [erase_rel(param[0])]); - case /* Any_ty */12 : - return /* Any_ty */Block.__(12, [erase_rel(param[0])]); - case /* Reader_ty */13 : - return /* Reader_ty */Block.__(13, [erase_rel(param[0])]); - case /* Ignored_reader_ty */14 : - return /* Ignored_reader_ty */Block.__(14, [erase_rel(param[0])]); - - } - } -} - -function concat_fmtty(fmtty1, fmtty2) { - if (typeof fmtty1 === "number") { - return fmtty2; - } else { - switch (fmtty1.tag | 0) { - case /* Char_ty */0 : - return /* Char_ty */Block.__(0, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* String_ty */1 : - return /* String_ty */Block.__(1, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Int_ty */2 : - return /* Int_ty */Block.__(2, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Int32_ty */3 : - return /* Int32_ty */Block.__(3, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Nativeint_ty */4 : - return /* Nativeint_ty */Block.__(4, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Int64_ty */5 : - return /* Int64_ty */Block.__(5, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Float_ty */6 : - return /* Float_ty */Block.__(6, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Bool_ty */7 : - return /* Bool_ty */Block.__(7, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Format_arg_ty */8 : - return /* Format_arg_ty */Block.__(8, [ - fmtty1[0], - concat_fmtty(fmtty1[1], fmtty2) - ]); - case /* Format_subst_ty */9 : - return /* Format_subst_ty */Block.__(9, [ - fmtty1[0], - fmtty1[1], - concat_fmtty(fmtty1[2], fmtty2) - ]); - case /* Alpha_ty */10 : - return /* Alpha_ty */Block.__(10, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Theta_ty */11 : - return /* Theta_ty */Block.__(11, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Any_ty */12 : - return /* Any_ty */Block.__(12, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Reader_ty */13 : - return /* Reader_ty */Block.__(13, [concat_fmtty(fmtty1[0], fmtty2)]); - case /* Ignored_reader_ty */14 : - return /* Ignored_reader_ty */Block.__(14, [concat_fmtty(fmtty1[0], fmtty2)]); - - } - } -} - -function concat_fmt(fmt1, fmt2) { - if (typeof fmt1 === "number") { - return fmt2; - } else { - switch (fmt1.tag | 0) { - case /* Char */0 : - return /* Char */Block.__(0, [concat_fmt(fmt1[0], fmt2)]); - case /* Caml_char */1 : - return /* Caml_char */Block.__(1, [concat_fmt(fmt1[0], fmt2)]); - case /* String */2 : - return /* String */Block.__(2, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Caml_string */3 : - return /* Caml_string */Block.__(3, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Int */4 : - return /* Int */Block.__(4, [ - fmt1[0], - fmt1[1], - fmt1[2], - concat_fmt(fmt1[3], fmt2) - ]); - case /* Int32 */5 : - return /* Int32 */Block.__(5, [ - fmt1[0], - fmt1[1], - fmt1[2], - concat_fmt(fmt1[3], fmt2) - ]); - case /* Nativeint */6 : - return /* Nativeint */Block.__(6, [ - fmt1[0], - fmt1[1], - fmt1[2], - concat_fmt(fmt1[3], fmt2) - ]); - case /* Int64 */7 : - return /* Int64 */Block.__(7, [ - fmt1[0], - fmt1[1], - fmt1[2], - concat_fmt(fmt1[3], fmt2) - ]); - case /* Float */8 : - return /* Float */Block.__(8, [ - fmt1[0], - fmt1[1], - fmt1[2], - concat_fmt(fmt1[3], fmt2) - ]); - case /* Bool */9 : - return /* Bool */Block.__(9, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Flush */10 : - return /* Flush */Block.__(10, [concat_fmt(fmt1[0], fmt2)]); - case /* String_literal */11 : - return /* String_literal */Block.__(11, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Char_literal */12 : - return /* Char_literal */Block.__(12, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Format_arg */13 : - return /* Format_arg */Block.__(13, [ - fmt1[0], - fmt1[1], - concat_fmt(fmt1[2], fmt2) - ]); - case /* Format_subst */14 : - return /* Format_subst */Block.__(14, [ - fmt1[0], - fmt1[1], - concat_fmt(fmt1[2], fmt2) - ]); - case /* Alpha */15 : - return /* Alpha */Block.__(15, [concat_fmt(fmt1[0], fmt2)]); - case /* Theta */16 : - return /* Theta */Block.__(16, [concat_fmt(fmt1[0], fmt2)]); - case /* Formatting_lit */17 : - return /* Formatting_lit */Block.__(17, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Formatting_gen */18 : - return /* Formatting_gen */Block.__(18, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Reader */19 : - return /* Reader */Block.__(19, [concat_fmt(fmt1[0], fmt2)]); - case /* Scan_char_set */20 : - return /* Scan_char_set */Block.__(20, [ - fmt1[0], - fmt1[1], - concat_fmt(fmt1[2], fmt2) - ]); - case /* Scan_get_counter */21 : - return /* Scan_get_counter */Block.__(21, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Scan_next_char */22 : - return /* Scan_next_char */Block.__(22, [concat_fmt(fmt1[0], fmt2)]); - case /* Ignored_param */23 : - return /* Ignored_param */Block.__(23, [ - fmt1[0], - concat_fmt(fmt1[1], fmt2) - ]); - case /* Custom */24 : - return /* Custom */Block.__(24, [ - fmt1[0], - fmt1[1], - concat_fmt(fmt1[2], fmt2) - ]); - - } - } -} - -exports.concat_fmtty = concat_fmtty; -exports.erase_rel = erase_rel; -exports.concat_fmt = concat_fmt; -/* No side effect */ - -},{"./block.js":36}],57:[function(require,module,exports){ -'use strict'; - -var Caml_bytes = require("./caml_bytes.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function chr(n) { - if (n < 0 || n > 255) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "Char.chr" - ]; - } - return n; -} - -function escaped(c) { - var exit = 0; - if (c >= 40) { - if (c !== 92) { - exit = c >= 127 ? 1 : 2; - } else { - return "\\\\"; - } - } else if (c >= 32) { - if (c >= 39) { - return "\\'"; - } else { - exit = 2; - } - } else if (c >= 14) { - exit = 1; - } else { - switch (c) { - case 8 : - return "\\b"; - case 9 : - return "\\t"; - case 10 : - return "\\n"; - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - case 11 : - case 12 : - exit = 1; - break; - case 13 : - return "\\r"; - - } - } - switch (exit) { - case 1 : - var s = [ - 0, - 0, - 0, - 0 - ]; - s[0] = /* "\\" */92; - s[1] = 48 + (c / 100 | 0) | 0; - s[2] = 48 + (c / 10 | 0) % 10 | 0; - s[3] = 48 + c % 10 | 0; - return Caml_bytes.bytes_to_string(s); - case 2 : - var s$1 = [0]; - s$1[0] = c; - return Caml_bytes.bytes_to_string(s$1); - - } -} - -function lowercase(c) { - if (c >= /* "A" */65 && c <= /* "Z" */90 || c >= /* "\192" */192 && c <= /* "\214" */214 || c >= /* "\216" */216 && c <= /* "\222" */222) { - return c + 32 | 0; - } else { - return c; - } -} - -function uppercase(c) { - if (c >= /* "a" */97 && c <= /* "z" */122 || c >= /* "\224" */224 && c <= /* "\246" */246 || c >= /* "\248" */248 && c <= /* "\254" */254) { - return c - 32 | 0; - } else { - return c; - } -} - -function lowercase_ascii(c) { - if (c >= /* "A" */65 && c <= /* "Z" */90) { - return c + 32 | 0; - } else { - return c; - } -} - -function uppercase_ascii(c) { - if (c >= /* "a" */97 && c <= /* "z" */122) { - return c - 32 | 0; - } else { - return c; - } -} - -function compare(c1, c2) { - return c1 - c2 | 0; -} - -function equal(c1, c2) { - return (c1 - c2 | 0) === 0; -} - -exports.chr = chr; -exports.escaped = escaped; -exports.lowercase = lowercase; -exports.uppercase = uppercase; -exports.lowercase_ascii = lowercase_ascii; -exports.uppercase_ascii = uppercase_ascii; -exports.compare = compare; -exports.equal = equal; -/* No side effect */ - -},{"./caml_builtin_exceptions.js":40,"./caml_bytes.js":41}],58:[function(require,module,exports){ -'use strict'; - -var Caml_array = require("./caml_array.js"); - -function app(_f, _args) { - while(true) { - var args = _args; - var f = _f; - var init_arity = f.length; - var arity = init_arity === 0 ? 1 : init_arity; - var len = args.length; - var d = arity - len | 0; - if (d === 0) { - return f.apply(null, args); - } else if (d < 0) { - _args = Caml_array.caml_array_sub(args, arity, -d | 0); - _f = f.apply(null, Caml_array.caml_array_sub(args, 0, arity)); - continue ; - } else { - return (function(f,args){ - return function (x) { - return app(f, args.concat([x])); - } - }(f,args)); - } - }; -} - -function curry_1(o, a0, arity) { - switch (arity) { - case 1 : - return o(a0); - case 2 : - return (function (param) { - return o(a0, param); - }); - case 3 : - return (function (param, param$1) { - return o(a0, param, param$1); - }); - case 4 : - return (function (param, param$1, param$2) { - return o(a0, param, param$1, param$2); - }); - case 5 : - return (function (param, param$1, param$2, param$3) { - return o(a0, param, param$1, param$2, param$3); - }); - case 6 : - return (function (param, param$1, param$2, param$3, param$4) { - return o(a0, param, param$1, param$2, param$3, param$4); - }); - case 7 : - return (function (param, param$1, param$2, param$3, param$4, param$5) { - return o(a0, param, param$1, param$2, param$3, param$4, param$5); - }); - default: - return app(o, [a0]); - } -} - -function _1(o, a0) { - var arity = o.length; - if (arity === 1) { - return o(a0); - } else { - return curry_1(o, a0, arity); - } -} - -function __1(o) { - var arity = o.length; - if (arity === 1) { - return o; - } else { - return (function (a0) { - return _1(o, a0); - }); - } -} - -function curry_2(o, a0, a1, arity) { - switch (arity) { - case 1 : - return app(o(a0), [a1]); - case 2 : - return o(a0, a1); - case 3 : - return (function (param) { - return o(a0, a1, param); - }); - case 4 : - return (function (param, param$1) { - return o(a0, a1, param, param$1); - }); - case 5 : - return (function (param, param$1, param$2) { - return o(a0, a1, param, param$1, param$2); - }); - case 6 : - return (function (param, param$1, param$2, param$3) { - return o(a0, a1, param, param$1, param$2, param$3); - }); - case 7 : - return (function (param, param$1, param$2, param$3, param$4) { - return o(a0, a1, param, param$1, param$2, param$3, param$4); - }); - default: - return app(o, [ - a0, - a1 - ]); - } -} - -function _2(o, a0, a1) { - var arity = o.length; - if (arity === 2) { - return o(a0, a1); - } else { - return curry_2(o, a0, a1, arity); - } -} - -function __2(o) { - var arity = o.length; - if (arity === 2) { - return o; - } else { - return (function (a0, a1) { - return _2(o, a0, a1); - }); - } -} - -function curry_3(o, a0, a1, a2, arity) { - switch (arity) { - case 1 : - return app(o(a0), [ - a1, - a2 - ]); - case 2 : - return app(o(a0, a1), [a2]); - case 3 : - return o(a0, a1, a2); - case 4 : - return (function (param) { - return o(a0, a1, a2, param); - }); - case 5 : - return (function (param, param$1) { - return o(a0, a1, a2, param, param$1); - }); - case 6 : - return (function (param, param$1, param$2) { - return o(a0, a1, a2, param, param$1, param$2); - }); - case 7 : - return (function (param, param$1, param$2, param$3) { - return o(a0, a1, a2, param, param$1, param$2, param$3); - }); - default: - return app(o, [ - a0, - a1, - a2 - ]); - } -} - -function _3(o, a0, a1, a2) { - var arity = o.length; - if (arity === 3) { - return o(a0, a1, a2); - } else { - return curry_3(o, a0, a1, a2, arity); - } -} - -function __3(o) { - var arity = o.length; - if (arity === 3) { - return o; - } else { - return (function (a0, a1, a2) { - return _3(o, a0, a1, a2); - }); - } -} - -function curry_4(o, a0, a1, a2, a3, arity) { - switch (arity) { - case 1 : - return app(o(a0), [ - a1, - a2, - a3 - ]); - case 2 : - return app(o(a0, a1), [ - a2, - a3 - ]); - case 3 : - return app(o(a0, a1, a2), [a3]); - case 4 : - return o(a0, a1, a2, a3); - case 5 : - return (function (param) { - return o(a0, a1, a2, a3, param); - }); - case 6 : - return (function (param, param$1) { - return o(a0, a1, a2, a3, param, param$1); - }); - case 7 : - return (function (param, param$1, param$2) { - return o(a0, a1, a2, a3, param, param$1, param$2); - }); - default: - return app(o, [ - a0, - a1, - a2, - a3 - ]); - } -} - -function _4(o, a0, a1, a2, a3) { - var arity = o.length; - if (arity === 4) { - return o(a0, a1, a2, a3); - } else { - return curry_4(o, a0, a1, a2, a3, arity); - } -} - -function __4(o) { - var arity = o.length; - if (arity === 4) { - return o; - } else { - return (function (a0, a1, a2, a3) { - return _4(o, a0, a1, a2, a3); - }); - } -} - -function curry_5(o, a0, a1, a2, a3, a4, arity) { - switch (arity) { - case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4 - ]); - case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4 - ]); - case 3 : - return app(o(a0, a1, a2), [ - a3, - a4 - ]); - case 4 : - return app(o(a0, a1, a2, a3), [a4]); - case 5 : - return o(a0, a1, a2, a3, a4); - case 6 : - return (function (param) { - return o(a0, a1, a2, a3, a4, param); - }); - case 7 : - return (function (param, param$1) { - return o(a0, a1, a2, a3, a4, param, param$1); - }); - default: - return app(o, [ - a0, - a1, - a2, - a3, - a4 - ]); - } -} - -function _5(o, a0, a1, a2, a3, a4) { - var arity = o.length; - if (arity === 5) { - return o(a0, a1, a2, a3, a4); - } else { - return curry_5(o, a0, a1, a2, a3, a4, arity); - } -} - -function __5(o) { - var arity = o.length; - if (arity === 5) { - return o; - } else { - return (function (a0, a1, a2, a3, a4) { - return _5(o, a0, a1, a2, a3, a4); - }); - } -} - -function curry_6(o, a0, a1, a2, a3, a4, a5, arity) { - switch (arity) { - case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5 - ]); - case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5 - ]); - case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5 - ]); - case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5 - ]); - case 5 : - return app(o(a0, a1, a2, a3, a4), [a5]); - case 6 : - return o(a0, a1, a2, a3, a4, a5); - case 7 : - return (function (param) { - return o(a0, a1, a2, a3, a4, a5, param); - }); - default: - return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5 - ]); - } -} - -function _6(o, a0, a1, a2, a3, a4, a5) { - var arity = o.length; - if (arity === 6) { - return o(a0, a1, a2, a3, a4, a5); - } else { - return curry_6(o, a0, a1, a2, a3, a4, a5, arity); - } -} - -function __6(o) { - var arity = o.length; - if (arity === 6) { - return o; - } else { - return (function (a0, a1, a2, a3, a4, a5) { - return _6(o, a0, a1, a2, a3, a4, a5); - }); - } -} - -function curry_7(o, a0, a1, a2, a3, a4, a5, a6, arity) { - switch (arity) { - case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6 - ]); - case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6 - ]); - case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6 - ]); - case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6 - ]); - case 5 : - return app(o(a0, a1, a2, a3, a4), [ - a5, - a6 - ]); - case 6 : - return app(o(a0, a1, a2, a3, a4, a5), [a6]); - case 7 : - return o(a0, a1, a2, a3, a4, a5, a6); - default: - return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5, - a6 - ]); - } -} - -function _7(o, a0, a1, a2, a3, a4, a5, a6) { - var arity = o.length; - if (arity === 7) { - return o(a0, a1, a2, a3, a4, a5, a6); - } else { - return curry_7(o, a0, a1, a2, a3, a4, a5, a6, arity); - } -} - -function __7(o) { - var arity = o.length; - if (arity === 7) { - return o; - } else { - return (function (a0, a1, a2, a3, a4, a5, a6) { - return _7(o, a0, a1, a2, a3, a4, a5, a6); - }); - } -} - -function curry_8(o, a0, a1, a2, a3, a4, a5, a6, a7, arity) { - switch (arity) { - case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6, - a7 - ]); - case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6, - a7 - ]); - case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6, - a7 - ]); - case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6, - a7 - ]); - case 5 : - return app(o(a0, a1, a2, a3, a4), [ - a5, - a6, - a7 - ]); - case 6 : - return app(o(a0, a1, a2, a3, a4, a5), [ - a6, - a7 - ]); - case 7 : - return app(o(a0, a1, a2, a3, a4, a5, a6), [a7]); - default: - return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5, - a6, - a7 - ]); - } -} - -function _8(o, a0, a1, a2, a3, a4, a5, a6, a7) { - var arity = o.length; - if (arity === 8) { - return o(a0, a1, a2, a3, a4, a5, a6, a7); - } else { - return curry_8(o, a0, a1, a2, a3, a4, a5, a6, a7, arity); - } -} - -function __8(o) { - var arity = o.length; - if (arity === 8) { - return o; - } else { - return (function (a0, a1, a2, a3, a4, a5, a6, a7) { - return _8(o, a0, a1, a2, a3, a4, a5, a6, a7); - }); - } -} - -exports.app = app; -exports.curry_1 = curry_1; -exports._1 = _1; -exports.__1 = __1; -exports.curry_2 = curry_2; -exports._2 = _2; -exports.__2 = __2; -exports.curry_3 = curry_3; -exports._3 = _3; -exports.__3 = __3; -exports.curry_4 = curry_4; -exports._4 = _4; -exports.__4 = __4; -exports.curry_5 = curry_5; -exports._5 = _5; -exports.__5 = __5; -exports.curry_6 = curry_6; -exports._6 = _6; -exports.__6 = __6; -exports.curry_7 = curry_7; -exports._7 = _7; -exports.__7 = __7; -exports.curry_8 = curry_8; -exports._8 = _8; -exports.__8 = __8; -/* No side effect */ - -},{"./caml_array.js":39}],59:[function(require,module,exports){ -'use strict'; - -var Caml_option = require("./caml_option.js"); - -function get(dict, k) { - if ((k in dict)) { - return Caml_option.some(dict[k]); - } - -} - -var unsafeDeleteKey = (function (dict,key){ - delete dict[key]; - return 0 - }); - -function entries(dict) { - var keys = Object.keys(dict); - var l = keys.length; - var values = new Array(l); - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - var key = keys[i]; - values[i] = /* tuple */[ - key, - dict[key] - ]; - } - return values; -} - -function values(dict) { - var keys = Object.keys(dict); - var l = keys.length; - var values$1 = new Array(l); - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - values$1[i] = dict[keys[i]]; - } - return values$1; -} - -function fromList(entries) { - var dict = { }; - var _param = entries; - while(true) { - var param = _param; - if (param) { - var match = param[0]; - dict[match[0]] = match[1]; - _param = param[1]; - continue ; - } else { - return dict; - } - }; -} - -function fromArray(entries) { - var dict = { }; - var l = entries.length; - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - var match = entries[i]; - dict[match[0]] = match[1]; - } - return dict; -} - -function map(f, source) { - var target = { }; - var keys = Object.keys(source); - var l = keys.length; - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - var key = keys[i]; - target[key] = f(source[key]); - } - return target; -} - -exports.get = get; -exports.unsafeDeleteKey = unsafeDeleteKey; -exports.entries = entries; -exports.values = values; -exports.fromList = fromList; -exports.fromArray = fromArray; -exports.map = map; -/* No side effect */ - -},{"./caml_option.js":50}],60:[function(require,module,exports){ -'use strict'; - -var Block = require("./block.js"); -var Caml_option = require("./caml_option.js"); - -function classify(x) { - var ty = typeof x; - if (ty === "string") { - return /* JSONString */Block.__(0, [x]); - } else if (ty === "number") { - return /* JSONNumber */Block.__(1, [x]); - } else if (ty === "boolean") { - if (x === true) { - return /* JSONTrue */1; - } else { - return /* JSONFalse */0; - } - } else if (x === null) { - return /* JSONNull */2; - } else if (Array.isArray(x)) { - return /* JSONArray */Block.__(3, [x]); - } else { - return /* JSONObject */Block.__(2, [x]); - } -} - -function test(x, v) { - switch (v) { - case /* String */0 : - return typeof x === "string"; - case /* Number */1 : - return typeof x === "number"; - case /* Object */2 : - if (x !== null && typeof x === "object") { - return !Array.isArray(x); - } else { - return false; - } - case /* Array */3 : - return Array.isArray(x); - case /* Boolean */4 : - return typeof x === "boolean"; - case /* Null */5 : - return x === null; - - } -} - -function decodeString(json) { - if (typeof json === "string") { - return json; - } - -} - -function decodeNumber(json) { - if (typeof json === "number") { - return json; - } - -} - -function decodeObject(json) { - if (typeof json === "object" && !Array.isArray(json) && json !== null) { - return Caml_option.some(json); - } - -} - -function decodeArray(json) { - if (Array.isArray(json)) { - return json; - } - -} - -function decodeBoolean(json) { - if (typeof json === "boolean") { - return json; - } - -} - -function decodeNull(json) { - if (json === null) { - return null; - } - -} - -exports.classify = classify; -exports.test = test; -exports.decodeString = decodeString; -exports.decodeNumber = decodeNumber; -exports.decodeObject = decodeObject; -exports.decodeArray = decodeArray; -exports.decodeBoolean = decodeBoolean; -exports.decodeNull = decodeNull; -/* No side effect */ - -},{"./block.js":36,"./caml_option.js":50}],61:[function(require,module,exports){ -'use strict'; - -var Curry = require("./curry.js"); -var Caml_obj = require("./caml_obj.js"); -var Pervasives = require("./pervasives.js"); -var Caml_option = require("./caml_option.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function length(l) { - var _len = 0; - var _param = l; - while(true) { - var param = _param; - var len = _len; - if (param) { - _param = param[1]; - _len = len + 1 | 0; - continue ; - } else { - return len; - } - }; -} - -function cons(a, l) { - return /* :: */[ - a, - l - ]; -} - -function hd(param) { - if (param) { - return param[0]; - } else { - throw [ - Caml_builtin_exceptions.failure, - "hd" - ]; - } -} - -function tl(param) { - if (param) { - return param[1]; - } else { - throw [ - Caml_builtin_exceptions.failure, - "tl" - ]; - } -} - -function nth(l, n) { - if (n < 0) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.nth" - ]; - } - var _l = l; - var _n = n; - while(true) { - var n$1 = _n; - var l$1 = _l; - if (l$1) { - if (n$1 === 0) { - return l$1[0]; - } else { - _n = n$1 - 1 | 0; - _l = l$1[1]; - continue ; - } - } else { - throw [ - Caml_builtin_exceptions.failure, - "nth" - ]; - } - }; -} - -function nth_opt(l, n) { - if (n < 0) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.nth" - ]; - } - var _l = l; - var _n = n; - while(true) { - var n$1 = _n; - var l$1 = _l; - if (l$1) { - if (n$1 === 0) { - return Caml_option.some(l$1[0]); - } else { - _n = n$1 - 1 | 0; - _l = l$1[1]; - continue ; - } - } else { - return ; - } - }; -} - -function rev_append(_l1, _l2) { - while(true) { - var l2 = _l2; - var l1 = _l1; - if (l1) { - _l2 = /* :: */[ - l1[0], - l2 - ]; - _l1 = l1[1]; - continue ; - } else { - return l2; - } - }; -} - -function rev(l) { - return rev_append(l, /* [] */0); -} - -function init_tailrec_aux(_acc, _i, n, f) { - while(true) { - var i = _i; - var acc = _acc; - if (i >= n) { - return acc; - } else { - _i = i + 1 | 0; - _acc = /* :: */[ - Curry._1(f, i), - acc - ]; - continue ; - } - }; -} - -function init_aux(i, n, f) { - if (i >= n) { - return /* [] */0; - } else { - var r = Curry._1(f, i); - return /* :: */[ - r, - init_aux(i + 1 | 0, n, f) - ]; - } -} - -function init(len, f) { - if (len < 0) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.init" - ]; - } - if (len > 10000) { - return rev_append(init_tailrec_aux(/* [] */0, 0, len, f), /* [] */0); - } else { - return init_aux(0, len, f); - } -} - -function flatten(param) { - if (param) { - return Pervasives.$at(param[0], flatten(param[1])); - } else { - return /* [] */0; - } -} - -function map(f, param) { - if (param) { - var r = Curry._1(f, param[0]); - return /* :: */[ - r, - map(f, param[1]) - ]; - } else { - return /* [] */0; - } -} - -function mapi(i, f, param) { - if (param) { - var r = Curry._2(f, i, param[0]); - return /* :: */[ - r, - mapi(i + 1 | 0, f, param[1]) - ]; - } else { - return /* [] */0; - } -} - -function mapi$1(f, l) { - return mapi(0, f, l); -} - -function rev_map(f, l) { - var _accu = /* [] */0; - var _param = l; - while(true) { - var param = _param; - var accu = _accu; - if (param) { - _param = param[1]; - _accu = /* :: */[ - Curry._1(f, param[0]), - accu - ]; - continue ; - } else { - return accu; - } - }; -} - -function iter(f, _param) { - while(true) { - var param = _param; - if (param) { - Curry._1(f, param[0]); - _param = param[1]; - continue ; - } else { - return /* () */0; - } - }; -} - -function iteri(f, l) { - var _i = 0; - var f$1 = f; - var _param = l; - while(true) { - var param = _param; - var i = _i; - if (param) { - Curry._2(f$1, i, param[0]); - _param = param[1]; - _i = i + 1 | 0; - continue ; - } else { - return /* () */0; - } - }; -} - -function fold_left(f, _accu, _l) { - while(true) { - var l = _l; - var accu = _accu; - if (l) { - _l = l[1]; - _accu = Curry._2(f, accu, l[0]); - continue ; - } else { - return accu; - } - }; -} - -function fold_right(f, l, accu) { - if (l) { - return Curry._2(f, l[0], fold_right(f, l[1], accu)); - } else { - return accu; - } -} - -function map2(f, l1, l2) { - if (l1) { - if (l2) { - var r = Curry._2(f, l1[0], l2[0]); - return /* :: */[ - r, - map2(f, l1[1], l2[1]) - ]; - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.map2" - ]; - } - } else if (l2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.map2" - ]; - } else { - return /* [] */0; - } -} - -function rev_map2(f, l1, l2) { - var _accu = /* [] */0; - var _l1 = l1; - var _l2 = l2; - while(true) { - var l2$1 = _l2; - var l1$1 = _l1; - var accu = _accu; - if (l1$1) { - if (l2$1) { - _l2 = l2$1[1]; - _l1 = l1$1[1]; - _accu = /* :: */[ - Curry._2(f, l1$1[0], l2$1[0]), - accu - ]; - continue ; - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.rev_map2" - ]; - } - } else { - if (l2$1) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.rev_map2" - ]; - } - return accu; - } - }; -} - -function iter2(f, _l1, _l2) { - while(true) { - var l2 = _l2; - var l1 = _l1; - if (l1) { - if (l2) { - Curry._2(f, l1[0], l2[0]); - _l2 = l2[1]; - _l1 = l1[1]; - continue ; - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.iter2" - ]; - } - } else if (l2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.iter2" - ]; - } else { - return /* () */0; - } - }; -} - -function fold_left2(f, _accu, _l1, _l2) { - while(true) { - var l2 = _l2; - var l1 = _l1; - var accu = _accu; - if (l1) { - if (l2) { - _l2 = l2[1]; - _l1 = l1[1]; - _accu = Curry._3(f, accu, l1[0], l2[0]); - continue ; - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.fold_left2" - ]; - } - } else { - if (l2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.fold_left2" - ]; - } - return accu; - } - }; -} - -function fold_right2(f, l1, l2, accu) { - if (l1) { - if (l2) { - return Curry._3(f, l1[0], l2[0], fold_right2(f, l1[1], l2[1], accu)); - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.fold_right2" - ]; - } - } else { - if (l2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.fold_right2" - ]; - } - return accu; - } -} - -function for_all(p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._1(p, param[0])) { - _param = param[1]; - continue ; - } else { - return false; - } - } else { - return true; - } - }; -} - -function exists(p, _param) { - while(true) { - var param = _param; - if (param) { - if (Curry._1(p, param[0])) { - return true; - } else { - _param = param[1]; - continue ; - } - } else { - return false; - } - }; -} - -function for_all2(p, _l1, _l2) { - while(true) { - var l2 = _l2; - var l1 = _l1; - if (l1) { - if (l2) { - if (Curry._2(p, l1[0], l2[0])) { - _l2 = l2[1]; - _l1 = l1[1]; - continue ; - } else { - return false; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.for_all2" - ]; - } - } else if (l2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.for_all2" - ]; - } else { - return true; - } - }; -} - -function exists2(p, _l1, _l2) { - while(true) { - var l2 = _l2; - var l1 = _l1; - if (l1) { - if (l2) { - if (Curry._2(p, l1[0], l2[0])) { - return true; - } else { - _l2 = l2[1]; - _l1 = l1[1]; - continue ; - } - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.exists2" - ]; - } - } else if (l2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.exists2" - ]; - } else { - return false; - } - }; -} - -function mem(x, _param) { - while(true) { - var param = _param; - if (param) { - if (Caml_obj.caml_equal(param[0], x)) { - return true; - } else { - _param = param[1]; - continue ; - } - } else { - return false; - } - }; -} - -function memq(x, _param) { - while(true) { - var param = _param; - if (param) { - if (param[0] === x) { - return true; - } else { - _param = param[1]; - continue ; - } - } else { - return false; - } - }; -} - -function assoc(x, _param) { - while(true) { - var param = _param; - if (param) { - var match = param[0]; - if (Caml_obj.caml_equal(match[0], x)) { - return match[1]; - } else { - _param = param[1]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function assoc_opt(x, _param) { - while(true) { - var param = _param; - if (param) { - var match = param[0]; - if (Caml_obj.caml_equal(match[0], x)) { - return Caml_option.some(match[1]); - } else { - _param = param[1]; - continue ; - } - } else { - return ; - } - }; -} - -function assq(x, _param) { - while(true) { - var param = _param; - if (param) { - var match = param[0]; - if (match[0] === x) { - return match[1]; - } else { - _param = param[1]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function assq_opt(x, _param) { - while(true) { - var param = _param; - if (param) { - var match = param[0]; - if (match[0] === x) { - return Caml_option.some(match[1]); - } else { - _param = param[1]; - continue ; - } - } else { - return ; - } - }; -} - -function mem_assoc(x, _param) { - while(true) { - var param = _param; - if (param) { - if (Caml_obj.caml_equal(param[0][0], x)) { - return true; - } else { - _param = param[1]; - continue ; - } - } else { - return false; - } - }; -} - -function mem_assq(x, _param) { - while(true) { - var param = _param; - if (param) { - if (param[0][0] === x) { - return true; - } else { - _param = param[1]; - continue ; - } - } else { - return false; - } - }; -} - -function remove_assoc(x, param) { - if (param) { - var l = param[1]; - var pair = param[0]; - if (Caml_obj.caml_equal(pair[0], x)) { - return l; - } else { - return /* :: */[ - pair, - remove_assoc(x, l) - ]; - } - } else { - return /* [] */0; - } -} - -function remove_assq(x, param) { - if (param) { - var l = param[1]; - var pair = param[0]; - if (pair[0] === x) { - return l; - } else { - return /* :: */[ - pair, - remove_assq(x, l) - ]; - } - } else { - return /* [] */0; - } -} - -function find(p, _param) { - while(true) { - var param = _param; - if (param) { - var x = param[0]; - if (Curry._1(p, x)) { - return x; - } else { - _param = param[1]; - continue ; - } - } else { - throw Caml_builtin_exceptions.not_found; - } - }; -} - -function find_opt(p, _param) { - while(true) { - var param = _param; - if (param) { - var x = param[0]; - if (Curry._1(p, x)) { - return Caml_option.some(x); - } else { - _param = param[1]; - continue ; - } - } else { - return ; - } - }; -} - -function find_all(p) { - return (function (param) { - var _accu = /* [] */0; - var _param = param; - while(true) { - var param$1 = _param; - var accu = _accu; - if (param$1) { - var l = param$1[1]; - var x = param$1[0]; - if (Curry._1(p, x)) { - _param = l; - _accu = /* :: */[ - x, - accu - ]; - continue ; - } else { - _param = l; - continue ; - } - } else { - return rev_append(accu, /* [] */0); - } - }; - }); -} - -function partition(p, l) { - var _yes = /* [] */0; - var _no = /* [] */0; - var _param = l; - while(true) { - var param = _param; - var no = _no; - var yes = _yes; - if (param) { - var l$1 = param[1]; - var x = param[0]; - if (Curry._1(p, x)) { - _param = l$1; - _yes = /* :: */[ - x, - yes - ]; - continue ; - } else { - _param = l$1; - _no = /* :: */[ - x, - no - ]; - continue ; - } - } else { - return /* tuple */[ - rev_append(yes, /* [] */0), - rev_append(no, /* [] */0) - ]; - } - }; -} - -function split(param) { - if (param) { - var match = param[0]; - var match$1 = split(param[1]); - return /* tuple */[ - /* :: */[ - match[0], - match$1[0] - ], - /* :: */[ - match[1], - match$1[1] - ] - ]; - } else { - return /* tuple */[ - /* [] */0, - /* [] */0 - ]; - } -} - -function combine(l1, l2) { - if (l1) { - if (l2) { - return /* :: */[ - /* tuple */[ - l1[0], - l2[0] - ], - combine(l1[1], l2[1]) - ]; - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.combine" - ]; - } - } else if (l2) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "List.combine" - ]; - } else { - return /* [] */0; - } -} - -function merge(cmp, l1, l2) { - if (l1) { - if (l2) { - var h2 = l2[0]; - var h1 = l1[0]; - if (Curry._2(cmp, h1, h2) <= 0) { - return /* :: */[ - h1, - merge(cmp, l1[1], l2) - ]; - } else { - return /* :: */[ - h2, - merge(cmp, l1, l2[1]) - ]; - } - } else { - return l1; - } - } else { - return l2; - } -} - -function chop(_k, _l) { - while(true) { - var l = _l; - var k = _k; - if (k === 0) { - return l; - } else if (l) { - _l = l[1]; - _k = k - 1 | 0; - continue ; - } else { - throw [ - Caml_builtin_exceptions.assert_failure, - /* tuple */[ - "list.ml", - 262, - 11 - ] - ]; - } - }; -} - -function stable_sort(cmp, l) { - var sort = function (n, l) { - if (n !== 2) { - if (n === 3 && l) { - var match = l[1]; - if (match) { - var match$1 = match[1]; - if (match$1) { - var x3 = match$1[0]; - var x2 = match[0]; - var x1 = l[0]; - if (Curry._2(cmp, x1, x2) <= 0) { - if (Curry._2(cmp, x2, x3) <= 0) { - return /* :: */[ - x1, - /* :: */[ - x2, - /* :: */[ - x3, - /* [] */0 - ] - ] - ]; - } else if (Curry._2(cmp, x1, x3) <= 0) { - return /* :: */[ - x1, - /* :: */[ - x3, - /* :: */[ - x2, - /* [] */0 - ] - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x1, - /* :: */[ - x2, - /* [] */0 - ] - ] - ]; - } - } else if (Curry._2(cmp, x1, x3) <= 0) { - return /* :: */[ - x2, - /* :: */[ - x1, - /* :: */[ - x3, - /* [] */0 - ] - ] - ]; - } else if (Curry._2(cmp, x2, x3) <= 0) { - return /* :: */[ - x2, - /* :: */[ - x3, - /* :: */[ - x1, - /* [] */0 - ] - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x2, - /* :: */[ - x1, - /* [] */0 - ] - ] - ]; - } - } - - } - - } - - } else if (l) { - var match$2 = l[1]; - if (match$2) { - var x2$1 = match$2[0]; - var x1$1 = l[0]; - if (Curry._2(cmp, x1$1, x2$1) <= 0) { - return /* :: */[ - x1$1, - /* :: */[ - x2$1, - /* [] */0 - ] - ]; - } else { - return /* :: */[ - x2$1, - /* :: */[ - x1$1, - /* [] */0 - ] - ]; - } - } - - } - var n1 = (n >> 1); - var n2 = n - n1 | 0; - var l2 = chop(n1, l); - var s1 = rev_sort(n1, l); - var s2 = rev_sort(n2, l2); - var _l1 = s1; - var _l2 = s2; - var _accu = /* [] */0; - while(true) { - var accu = _accu; - var l2$1 = _l2; - var l1 = _l1; - if (l1) { - if (l2$1) { - var h2 = l2$1[0]; - var h1 = l1[0]; - if (Curry._2(cmp, h1, h2) > 0) { - _accu = /* :: */[ - h1, - accu - ]; - _l1 = l1[1]; - continue ; - } else { - _accu = /* :: */[ - h2, - accu - ]; - _l2 = l2$1[1]; - continue ; - } - } else { - return rev_append(l1, accu); - } - } else { - return rev_append(l2$1, accu); - } - }; - }; - var rev_sort = function (n, l) { - if (n !== 2) { - if (n === 3 && l) { - var match = l[1]; - if (match) { - var match$1 = match[1]; - if (match$1) { - var x3 = match$1[0]; - var x2 = match[0]; - var x1 = l[0]; - if (Curry._2(cmp, x1, x2) > 0) { - if (Curry._2(cmp, x2, x3) > 0) { - return /* :: */[ - x1, - /* :: */[ - x2, - /* :: */[ - x3, - /* [] */0 - ] - ] - ]; - } else if (Curry._2(cmp, x1, x3) > 0) { - return /* :: */[ - x1, - /* :: */[ - x3, - /* :: */[ - x2, - /* [] */0 - ] - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x1, - /* :: */[ - x2, - /* [] */0 - ] - ] - ]; - } - } else if (Curry._2(cmp, x1, x3) > 0) { - return /* :: */[ - x2, - /* :: */[ - x1, - /* :: */[ - x3, - /* [] */0 - ] - ] - ]; - } else if (Curry._2(cmp, x2, x3) > 0) { - return /* :: */[ - x2, - /* :: */[ - x3, - /* :: */[ - x1, - /* [] */0 - ] - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x2, - /* :: */[ - x1, - /* [] */0 - ] - ] - ]; - } - } - - } - - } - - } else if (l) { - var match$2 = l[1]; - if (match$2) { - var x2$1 = match$2[0]; - var x1$1 = l[0]; - if (Curry._2(cmp, x1$1, x2$1) > 0) { - return /* :: */[ - x1$1, - /* :: */[ - x2$1, - /* [] */0 - ] - ]; - } else { - return /* :: */[ - x2$1, - /* :: */[ - x1$1, - /* [] */0 - ] - ]; - } - } - - } - var n1 = (n >> 1); - var n2 = n - n1 | 0; - var l2 = chop(n1, l); - var s1 = sort(n1, l); - var s2 = sort(n2, l2); - var _l1 = s1; - var _l2 = s2; - var _accu = /* [] */0; - while(true) { - var accu = _accu; - var l2$1 = _l2; - var l1 = _l1; - if (l1) { - if (l2$1) { - var h2 = l2$1[0]; - var h1 = l1[0]; - if (Curry._2(cmp, h1, h2) <= 0) { - _accu = /* :: */[ - h1, - accu - ]; - _l1 = l1[1]; - continue ; - } else { - _accu = /* :: */[ - h2, - accu - ]; - _l2 = l2$1[1]; - continue ; - } - } else { - return rev_append(l1, accu); - } - } else { - return rev_append(l2$1, accu); - } - }; - }; - var len = length(l); - if (len < 2) { - return l; - } else { - return sort(len, l); - } -} - -function sort_uniq(cmp, l) { - var sort = function (n, l) { - if (n !== 2) { - if (n === 3 && l) { - var match = l[1]; - if (match) { - var match$1 = match[1]; - if (match$1) { - var x3 = match$1[0]; - var x2 = match[0]; - var x1 = l[0]; - var c = Curry._2(cmp, x1, x2); - if (c === 0) { - var c$1 = Curry._2(cmp, x2, x3); - if (c$1 === 0) { - return /* :: */[ - x2, - /* [] */0 - ]; - } else if (c$1 < 0) { - return /* :: */[ - x2, - /* :: */[ - x3, - /* [] */0 - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x2, - /* [] */0 - ] - ]; - } - } else if (c < 0) { - var c$2 = Curry._2(cmp, x2, x3); - if (c$2 === 0) { - return /* :: */[ - x1, - /* :: */[ - x2, - /* [] */0 - ] - ]; - } else if (c$2 < 0) { - return /* :: */[ - x1, - /* :: */[ - x2, - /* :: */[ - x3, - /* [] */0 - ] - ] - ]; - } else { - var c$3 = Curry._2(cmp, x1, x3); - if (c$3 === 0) { - return /* :: */[ - x1, - /* :: */[ - x2, - /* [] */0 - ] - ]; - } else if (c$3 < 0) { - return /* :: */[ - x1, - /* :: */[ - x3, - /* :: */[ - x2, - /* [] */0 - ] - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x1, - /* :: */[ - x2, - /* [] */0 - ] - ] - ]; - } - } - } else { - var c$4 = Curry._2(cmp, x1, x3); - if (c$4 === 0) { - return /* :: */[ - x2, - /* :: */[ - x1, - /* [] */0 - ] - ]; - } else if (c$4 < 0) { - return /* :: */[ - x2, - /* :: */[ - x1, - /* :: */[ - x3, - /* [] */0 - ] - ] - ]; - } else { - var c$5 = Curry._2(cmp, x2, x3); - if (c$5 === 0) { - return /* :: */[ - x2, - /* :: */[ - x1, - /* [] */0 - ] - ]; - } else if (c$5 < 0) { - return /* :: */[ - x2, - /* :: */[ - x3, - /* :: */[ - x1, - /* [] */0 - ] - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x2, - /* :: */[ - x1, - /* [] */0 - ] - ] - ]; - } - } - } - } - - } - - } - - } else if (l) { - var match$2 = l[1]; - if (match$2) { - var x2$1 = match$2[0]; - var x1$1 = l[0]; - var c$6 = Curry._2(cmp, x1$1, x2$1); - if (c$6 === 0) { - return /* :: */[ - x1$1, - /* [] */0 - ]; - } else if (c$6 < 0) { - return /* :: */[ - x1$1, - /* :: */[ - x2$1, - /* [] */0 - ] - ]; - } else { - return /* :: */[ - x2$1, - /* :: */[ - x1$1, - /* [] */0 - ] - ]; - } - } - - } - var n1 = (n >> 1); - var n2 = n - n1 | 0; - var l2 = chop(n1, l); - var s1 = rev_sort(n1, l); - var s2 = rev_sort(n2, l2); - var _l1 = s1; - var _l2 = s2; - var _accu = /* [] */0; - while(true) { - var accu = _accu; - var l2$1 = _l2; - var l1 = _l1; - if (l1) { - if (l2$1) { - var t2 = l2$1[1]; - var h2 = l2$1[0]; - var t1 = l1[1]; - var h1 = l1[0]; - var c$7 = Curry._2(cmp, h1, h2); - if (c$7 === 0) { - _accu = /* :: */[ - h1, - accu - ]; - _l2 = t2; - _l1 = t1; - continue ; - } else if (c$7 > 0) { - _accu = /* :: */[ - h1, - accu - ]; - _l1 = t1; - continue ; - } else { - _accu = /* :: */[ - h2, - accu - ]; - _l2 = t2; - continue ; - } - } else { - return rev_append(l1, accu); - } - } else { - return rev_append(l2$1, accu); - } - }; - }; - var rev_sort = function (n, l) { - if (n !== 2) { - if (n === 3 && l) { - var match = l[1]; - if (match) { - var match$1 = match[1]; - if (match$1) { - var x3 = match$1[0]; - var x2 = match[0]; - var x1 = l[0]; - var c = Curry._2(cmp, x1, x2); - if (c === 0) { - var c$1 = Curry._2(cmp, x2, x3); - if (c$1 === 0) { - return /* :: */[ - x2, - /* [] */0 - ]; - } else if (c$1 > 0) { - return /* :: */[ - x2, - /* :: */[ - x3, - /* [] */0 - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x2, - /* [] */0 - ] - ]; - } - } else if (c > 0) { - var c$2 = Curry._2(cmp, x2, x3); - if (c$2 === 0) { - return /* :: */[ - x1, - /* :: */[ - x2, - /* [] */0 - ] - ]; - } else if (c$2 > 0) { - return /* :: */[ - x1, - /* :: */[ - x2, - /* :: */[ - x3, - /* [] */0 - ] - ] - ]; - } else { - var c$3 = Curry._2(cmp, x1, x3); - if (c$3 === 0) { - return /* :: */[ - x1, - /* :: */[ - x2, - /* [] */0 - ] - ]; - } else if (c$3 > 0) { - return /* :: */[ - x1, - /* :: */[ - x3, - /* :: */[ - x2, - /* [] */0 - ] - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x1, - /* :: */[ - x2, - /* [] */0 - ] - ] - ]; - } - } - } else { - var c$4 = Curry._2(cmp, x1, x3); - if (c$4 === 0) { - return /* :: */[ - x2, - /* :: */[ - x1, - /* [] */0 - ] - ]; - } else if (c$4 > 0) { - return /* :: */[ - x2, - /* :: */[ - x1, - /* :: */[ - x3, - /* [] */0 - ] - ] - ]; - } else { - var c$5 = Curry._2(cmp, x2, x3); - if (c$5 === 0) { - return /* :: */[ - x2, - /* :: */[ - x1, - /* [] */0 - ] - ]; - } else if (c$5 > 0) { - return /* :: */[ - x2, - /* :: */[ - x3, - /* :: */[ - x1, - /* [] */0 - ] - ] - ]; - } else { - return /* :: */[ - x3, - /* :: */[ - x2, - /* :: */[ - x1, - /* [] */0 - ] - ] - ]; - } - } - } - } - - } - - } - - } else if (l) { - var match$2 = l[1]; - if (match$2) { - var x2$1 = match$2[0]; - var x1$1 = l[0]; - var c$6 = Curry._2(cmp, x1$1, x2$1); - if (c$6 === 0) { - return /* :: */[ - x1$1, - /* [] */0 - ]; - } else if (c$6 > 0) { - return /* :: */[ - x1$1, - /* :: */[ - x2$1, - /* [] */0 - ] - ]; - } else { - return /* :: */[ - x2$1, - /* :: */[ - x1$1, - /* [] */0 - ] - ]; - } - } - - } - var n1 = (n >> 1); - var n2 = n - n1 | 0; - var l2 = chop(n1, l); - var s1 = sort(n1, l); - var s2 = sort(n2, l2); - var _l1 = s1; - var _l2 = s2; - var _accu = /* [] */0; - while(true) { - var accu = _accu; - var l2$1 = _l2; - var l1 = _l1; - if (l1) { - if (l2$1) { - var t2 = l2$1[1]; - var h2 = l2$1[0]; - var t1 = l1[1]; - var h1 = l1[0]; - var c$7 = Curry._2(cmp, h1, h2); - if (c$7 === 0) { - _accu = /* :: */[ - h1, - accu - ]; - _l2 = t2; - _l1 = t1; - continue ; - } else if (c$7 < 0) { - _accu = /* :: */[ - h1, - accu - ]; - _l1 = t1; - continue ; - } else { - _accu = /* :: */[ - h2, - accu - ]; - _l2 = t2; - continue ; - } - } else { - return rev_append(l1, accu); - } - } else { - return rev_append(l2$1, accu); - } - }; - }; - var len = length(l); - if (len < 2) { - return l; - } else { - return sort(len, l); - } -} - -function compare_lengths(_l1, _l2) { - while(true) { - var l2 = _l2; - var l1 = _l1; - if (l1) { - if (l2) { - _l2 = l2[1]; - _l1 = l1[1]; - continue ; - } else { - return 1; - } - } else if (l2) { - return -1; - } else { - return 0; - } - }; -} - -function compare_length_with(_l, _n) { - while(true) { - var n = _n; - var l = _l; - if (l) { - if (n <= 0) { - return 1; - } else { - _n = n - 1 | 0; - _l = l[1]; - continue ; - } - } else if (n === 0) { - return 0; - } else if (n > 0) { - return -1; - } else { - return 1; - } - }; -} - -var append = Pervasives.$at; - -var concat = flatten; - -var filter = find_all; - -var sort = stable_sort; - -var fast_sort = stable_sort; - -exports.length = length; -exports.compare_lengths = compare_lengths; -exports.compare_length_with = compare_length_with; -exports.cons = cons; -exports.hd = hd; -exports.tl = tl; -exports.nth = nth; -exports.nth_opt = nth_opt; -exports.rev = rev; -exports.init = init; -exports.append = append; -exports.rev_append = rev_append; -exports.concat = concat; -exports.flatten = flatten; -exports.iter = iter; -exports.iteri = iteri; -exports.map = map; -exports.mapi = mapi$1; -exports.rev_map = rev_map; -exports.fold_left = fold_left; -exports.fold_right = fold_right; -exports.iter2 = iter2; -exports.map2 = map2; -exports.rev_map2 = rev_map2; -exports.fold_left2 = fold_left2; -exports.fold_right2 = fold_right2; -exports.for_all = for_all; -exports.exists = exists; -exports.for_all2 = for_all2; -exports.exists2 = exists2; -exports.mem = mem; -exports.memq = memq; -exports.find = find; -exports.find_opt = find_opt; -exports.filter = filter; -exports.find_all = find_all; -exports.partition = partition; -exports.assoc = assoc; -exports.assoc_opt = assoc_opt; -exports.assq = assq; -exports.assq_opt = assq_opt; -exports.mem_assoc = mem_assoc; -exports.mem_assq = mem_assq; -exports.remove_assoc = remove_assoc; -exports.remove_assq = remove_assq; -exports.split = split; -exports.combine = combine; -exports.sort = sort; -exports.stable_sort = stable_sort; -exports.fast_sort = fast_sort; -exports.sort_uniq = sort_uniq; -exports.merge = merge; -/* No side effect */ - -},{"./caml_builtin_exceptions.js":40,"./caml_obj.js":49,"./caml_option.js":50,"./curry.js":58,"./pervasives.js":62}],62:[function(require,module,exports){ -'use strict'; - -var Curry = require("./curry.js"); -var Caml_io = require("./caml_io.js"); -var Caml_sys = require("./caml_sys.js"); -var Caml_bytes = require("./caml_bytes.js"); -var Caml_format = require("./caml_format.js"); -var Caml_string = require("./caml_string.js"); -var Caml_exceptions = require("./caml_exceptions.js"); -var Caml_js_exceptions = require("./caml_js_exceptions.js"); -var Caml_external_polyfill = require("./caml_external_polyfill.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); -var CamlinternalFormatBasics = require("./camlinternalFormatBasics.js"); - -function failwith(s) { - throw [ - Caml_builtin_exceptions.failure, - s - ]; -} - -function invalid_arg(s) { - throw [ - Caml_builtin_exceptions.invalid_argument, - s - ]; -} - -var Exit = Caml_exceptions.create("Pervasives.Exit"); - -function abs(x) { - if (x >= 0) { - return x; - } else { - return -x | 0; - } -} - -function lnot(x) { - return x ^ -1; -} - -var min_int = -2147483648; - -function classify_float(x) { - if (isFinite(x)) { - if (Math.abs(x) >= 2.22507385850720138e-308) { - return /* FP_normal */0; - } else if (x !== 0) { - return /* FP_subnormal */1; - } else { - return /* FP_zero */2; - } - } else if (isNaN(x)) { - return /* FP_nan */4; - } else { - return /* FP_infinite */3; - } -} - -function char_of_int(n) { - if (n < 0 || n > 255) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "char_of_int" - ]; - } - return n; -} - -function string_of_bool(b) { - if (b) { - return "true"; - } else { - return "false"; - } -} - -function bool_of_string(param) { - switch (param) { - case "false" : - return false; - case "true" : - return true; - default: - throw [ - Caml_builtin_exceptions.invalid_argument, - "bool_of_string" - ]; - } -} - -function bool_of_string_opt(param) { - switch (param) { - case "false" : - return false; - case "true" : - return true; - default: - return ; - } -} - -function int_of_string_opt(s) { - try { - return Caml_format.caml_int_of_string(s); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === Caml_builtin_exceptions.failure) { - return ; - } else { - throw exn; - } - } -} - -function valid_float_lexem(s) { - var l = s.length; - var _i = 0; - while(true) { - var i = _i; - if (i >= l) { - return s + "."; - } else { - var match = Caml_string.get(s, i); - if (match >= 48) { - if (match >= 58) { - return s; - } else { - _i = i + 1 | 0; - continue ; - } - } else if (match !== 45) { - return s; - } else { - _i = i + 1 | 0; - continue ; - } - } - }; -} - -function string_of_float(f) { - return valid_float_lexem(Caml_format.caml_format_float("%.12g", f)); -} - -function float_of_string_opt(s) { - try { - return Caml_format.caml_float_of_string(s); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] === Caml_builtin_exceptions.failure) { - return ; - } else { - throw exn; - } - } -} - -function $at(l1, l2) { - if (l1) { - return /* :: */[ - l1[0], - $at(l1[1], l2) - ]; - } else { - return l2; - } -} - -var stdin = Caml_io.stdin; - -var stdout = Caml_io.stdout; - -var stderr = Caml_io.stderr; - -function open_out_gen(mode, perm, name) { - var c = Caml_external_polyfill.resolve("caml_ml_open_descriptor_out")(Caml_external_polyfill.resolve("caml_sys_open")(name, mode, perm)); - Caml_external_polyfill.resolve("caml_ml_set_channel_name")(c, name); - return c; -} - -function open_out(name) { - return open_out_gen(/* :: */[ - /* Open_wronly */1, - /* :: */[ - /* Open_creat */3, - /* :: */[ - /* Open_trunc */4, - /* :: */[ - /* Open_text */7, - /* [] */0 - ] - ] - ] - ], 438, name); -} - -function open_out_bin(name) { - return open_out_gen(/* :: */[ - /* Open_wronly */1, - /* :: */[ - /* Open_creat */3, - /* :: */[ - /* Open_trunc */4, - /* :: */[ - /* Open_binary */6, - /* [] */0 - ] - ] - ] - ], 438, name); -} - -function flush_all(param) { - var _param = Caml_io.caml_ml_out_channels_list(/* () */0); - while(true) { - var param$1 = _param; - if (param$1) { - try { - Caml_io.caml_ml_flush(param$1[0]); - } - catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn[0] !== Caml_builtin_exceptions.sys_error) { - throw exn; - } - - } - _param = param$1[1]; - continue ; - } else { - return /* () */0; - } - }; -} - -function output_bytes(oc, s) { - return Caml_external_polyfill.resolve("caml_ml_output_bytes")(oc, s, 0, s.length); -} - -function output_string(oc, s) { - return Caml_io.caml_ml_output(oc, s, 0, s.length); -} - -function output(oc, s, ofs, len) { - if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "output" - ]; - } - return Caml_external_polyfill.resolve("caml_ml_output_bytes")(oc, s, ofs, len); -} - -function output_substring(oc, s, ofs, len) { - if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "output_substring" - ]; - } - return Caml_io.caml_ml_output(oc, s, ofs, len); -} - -function output_value(chan, v) { - return Caml_external_polyfill.resolve("caml_output_value")(chan, v, /* [] */0); -} - -function close_out(oc) { - Caml_io.caml_ml_flush(oc); - return Caml_external_polyfill.resolve("caml_ml_close_channel")(oc); -} - -function close_out_noerr(oc) { - try { - Caml_io.caml_ml_flush(oc); - } - catch (exn){ - - } - try { - return Caml_external_polyfill.resolve("caml_ml_close_channel")(oc); - } - catch (exn$1){ - return /* () */0; - } -} - -function open_in_gen(mode, perm, name) { - var c = Caml_external_polyfill.resolve("caml_ml_open_descriptor_in")(Caml_external_polyfill.resolve("caml_sys_open")(name, mode, perm)); - Caml_external_polyfill.resolve("caml_ml_set_channel_name")(c, name); - return c; -} - -function open_in(name) { - return open_in_gen(/* :: */[ - /* Open_rdonly */0, - /* :: */[ - /* Open_text */7, - /* [] */0 - ] - ], 0, name); -} - -function open_in_bin(name) { - return open_in_gen(/* :: */[ - /* Open_rdonly */0, - /* :: */[ - /* Open_binary */6, - /* [] */0 - ] - ], 0, name); -} - -function input(ic, s, ofs, len) { - if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "input" - ]; - } - return Caml_external_polyfill.resolve("caml_ml_input")(ic, s, ofs, len); -} - -function unsafe_really_input(ic, s, _ofs, _len) { - while(true) { - var len = _len; - var ofs = _ofs; - if (len <= 0) { - return /* () */0; - } else { - var r = Caml_external_polyfill.resolve("caml_ml_input")(ic, s, ofs, len); - if (r === 0) { - throw Caml_builtin_exceptions.end_of_file; - } - _len = len - r | 0; - _ofs = ofs + r | 0; - continue ; - } - }; -} - -function really_input(ic, s, ofs, len) { - if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "really_input" - ]; - } - return unsafe_really_input(ic, s, ofs, len); -} - -function really_input_string(ic, len) { - var s = Caml_bytes.caml_create_bytes(len); - really_input(ic, s, 0, len); - return Caml_bytes.bytes_to_string(s); -} - -function input_line(chan) { - var build_result = function (buf, _pos, _param) { - while(true) { - var param = _param; - var pos = _pos; - if (param) { - var hd = param[0]; - var len = hd.length; - Caml_bytes.caml_blit_bytes(hd, 0, buf, pos - len | 0, len); - _param = param[1]; - _pos = pos - len | 0; - continue ; - } else { - return buf; - } - }; - }; - var scan = function (_accu, _len) { - while(true) { - var len = _len; - var accu = _accu; - var n = Caml_external_polyfill.resolve("caml_ml_input_scan_line")(chan); - if (n === 0) { - if (accu) { - return build_result(Caml_bytes.caml_create_bytes(len), len, accu); - } else { - throw Caml_builtin_exceptions.end_of_file; - } - } else if (n > 0) { - var res = Caml_bytes.caml_create_bytes(n - 1 | 0); - Caml_external_polyfill.resolve("caml_ml_input")(chan, res, 0, n - 1 | 0); - Caml_external_polyfill.resolve("caml_ml_input_char")(chan); - if (accu) { - var len$1 = (len + n | 0) - 1 | 0; - return build_result(Caml_bytes.caml_create_bytes(len$1), len$1, /* :: */[ - res, - accu - ]); - } else { - return res; - } - } else { - var beg = Caml_bytes.caml_create_bytes(-n | 0); - Caml_external_polyfill.resolve("caml_ml_input")(chan, beg, 0, -n | 0); - _len = len - n | 0; - _accu = /* :: */[ - beg, - accu - ]; - continue ; - } - }; - }; - return Caml_bytes.bytes_to_string(scan(/* [] */0, 0)); -} - -function close_in_noerr(ic) { - try { - return Caml_external_polyfill.resolve("caml_ml_close_channel")(ic); - } - catch (exn){ - return /* () */0; - } -} - -function print_char(c) { - return Caml_io.caml_ml_output_char(stdout, c); -} - -function print_string(s) { - return output_string(stdout, s); -} - -function print_bytes(s) { - return output_bytes(stdout, s); -} - -function print_int(i) { - return output_string(stdout, String(i)); -} - -function print_float(f) { - return output_string(stdout, valid_float_lexem(Caml_format.caml_format_float("%.12g", f))); -} - -function print_newline(param) { - Caml_io.caml_ml_output_char(stdout, /* "\n" */10); - return Caml_io.caml_ml_flush(stdout); -} - -function prerr_char(c) { - return Caml_io.caml_ml_output_char(stderr, c); -} - -function prerr_string(s) { - return output_string(stderr, s); -} - -function prerr_bytes(s) { - return output_bytes(stderr, s); -} - -function prerr_int(i) { - return output_string(stderr, String(i)); -} - -function prerr_float(f) { - return output_string(stderr, valid_float_lexem(Caml_format.caml_format_float("%.12g", f))); -} - -function prerr_newline(param) { - Caml_io.caml_ml_output_char(stderr, /* "\n" */10); - return Caml_io.caml_ml_flush(stderr); -} - -function read_line(param) { - Caml_io.caml_ml_flush(stdout); - return input_line(stdin); -} - -function read_int(param) { - return Caml_format.caml_int_of_string((Caml_io.caml_ml_flush(stdout), input_line(stdin))); -} - -function read_int_opt(param) { - return int_of_string_opt((Caml_io.caml_ml_flush(stdout), input_line(stdin))); -} - -function read_float(param) { - return Caml_format.caml_float_of_string((Caml_io.caml_ml_flush(stdout), input_line(stdin))); -} - -function read_float_opt(param) { - return float_of_string_opt((Caml_io.caml_ml_flush(stdout), input_line(stdin))); -} - -function string_of_format(param) { - return param[1]; -} - -function $caret$caret(param, param$1) { - return /* Format */[ - CamlinternalFormatBasics.concat_fmt(param[0], param$1[0]), - param[1] + ("%," + param$1[1]) - ]; -} - -var exit_function = { - contents: flush_all -}; - -function at_exit(f) { - var g = exit_function.contents; - exit_function.contents = (function (param) { - Curry._1(f, /* () */0); - return Curry._1(g, /* () */0); - }); - return /* () */0; -} - -function do_at_exit(param) { - return Curry._1(exit_function.contents, /* () */0); -} - -function exit(retcode) { - do_at_exit(/* () */0); - return Caml_sys.caml_sys_exit(retcode); -} - -var max_int = 2147483647; - -var infinity = Infinity; - -var neg_infinity = -Infinity; - -var max_float = 1.79769313486231571e+308; - -var min_float = 2.22507385850720138e-308; - -var epsilon_float = 2.22044604925031308e-16; - -var flush = Caml_io.caml_ml_flush; - -var output_char = Caml_io.caml_ml_output_char; - -var output_byte = Caml_io.caml_ml_output_char; - -function output_binary_int(prim, prim$1) { - return Caml_external_polyfill.resolve("caml_ml_output_int")(prim, prim$1); -} - -function seek_out(prim, prim$1) { - return Caml_external_polyfill.resolve("caml_ml_seek_out")(prim, prim$1); -} - -function pos_out(prim) { - return Caml_external_polyfill.resolve("caml_ml_pos_out")(prim); -} - -function out_channel_length(prim) { - return Caml_external_polyfill.resolve("caml_ml_channel_size")(prim); -} - -function set_binary_mode_out(prim, prim$1) { - return Caml_external_polyfill.resolve("caml_ml_set_binary_mode")(prim, prim$1); -} - -function input_char(prim) { - return Caml_external_polyfill.resolve("caml_ml_input_char")(prim); -} - -function input_byte(prim) { - return Caml_external_polyfill.resolve("caml_ml_input_char")(prim); -} - -function input_binary_int(prim) { - return Caml_external_polyfill.resolve("caml_ml_input_int")(prim); -} - -function input_value(prim) { - return Caml_external_polyfill.resolve("caml_input_value")(prim); -} - -function seek_in(prim, prim$1) { - return Caml_external_polyfill.resolve("caml_ml_seek_in")(prim, prim$1); -} - -function pos_in(prim) { - return Caml_external_polyfill.resolve("caml_ml_pos_in")(prim); -} - -function in_channel_length(prim) { - return Caml_external_polyfill.resolve("caml_ml_channel_size")(prim); -} - -function close_in(prim) { - return Caml_external_polyfill.resolve("caml_ml_close_channel")(prim); -} - -function set_binary_mode_in(prim, prim$1) { - return Caml_external_polyfill.resolve("caml_ml_set_binary_mode")(prim, prim$1); -} - -function LargeFile_seek_out(prim, prim$1) { - return Caml_external_polyfill.resolve("caml_ml_seek_out_64")(prim, prim$1); -} - -function LargeFile_pos_out(prim) { - return Caml_external_polyfill.resolve("caml_ml_pos_out_64")(prim); -} - -function LargeFile_out_channel_length(prim) { - return Caml_external_polyfill.resolve("caml_ml_channel_size_64")(prim); -} - -function LargeFile_seek_in(prim, prim$1) { - return Caml_external_polyfill.resolve("caml_ml_seek_in_64")(prim, prim$1); -} - -function LargeFile_pos_in(prim) { - return Caml_external_polyfill.resolve("caml_ml_pos_in_64")(prim); -} - -function LargeFile_in_channel_length(prim) { - return Caml_external_polyfill.resolve("caml_ml_channel_size_64")(prim); -} - -var LargeFile = { - seek_out: LargeFile_seek_out, - pos_out: LargeFile_pos_out, - out_channel_length: LargeFile_out_channel_length, - seek_in: LargeFile_seek_in, - pos_in: LargeFile_pos_in, - in_channel_length: LargeFile_in_channel_length -}; - -exports.invalid_arg = invalid_arg; -exports.failwith = failwith; -exports.Exit = Exit; -exports.abs = abs; -exports.max_int = max_int; -exports.min_int = min_int; -exports.lnot = lnot; -exports.infinity = infinity; -exports.neg_infinity = neg_infinity; -exports.max_float = max_float; -exports.min_float = min_float; -exports.epsilon_float = epsilon_float; -exports.classify_float = classify_float; -exports.char_of_int = char_of_int; -exports.string_of_bool = string_of_bool; -exports.bool_of_string = bool_of_string; -exports.bool_of_string_opt = bool_of_string_opt; -exports.int_of_string_opt = int_of_string_opt; -exports.string_of_float = string_of_float; -exports.float_of_string_opt = float_of_string_opt; -exports.$at = $at; -exports.stdin = stdin; -exports.stdout = stdout; -exports.stderr = stderr; -exports.print_char = print_char; -exports.print_string = print_string; -exports.print_bytes = print_bytes; -exports.print_int = print_int; -exports.print_float = print_float; -exports.print_newline = print_newline; -exports.prerr_char = prerr_char; -exports.prerr_string = prerr_string; -exports.prerr_bytes = prerr_bytes; -exports.prerr_int = prerr_int; -exports.prerr_float = prerr_float; -exports.prerr_newline = prerr_newline; -exports.read_line = read_line; -exports.read_int = read_int; -exports.read_int_opt = read_int_opt; -exports.read_float = read_float; -exports.read_float_opt = read_float_opt; -exports.open_out = open_out; -exports.open_out_bin = open_out_bin; -exports.open_out_gen = open_out_gen; -exports.flush = flush; -exports.flush_all = flush_all; -exports.output_char = output_char; -exports.output_string = output_string; -exports.output_bytes = output_bytes; -exports.output = output; -exports.output_substring = output_substring; -exports.output_byte = output_byte; -exports.output_binary_int = output_binary_int; -exports.output_value = output_value; -exports.seek_out = seek_out; -exports.pos_out = pos_out; -exports.out_channel_length = out_channel_length; -exports.close_out = close_out; -exports.close_out_noerr = close_out_noerr; -exports.set_binary_mode_out = set_binary_mode_out; -exports.open_in = open_in; -exports.open_in_bin = open_in_bin; -exports.open_in_gen = open_in_gen; -exports.input_char = input_char; -exports.input_line = input_line; -exports.input = input; -exports.really_input = really_input; -exports.really_input_string = really_input_string; -exports.input_byte = input_byte; -exports.input_binary_int = input_binary_int; -exports.input_value = input_value; -exports.seek_in = seek_in; -exports.pos_in = pos_in; -exports.in_channel_length = in_channel_length; -exports.close_in = close_in; -exports.close_in_noerr = close_in_noerr; -exports.set_binary_mode_in = set_binary_mode_in; -exports.LargeFile = LargeFile; -exports.string_of_format = string_of_format; -exports.$caret$caret = $caret$caret; -exports.exit = exit; -exports.at_exit = at_exit; -exports.valid_float_lexem = valid_float_lexem; -exports.unsafe_really_input = unsafe_really_input; -exports.do_at_exit = do_at_exit; -/* No side effect */ - -},{"./caml_builtin_exceptions.js":40,"./caml_bytes.js":41,"./caml_exceptions.js":42,"./caml_external_polyfill.js":43,"./caml_format.js":44,"./caml_io.js":47,"./caml_js_exceptions.js":48,"./caml_string.js":52,"./caml_sys.js":53,"./camlinternalFormatBasics.js":56,"./curry.js":58}],63:[function(require,module,exports){ -'use strict'; - -var Curry = require("./curry.js"); -var $$Buffer = require("./buffer.js"); -var Pervasives = require("./pervasives.js"); -var CamlinternalFormat = require("./camlinternalFormat.js"); - -function kfprintf(k, o, param) { - return CamlinternalFormat.make_printf((function (o, acc) { - CamlinternalFormat.output_acc(o, acc); - return Curry._1(k, o); - }), o, /* End_of_acc */0, param[0]); -} - -function kbprintf(k, b, param) { - return CamlinternalFormat.make_printf((function (b, acc) { - CamlinternalFormat.bufput_acc(b, acc); - return Curry._1(k, b); - }), b, /* End_of_acc */0, param[0]); -} - -function ikfprintf(k, oc, param) { - return CamlinternalFormat.make_iprintf(k, oc, param[0]); -} - -function fprintf(oc, fmt) { - return kfprintf((function (prim) { - return /* () */0; - }), oc, fmt); -} - -function bprintf(b, fmt) { - return kbprintf((function (prim) { - return /* () */0; - }), b, fmt); -} - -function ifprintf(oc, fmt) { - return ikfprintf((function (prim) { - return /* () */0; - }), oc, fmt); -} - -function printf(fmt) { - return fprintf(Pervasives.stdout, fmt); -} - -function eprintf(fmt) { - return fprintf(Pervasives.stderr, fmt); -} - -function ksprintf(k, param) { - var k$prime = function (param, acc) { - var buf = $$Buffer.create(64); - CamlinternalFormat.strput_acc(buf, acc); - return Curry._1(k, $$Buffer.contents(buf)); - }; - return CamlinternalFormat.make_printf(k$prime, /* () */0, /* End_of_acc */0, param[0]); -} - -function sprintf(fmt) { - return ksprintf((function (s) { - return s; - }), fmt); -} - -var kprintf = ksprintf; - -exports.fprintf = fprintf; -exports.printf = printf; -exports.eprintf = eprintf; -exports.sprintf = sprintf; -exports.bprintf = bprintf; -exports.ifprintf = ifprintf; -exports.kfprintf = kfprintf; -exports.ikfprintf = ikfprintf; -exports.ksprintf = ksprintf; -exports.kbprintf = kbprintf; -exports.kprintf = kprintf; -/* No side effect */ - -},{"./buffer.js":37,"./camlinternalFormat.js":55,"./curry.js":58,"./pervasives.js":62}],64:[function(require,module,exports){ -'use strict'; - -var Bytes = require("./bytes.js"); -var Curry = require("./curry.js"); -var Caml_bytes = require("./caml_bytes.js"); -var Caml_primitive = require("./caml_primitive.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); - -function make(n, c) { - return Caml_bytes.bytes_to_string(Bytes.make(n, c)); -} - -function init(n, f) { - return Caml_bytes.bytes_to_string(Bytes.init(n, f)); -} - -function copy(s) { - return Caml_bytes.bytes_to_string(Bytes.copy(Caml_bytes.bytes_of_string(s))); -} - -function sub(s, ofs, len) { - return Caml_bytes.bytes_to_string(Bytes.sub(Caml_bytes.bytes_of_string(s), ofs, len)); -} - -function ensure_ge(x, y) { - if (x >= y) { - return x; - } else { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.concat" - ]; - } -} - -function sum_lengths(_acc, seplen, _param) { - while(true) { - var param = _param; - var acc = _acc; - if (param) { - var tl = param[1]; - var hd = param[0]; - if (tl) { - _param = tl; - _acc = ensure_ge((hd.length + seplen | 0) + acc | 0, acc); - continue ; - } else { - return hd.length + acc | 0; - } - } else { - return acc; - } - }; -} - -function unsafe_blits(dst, _pos, sep, seplen, _param) { - while(true) { - var param = _param; - var pos = _pos; - if (param) { - var tl = param[1]; - var hd = param[0]; - if (tl) { - Caml_bytes.caml_blit_string(hd, 0, dst, pos, hd.length); - Caml_bytes.caml_blit_string(sep, 0, dst, pos + hd.length | 0, seplen); - _param = tl; - _pos = (pos + hd.length | 0) + seplen | 0; - continue ; - } else { - Caml_bytes.caml_blit_string(hd, 0, dst, pos, hd.length); - return dst; - } - } else { - return dst; - } - }; -} - -function concat(sep, l) { - if (l) { - var seplen = sep.length; - return Caml_bytes.bytes_to_string(unsafe_blits(Caml_bytes.caml_create_bytes(sum_lengths(0, seplen, l)), 0, sep, seplen, l)); - } else { - return ""; - } -} - -function iter(f, s) { - for(var i = 0 ,i_finish = s.length - 1 | 0; i <= i_finish; ++i){ - Curry._1(f, s.charCodeAt(i)); - } - return /* () */0; -} - -function iteri(f, s) { - for(var i = 0 ,i_finish = s.length - 1 | 0; i <= i_finish; ++i){ - Curry._2(f, i, s.charCodeAt(i)); - } - return /* () */0; -} - -function map(f, s) { - return Caml_bytes.bytes_to_string(Bytes.map(f, Caml_bytes.bytes_of_string(s))); -} - -function mapi(f, s) { - return Caml_bytes.bytes_to_string(Bytes.mapi(f, Caml_bytes.bytes_of_string(s))); -} - -function is_space(param) { - var switcher = param - 9 | 0; - if (switcher > 4 || switcher < 0) { - return switcher === 23; - } else { - return switcher !== 2; - } -} - -function trim(s) { - if (s === "" || !(is_space(s.charCodeAt(0)) || is_space(s.charCodeAt(s.length - 1 | 0)))) { - return s; - } else { - return Caml_bytes.bytes_to_string(Bytes.trim(Caml_bytes.bytes_of_string(s))); - } -} - -function escaped(s) { - var needs_escape = function (_i) { - while(true) { - var i = _i; - if (i >= s.length) { - return false; - } else { - var match = s.charCodeAt(i); - if (match >= 32) { - var switcher = match - 34 | 0; - if (switcher > 58 || switcher < 0) { - if (switcher >= 93) { - return true; - } else { - _i = i + 1 | 0; - continue ; - } - } else if (switcher > 57 || switcher < 1) { - return true; - } else { - _i = i + 1 | 0; - continue ; - } - } else { - return true; - } - } - }; - }; - if (needs_escape(0)) { - return Caml_bytes.bytes_to_string(Bytes.escaped(Caml_bytes.bytes_of_string(s))); - } else { - return s; - } -} - -function index_rec(s, lim, _i, c) { - while(true) { - var i = _i; - if (i >= lim) { - throw Caml_builtin_exceptions.not_found; - } - if (s.charCodeAt(i) === c) { - return i; - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - -function index(s, c) { - return index_rec(s, s.length, 0, c); -} - -function index_rec_opt(s, lim, _i, c) { - while(true) { - var i = _i; - if (i >= lim) { - return ; - } else if (s.charCodeAt(i) === c) { - return i; - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - -function index_opt(s, c) { - return index_rec_opt(s, s.length, 0, c); -} - -function index_from(s, i, c) { - var l = s.length; - if (i < 0 || i > l) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.index_from / Bytes.index_from" - ]; - } - return index_rec(s, l, i, c); -} - -function index_from_opt(s, i, c) { - var l = s.length; - if (i < 0 || i > l) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.index_from_opt / Bytes.index_from_opt" - ]; - } - return index_rec_opt(s, l, i, c); -} - -function rindex_rec(s, _i, c) { - while(true) { - var i = _i; - if (i < 0) { - throw Caml_builtin_exceptions.not_found; - } - if (s.charCodeAt(i) === c) { - return i; - } else { - _i = i - 1 | 0; - continue ; - } - }; -} - -function rindex(s, c) { - return rindex_rec(s, s.length - 1 | 0, c); -} - -function rindex_from(s, i, c) { - if (i < -1 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.rindex_from / Bytes.rindex_from" - ]; - } - return rindex_rec(s, i, c); -} - -function rindex_rec_opt(s, _i, c) { - while(true) { - var i = _i; - if (i < 0) { - return ; - } else if (s.charCodeAt(i) === c) { - return i; - } else { - _i = i - 1 | 0; - continue ; - } - }; -} - -function rindex_opt(s, c) { - return rindex_rec_opt(s, s.length - 1 | 0, c); -} - -function rindex_from_opt(s, i, c) { - if (i < -1 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.rindex_from_opt / Bytes.rindex_from_opt" - ]; - } - return rindex_rec_opt(s, i, c); -} - -function contains_from(s, i, c) { - var l = s.length; - if (i < 0 || i > l) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.contains_from / Bytes.contains_from" - ]; - } - try { - index_rec(s, l, i, c); - return true; - } - catch (exn){ - if (exn === Caml_builtin_exceptions.not_found) { - return false; - } else { - throw exn; - } - } -} - -function contains(s, c) { - return contains_from(s, 0, c); -} - -function rcontains_from(s, i, c) { - if (i < 0 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.rcontains_from / Bytes.rcontains_from" - ]; - } - try { - rindex_rec(s, i, c); - return true; - } - catch (exn){ - if (exn === Caml_builtin_exceptions.not_found) { - return false; - } else { - throw exn; - } - } -} - -function uppercase_ascii(s) { - return Caml_bytes.bytes_to_string(Bytes.uppercase_ascii(Caml_bytes.bytes_of_string(s))); -} - -function lowercase_ascii(s) { - return Caml_bytes.bytes_to_string(Bytes.lowercase_ascii(Caml_bytes.bytes_of_string(s))); -} - -function capitalize_ascii(s) { - return Caml_bytes.bytes_to_string(Bytes.capitalize_ascii(Caml_bytes.bytes_of_string(s))); -} - -function uncapitalize_ascii(s) { - return Caml_bytes.bytes_to_string(Bytes.uncapitalize_ascii(Caml_bytes.bytes_of_string(s))); -} - -var compare = Caml_primitive.caml_string_compare; - -function split_on_char(sep, s) { - var r = /* [] */0; - var j = s.length; - for(var i = s.length - 1 | 0; i >= 0; --i){ - if (s.charCodeAt(i) === sep) { - r = /* :: */[ - sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), - r - ]; - j = i; - } - - } - return /* :: */[ - sub(s, 0, j), - r - ]; -} - -function uppercase(s) { - return Caml_bytes.bytes_to_string(Bytes.uppercase(Caml_bytes.bytes_of_string(s))); -} - -function lowercase(s) { - return Caml_bytes.bytes_to_string(Bytes.lowercase(Caml_bytes.bytes_of_string(s))); -} - -function capitalize(s) { - return Caml_bytes.bytes_to_string(Bytes.capitalize(Caml_bytes.bytes_of_string(s))); -} - -function uncapitalize(s) { - return Caml_bytes.bytes_to_string(Bytes.uncapitalize(Caml_bytes.bytes_of_string(s))); -} - -var fill = Bytes.fill; - -var blit = Bytes.blit_string; - -function equal(prim, prim$1) { - return prim === prim$1; -} - -exports.make = make; -exports.init = init; -exports.copy = copy; -exports.sub = sub; -exports.fill = fill; -exports.blit = blit; -exports.concat = concat; -exports.iter = iter; -exports.iteri = iteri; -exports.map = map; -exports.mapi = mapi; -exports.trim = trim; -exports.escaped = escaped; -exports.index = index; -exports.index_opt = index_opt; -exports.rindex = rindex; -exports.rindex_opt = rindex_opt; -exports.index_from = index_from; -exports.index_from_opt = index_from_opt; -exports.rindex_from = rindex_from; -exports.rindex_from_opt = rindex_from_opt; -exports.contains = contains; -exports.contains_from = contains_from; -exports.rcontains_from = rcontains_from; -exports.uppercase = uppercase; -exports.lowercase = lowercase; -exports.capitalize = capitalize; -exports.uncapitalize = uncapitalize; -exports.uppercase_ascii = uppercase_ascii; -exports.lowercase_ascii = lowercase_ascii; -exports.capitalize_ascii = capitalize_ascii; -exports.uncapitalize_ascii = uncapitalize_ascii; -exports.compare = compare; -exports.equal = equal; -exports.split_on_char = split_on_char; -/* No side effect */ - -},{"./bytes.js":38,"./caml_builtin_exceptions.js":40,"./caml_bytes.js":41,"./caml_primitive.js":51,"./curry.js":58}],65:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}]},{},[25])(25) -}); \ No newline at end of file diff --git a/lib/js/test-ocaml/test_client.js b/lib/js/test-ocaml/test_client.js deleted file mode 100644 index 9efd4ec..0000000 --- a/lib/js/test-ocaml/test_client.js +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Test_client_drag = require("./test_client_drag.js"); -var Test_client_counter = require("./test_client_counter.js"); -var Test_client_http_task = require("./test_client_http_task.js"); -var Test_client_btn_update_span = require("./test_client_btn_update_span.js"); -var Test_client_on_with_options = require("./test_client_on_with_options.js"); -var Test_client_attribute_removal = require("./test_client_attribute_removal.js"); -var Test_client_counter_debug_program = require("./test_client_counter_debug_program.js"); -var Test_client_counter_debug_beginner = require("./test_client_counter_debug_beginner.js"); -var Test_client_counter_debug_standard = require("./test_client_counter_debug_standard.js"); - -var counter = Test_client_counter.main; - -var counter_debug_beginner = Test_client_counter_debug_beginner.main; - -var counter_debug_standard = Test_client_counter_debug_standard.main; - -var counter_debug_program = Test_client_counter_debug_program.main; - -var btn_update_span = Test_client_btn_update_span.main; - -var attribute_removal = Test_client_attribute_removal.main; - -var drag = Test_client_drag.main; - -var on_with_options = Test_client_on_with_options.main; - -var http_task = Test_client_http_task.main; - -exports.counter = counter; -exports.counter_debug_beginner = counter_debug_beginner; -exports.counter_debug_standard = counter_debug_standard; -exports.counter_debug_program = counter_debug_program; -exports.btn_update_span = btn_update_span; -exports.attribute_removal = attribute_removal; -exports.drag = drag; -exports.on_with_options = on_with_options; -exports.http_task = http_task; -/* Test_client_drag Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_attribute_removal.js b/lib/js/test-ocaml/test_client_attribute_removal.js deleted file mode 100644 index 6799e30..0000000 --- a/lib/js/test-ocaml/test_client_attribute_removal.js +++ /dev/null @@ -1,134 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); - -function select(param_0) { - return /* Select */[param_0]; -} - -function render_selected(param) { - if (param !== undefined) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - /* Text */Block.__(1, ["you selected " + param]), - /* :: */[ - Tea_html.div(undefined, undefined, /* :: */[ - Vdom.onMsg("click", /* Delete */0), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["delete selection"]), - /* [] */0 - ]), - /* [] */0 - ] - ]); - } else { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - /* Text */Block.__(1, ["Nothing selected"]), - /* [] */0 - ]); - } -} - -function lang(l, is_selected) { - var msg = /* Select */[l]; - return Tea_html.li(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* :: */[ - Vdom.style("color", "blue"), - /* :: */[ - is_selected ? Vdom.style("border", "1px solid black") : Tea_html.noProp, - /* :: */[ - is_selected ? /* Attribute */Block.__(1, [ - "", - "lang", - l - ]) : Tea_html.noProp, - /* [] */0 - ] - ] - ] - ], /* :: */[ - /* Text */Block.__(1, [l]), - /* [] */0 - ]); -} - -function render_languages(selected, languages) { - var is_selected = function (selected, language) { - if (selected !== undefined) { - return language === Caml_option.valFromOption(selected); - } else { - return false; - } - }; - var rendered = List.map((function (l) { - return lang(l, is_selected(selected, l)); - }), languages); - return Tea_html.ul(undefined, undefined, /* [] */0, rendered); -} - -function update(state, param) { - if (param) { - return { - selected: param[0], - languages: state.languages - }; - } else { - return { - selected: undefined, - languages: state.languages - }; - } -} - -function view(state) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - render_selected(state.selected), - /* :: */[ - render_languages(state.selected, state.languages), - /* [] */0 - ] - ]); -} - -var partial_arg_model = { - selected: "Erlang", - languages: /* :: */[ - "Erlang", - /* :: */[ - "Ocaml", - /* :: */[ - "Clojure", - /* [] */0 - ] - ] - ] -}; - -var partial_arg = { - model: partial_arg_model, - update: update, - view: view -}; - -function main(param, param$1) { - return Tea_app.beginnerProgram(partial_arg, param, param$1); -} - -var $$delete = /* Delete */0; - -exports.select = select; -exports.$$delete = $$delete; -exports.render_selected = render_selected; -exports.lang = lang; -exports.render_languages = render_languages; -exports.update = update; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_btn_update_span.js b/lib/js/test-ocaml/test_client_btn_update_span.js deleted file mode 100644 index 0fa5d75..0000000 --- a/lib/js/test-ocaml/test_client_btn_update_span.js +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); - -function update$prime(model, param) { - return /* tuple */[ - model[0], - "right" - ]; -} - -function render_model(param) { - if (param[0] !== undefined && param[1] !== undefined) { - return Tea_html.input$prime(undefined, undefined, /* :: */[ - /* RawProp */Block.__(0, [ - "value", - "This should be on screen" - ]), - /* [] */0 - ], /* [] */0); - } - return Tea_html.span(undefined, undefined, /* [] */0, /* :: */[ - /* Text */Block.__(1, ["nothing"]), - /* [] */0 - ]); -} - -function view$prime(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", /* Trigger */0), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["trigger rerender"]), - /* [] */0 - ]), - /* :: */[ - render_model(model), - /* [] */0 - ] - ]); -} - -var partial_arg_model = /* tuple */[ - "left", - undefined -]; - -var partial_arg = { - model: partial_arg_model, - update: update$prime, - view: view$prime -}; - -function main(param, param$1) { - return Tea_app.beginnerProgram(partial_arg, param, param$1); -} - -var trigger = /* Trigger */0; - -exports.trigger = trigger; -exports.update$prime = update$prime; -exports.render_model = render_model; -exports.view$prime = view$prime; -exports.main = main; -/* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_counter.js b/lib/js/test-ocaml/test_client_counter.js deleted file mode 100644 index 21f7950..0000000 --- a/lib/js/test-ocaml/test_client_counter.js +++ /dev/null @@ -1,86 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); - -function update(model, param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return model + 1 | 0; - case /* Decrement */1 : - return model - 1 | 0; - case /* Reset */2 : - return 0; - - } - } else { - return param[0]; - } -} - -function view_button(title, msg) { - return Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [title]), - /* [] */0 - ]); -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.span(undefined, undefined, /* :: */[ - Vdom.style("text-weight", "bold"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* [] */0 - ]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Increment", model >= 3 ? /* Decrement */1 : /* Increment */0), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Decrement", /* Decrement */1), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Set to 42", /* Set */[42]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - model !== 0 ? view_button("Reset", /* Reset */2) : Tea_html.noNode, - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]); -} - -var partial_arg = { - model: 4, - update: update, - view: view -}; - -function main(param, param$1) { - return Tea_app.beginnerProgram(partial_arg, param, param$1); -} - -exports.update = update; -exports.view_button = view_button; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_counter_debug_beginner.js b/lib/js/test-ocaml/test_client_counter_debug_beginner.js deleted file mode 100644 index b542eb7..0000000 --- a/lib/js/test-ocaml/test_client_counter_debug_beginner.js +++ /dev/null @@ -1,103 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_debug = require("../src-ocaml/tea_debug.js"); - -function string_of_msg(param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return "Increment"; - case /* Decrement */1 : - return "Decrement"; - case /* Reset */2 : - return "Reset"; - - } - } else { - return "Set"; - } -} - -function update(model, param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return model + 1 | 0; - case /* Decrement */1 : - return model - 1 | 0; - case /* Reset */2 : - return 0; - - } - } else { - return param[0]; - } -} - -function view_button(title, msg) { - return Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [title]), - /* [] */0 - ]); -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.span(undefined, undefined, /* :: */[ - Vdom.style("text-weight", "bold"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* [] */0 - ]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Increment", model >= 3 ? /* Decrement */1 : /* Increment */0), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Decrement", /* Decrement */1), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Set to 42", /* Set */[42]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - model !== 0 ? view_button("Reset", /* Reset */2) : Tea_html.noNode, - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]); -} - -var partial_arg = { - model: 4, - update: update, - view: view -}; - -function main(param, param$1) { - return Tea_debug.beginnerProgram(partial_arg, string_of_msg, param, param$1); -} - -exports.string_of_msg = string_of_msg; -exports.update = update; -exports.view_button = view_button; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_counter_debug_program.js b/lib/js/test-ocaml/test_client_counter_debug_program.js deleted file mode 100644 index d58e06a..0000000 --- a/lib/js/test-ocaml/test_client_counter_debug_program.js +++ /dev/null @@ -1,134 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_debug = require("../src-ocaml/tea_debug.js"); - -function string_of_msg(param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return "Increment"; - case /* Decrement */1 : - return "Decrement"; - case /* Reset */2 : - return "Reset"; - - } - } else { - return "Set"; - } -} - -function init(param) { - return /* tuple */[ - 4, - /* NoCmd */0 - ]; -} - -function subscriptions(param) { - return /* NoSub */0; -} - -function update(model, param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return /* tuple */[ - model + 1 | 0, - /* NoCmd */0 - ]; - case /* Decrement */1 : - return /* tuple */[ - model - 1 | 0, - /* NoCmd */0 - ]; - case /* Reset */2 : - return /* tuple */[ - 0, - /* NoCmd */0 - ]; - - } - } else { - return /* tuple */[ - param[0], - /* NoCmd */0 - ]; - } -} - -function view_button(title, msg) { - return Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [title]), - /* [] */0 - ]); -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.span(undefined, undefined, /* :: */[ - Vdom.style("text-weight", "bold"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* [] */0 - ]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Increment", model >= 3 ? /* Decrement */1 : /* Increment */0), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Decrement", /* Decrement */1), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Set to 42", /* Set */[42]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - model !== 0 ? view_button("Reset", /* Reset */2) : Tea_html.noNode, - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]); -} - -function partial_arg_shutdown(_model) { - return /* NoCmd */0; -} - -var partial_arg = { - init: init, - update: update, - view: view, - subscriptions: subscriptions, - shutdown: partial_arg_shutdown -}; - -function main(param, param$1) { - return Tea_debug.program(partial_arg, string_of_msg, param, param$1); -} - -exports.string_of_msg = string_of_msg; -exports.init = init; -exports.subscriptions = subscriptions; -exports.update = update; -exports.view_button = view_button; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_counter_debug_standard.js b/lib/js/test-ocaml/test_client_counter_debug_standard.js deleted file mode 100644 index 5059f10..0000000 --- a/lib/js/test-ocaml/test_client_counter_debug_standard.js +++ /dev/null @@ -1,129 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_debug = require("../src-ocaml/tea_debug.js"); - -function string_of_msg(param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return "Increment"; - case /* Decrement */1 : - return "Decrement"; - case /* Reset */2 : - return "Reset"; - - } - } else { - return "Set"; - } -} - -function init(param) { - return /* tuple */[ - 4, - /* NoCmd */0 - ]; -} - -function subscriptions(param) { - return /* NoSub */0; -} - -function update(model, param) { - if (typeof param === "number") { - switch (param) { - case /* Increment */0 : - return /* tuple */[ - model + 1 | 0, - /* NoCmd */0 - ]; - case /* Decrement */1 : - return /* tuple */[ - model - 1 | 0, - /* NoCmd */0 - ]; - case /* Reset */2 : - return /* tuple */[ - 0, - /* NoCmd */0 - ]; - - } - } else { - return /* tuple */[ - param[0], - /* NoCmd */0 - ]; - } -} - -function view_button(title, msg) { - return Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", msg), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [title]), - /* [] */0 - ]); -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.span(undefined, undefined, /* :: */[ - Vdom.style("text-weight", "bold"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* [] */0 - ]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Increment", model >= 3 ? /* Decrement */1 : /* Increment */0), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Decrement", /* Decrement */1), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - view_button("Set to 42", /* Set */[42]), - /* :: */[ - Tea_html.br(/* [] */0), - /* :: */[ - model !== 0 ? view_button("Reset", /* Reset */2) : Tea_html.noNode, - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ]); -} - -var partial_arg = { - init: init, - update: update, - view: view, - subscriptions: subscriptions -}; - -function main(param, param$1) { - return Tea_debug.standardProgram(partial_arg, string_of_msg, param, param$1); -} - -exports.string_of_msg = string_of_msg; -exports.init = init; -exports.subscriptions = subscriptions; -exports.update = update; -exports.view_button = view_button; -exports.view = view; -exports.main = main; -/* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_drag.js b/lib/js/test-ocaml/test_client_drag.js deleted file mode 100644 index 898b11b..0000000 --- a/lib/js/test-ocaml/test_client_drag.js +++ /dev/null @@ -1,224 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_json = require("../src-ocaml/tea_json.js"); -var Tea_mouse = require("../src-ocaml/tea_mouse.js"); -var Tea_result = require("../src-ocaml/tea_result.js"); - -function dragStart(param_0) { - return /* DragStart */Block.__(0, [param_0]); -} - -function dragAt(param_0) { - return /* DragAt */Block.__(1, [param_0]); -} - -function dragEnd(param_0) { - return /* DragEnd */Block.__(2, [param_0]); -} - -function init(param) { - return /* tuple */[ - { - position: { - x: 200, - y: 200 - }, - drag: undefined - }, - /* NoCmd */0 - ]; -} - -function getPosition(param) { - var drag = param.drag; - var position = param.position; - if (drag !== undefined) { - var match = drag; - var current = match.current; - var start = match.start; - return { - x: (position.x + current.x | 0) - start.x | 0, - y: (position.y + current.y | 0) - start.y | 0 - }; - } else { - return position; - } -} - -function updateHelp(model, param) { - var position = model.position; - switch (param.tag | 0) { - case /* DragStart */0 : - var xy = param[0]; - return { - position: position, - drag: { - start: xy, - current: xy - } - }; - case /* DragAt */1 : - var match = model.drag; - return { - position: position, - drag: match !== undefined ? ({ - start: match.start, - current: param[0] - }) : undefined - }; - case /* DragEnd */2 : - return { - position: getPosition(model), - drag: undefined - }; - - } -} - -function update(model, msg) { - return /* tuple */[ - updateHelp(model, msg), - /* NoCmd */0 - ]; -} - -function subscriptions(model) { - var match = model.drag; - if (match !== undefined) { - return /* Batch */Block.__(0, [/* :: */[ - Tea_mouse.moves(undefined, dragAt), - /* :: */[ - Tea_mouse.ups(undefined, dragEnd), - /* [] */0 - ] - ]]); - } else { - return /* NoSub */0; - } -} - -function px(number) { - return String(number) + "px"; -} - -function cb(ev) { - return Tea_result.result_to_option(Tea_json.Decoder.decodeEvent(Tea_json.Decoder.map(dragStart, Tea_mouse.position), ev)); -} - -var onMouseDown = Vdom.onCB("mousedown", "", cb); - -function view(model) { - var realPosition = getPosition(model); - return Tea_html.div(undefined, undefined, /* :: */[ - onMouseDown, - /* :: */[ - /* Style */Block.__(4, [/* :: */[ - /* tuple */[ - "background-color", - "#3C8D2F" - ], - /* :: */[ - /* tuple */[ - "cursor", - "move" - ], - /* :: */[ - /* tuple */[ - "width", - "100px" - ], - /* :: */[ - /* tuple */[ - "height", - "100px" - ], - /* :: */[ - /* tuple */[ - "border-radius", - "4px" - ], - /* :: */[ - /* tuple */[ - "position", - "absolute" - ], - /* :: */[ - /* tuple */[ - "left", - String(realPosition.x) + "px" - ], - /* :: */[ - /* tuple */[ - "top", - String(realPosition.y) + "px" - ], - /* :: */[ - /* tuple */[ - "color", - "white" - ], - /* :: */[ - /* tuple */[ - "display", - "flex" - ], - /* :: */[ - /* tuple */[ - "align-items", - "center" - ], - /* :: */[ - /* tuple */[ - "justify-content", - "center" - ], - /* [] */0 - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ] - ]]), - /* [] */0 - ] - ], /* :: */[ - /* Text */Block.__(1, ["Drag Me!"]), - /* [] */0 - ]); -} - -var partial_arg = { - init: init, - update: update, - view: view, - subscriptions: subscriptions -}; - -function main(param, param$1) { - return Tea_app.standardProgram(partial_arg, param, param$1); -} - -exports.dragStart = dragStart; -exports.dragAt = dragAt; -exports.dragEnd = dragEnd; -exports.init = init; -exports.getPosition = getPosition; -exports.updateHelp = updateHelp; -exports.update = update; -exports.subscriptions = subscriptions; -exports.px = px; -exports.onMouseDown = onMouseDown; -exports.view = view; -exports.main = main; -/* onMouseDown Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_http_task.js b/lib/js/test-ocaml/test_client_http_task.js deleted file mode 100644 index a0ea6be..0000000 --- a/lib/js/test-ocaml/test_client_http_task.js +++ /dev/null @@ -1,99 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var Vdom = require("../src-ocaml/vdom.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_ex = require("../src-ocaml/tea_ex.js"); -var Tea_html = require("../src-ocaml/tea_html.js"); -var Tea_http = require("../src-ocaml/tea_http.js"); -var Tea_task = require("../src-ocaml/tea_task.js"); -var Tea_debug = require("../src-ocaml/tea_debug.js"); - -function gotResponse(param_0) { - return /* GotResponse */[param_0]; -} - -function update(model, param) { - if (param) { - return /* tuple */[ - param[0][0], - /* NoCmd */0 - ]; - } else { - return /* tuple */[ - model, - Tea_task.attempt(gotResponse, Tea_task.andThen((function (param) { - return /* Task */[(function (cb) { - return Curry._1(cb, /* Ok */Block.__(0, ["both saved"])); - })]; - }), Tea_task.andThen((function (res) { - return Tea_ex.LocalStorage.setItem("todo-2", res); - }), Tea_task.andThen((function (param) { - return Tea_task.mapError(Tea_http.string_of_error, Tea_http.toTask(Tea_http.getString("https://jsonplaceholder.typicode.com/todos/2"))); - }), Tea_task.andThen((function (res) { - return Tea_ex.LocalStorage.setItem("todo-1", res); - }), Tea_task.mapError(Tea_http.string_of_error, Tea_http.toTask(Tea_http.getString("https://jsonplaceholder.typicode.com/todos/1")))))))) - ]; - } -} - -function view(model) { - return Tea_html.div(undefined, undefined, /* [] */0, /* :: */[ - Tea_html.button(undefined, undefined, /* :: */[ - Vdom.onMsg("click", /* Req */0), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["execute"]), - /* [] */0 - ]), - /* :: */[ - /* Text */Block.__(1, [model]), - /* [] */0 - ] - ]); -} - -function som(param) { - if (param) { - if (param[0].tag) { - return "GotResponse Error"; - } else { - return "GotResponse Ok"; - } - } else { - return "Req"; - } -} - -function partial_arg_init(param) { - return /* tuple */[ - "nothing", - /* NoCmd */0 - ]; -} - -function partial_arg_subscriptions(param) { - return /* NoSub */0; -} - -var partial_arg = { - init: partial_arg_init, - update: update, - view: view, - subscriptions: partial_arg_subscriptions -}; - -function main(param, param$1) { - return Tea_debug.standardProgram(partial_arg, som, param, param$1); -} - -var req = /* Req */0; - -exports.gotResponse = gotResponse; -exports.req = req; -exports.update = update; -exports.view = view; -exports.som = som; -exports.main = main; -/* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_on_with_options.js b/lib/js/test-ocaml/test_client_on_with_options.js deleted file mode 100644 index e55a877..0000000 --- a/lib/js/test-ocaml/test_client_on_with_options.js +++ /dev/null @@ -1,117 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - -var List = require("bs-platform/lib/js/list.js"); -var Block = require("bs-platform/lib/js/block.js"); -var Curry = require("bs-platform/lib/js/curry.js"); -var Tea_app = require("../src-ocaml/tea_app.js"); -var Tea_json = require("../src-ocaml/tea_json.js"); -var Tea_html2 = require("../src-ocaml/tea_html2.js"); -var Caml_format = require("bs-platform/lib/js/caml_format.js"); - -function set_value(param_0) { - return /* Set_value */[param_0]; -} - -function update(model, param) { - if (param) { - return param[0]; - } else { - return model + 1 | 0; - } -} - -function view(model) { - var clientX = Tea_json.Decoder.field("clientX", Tea_json.Decoder.$$int); - var init = Tea_html2.Events.defaultOptions; - return Tea_html2.div(undefined, undefined, /* [] */0, List.map((function (e) { - return Tea_html2.div(undefined, undefined, /* [] */0, /* :: */[ - e, - /* [] */0 - ]); - }), /* :: */[ - /* Text */Block.__(1, [String(model)]), - /* :: */[ - Tea_html2.button(undefined, undefined, /* :: */[ - Tea_html2.Events.onClick(/* Click */0), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["onClick"]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.button(undefined, undefined, /* :: */[ - Curry._3(Tea_html2.Events.on, "", "click", Tea_json.Decoder.succeed(/* Click */0)), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["on \"click\""]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.a(undefined, undefined, /* :: */[ - Tea_html2.Attributes.href("https://www.google.com"), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["a normal link"]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.a(undefined, undefined, /* :: */[ - Tea_html2.Attributes.href("https://www.google.com"), - /* :: */[ - Curry._4(Tea_html2.Events.onWithOptions, "", "click", { - stopPropagation: init.stopPropagation, - preventDefault: true - }, Tea_json.Decoder.succeed(/* Click */0)), - /* [] */0 - ] - ], /* :: */[ - /* Text */Block.__(1, ["a link with prevent default"]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.button(undefined, undefined, /* :: */[ - Curry._3(Tea_html2.Events.on, "", "click", Tea_json.Decoder.map(set_value, clientX)), - /* [] */0 - ], /* :: */[ - /* Text */Block.__(1, ["on \"click\", use clientX value"]), - /* [] */0 - ]), - /* :: */[ - Tea_html2.input$prime(undefined, undefined, /* :: */[ - Tea_html2.Attributes.type$prime("text"), - /* :: */[ - Curry._3(Tea_html2.Events.on, "", "input", Tea_json.Decoder.map((function (v) { - return /* Set_value */[Caml_format.caml_int_of_string(v)]; - }), Tea_html2.Events.targetValue)), - /* [] */0 - ] - ], /* [] */0), - /* [] */0 - ] - ] - ] - ] - ] - ] - ])); -} - -var partial_arg = { - model: 0, - update: update, - view: view -}; - -function main(param, param$1) { - return Tea_app.beginnerProgram(partial_arg, param, param$1); -} - -var click = /* Click */0; - -exports.click = click; -exports.set_value = set_value; -exports.update = update; -exports.view = view; -exports.main = main; -/* Tea_html2 Not a pure module */ diff --git a/lib/js/test-ocaml/tester.js b/lib/js/test-ocaml/tester.js deleted file mode 100644 index f49efdb..0000000 --- a/lib/js/test-ocaml/tester.js +++ /dev/null @@ -1,8 +0,0 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -'use strict'; - - -var a = 42; - -exports.a = a; -/* No side effect */ diff --git a/package.json b/package.json index 759a3a8..c69a46b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bucklescript-tea", - "version": "0.15.0", + "version": "0.15.0-schutm.4", "description": "TEA for Bucklescript", "main": "index.js", "scripts": { @@ -34,11 +34,11 @@ }, "homepage": "https://github.com/overminddl1/bucklescript-tea#readme", "devDependencies": { - "browserify": "^14.0.0", - "bs-platform": "^7.1.1", - "npm-run-all": "4.0.2", + "browserify": "^17.0.0", + "bs-platform": "^9.0.2", + "npm-run-all": "4.1.5", "pre-commit": "^1.2.0", - "watchify": "^3.11.1" + "watchify": "^4.0.0" }, "pre-commit": [ "dual-syntax" diff --git a/src-ocaml/tea.ml b/src-ocaml/tea.ml index 2b6e54d..90f4b8c 100644 --- a/src-ocaml/tea.ml +++ b/src-ocaml/tea.ml @@ -17,6 +17,8 @@ module Svg = Tea_svg module Task = Tea_task +module Promise = Tea_promise + module Program = Tea_program module Time = Tea_time diff --git a/src-ocaml/tea_ex.ml b/src-ocaml/tea_ex.ml index 9d2d687..23da60e 100644 --- a/src-ocaml/tea_ex.ml +++ b/src-ocaml/tea_ex.ml @@ -4,6 +4,15 @@ let render_event ?(key= "") msg = let () = callbacks.on ((AddRenderMsg (msg))[@explicit_arity ]) in fun () -> callbacks.on ((RemoveRenderMsg (msg))[@explicit_arity ]) in Tea_sub.registration key enableCall + +let window_resize_event ?(key="") msg = + let enableCall callbacks_base = + let callbacks = ref callbacks_base in + let handler = Vdom.eventHandler callbacks (ref (fun _ev -> Some msg)) in + let () = Web_window.addEventListener "resize" handler false in + fun () -> Web_window.removeEventListener "resize" handler false + in Tea_sub.registration key enableCall + module LocalStorage = struct open Tea_task @@ -69,4 +78,4 @@ module LocalStorage = cb ((Ok (()))[@explicit_arity ])) let setItemCmd key value = Tea_task.attemptOpt (fun _ -> None) (setItem key value) - end \ No newline at end of file + end diff --git a/src-ocaml/tea_html2.ml b/src-ocaml/tea_html2.ml index f87093e..5603057 100644 --- a/src-ocaml/tea_html2.ml +++ b/src-ocaml/tea_html2.ml @@ -466,7 +466,7 @@ module Attributes = struct let accesskey ch = prop "accesskey" (String.make 1 ch) - let contenteditable b = if b then prop "contenteditable" "contenteditable" else noProp + let contenteditable b = if b then attribute "" "contenteditable" "true" else noProp let contextmenu id = attribute "" "contextmenu" id diff --git a/src-ocaml/tea_promise.ml b/src-ocaml/tea_promise.ml index c75a87b..1573da7 100644 --- a/src-ocaml/tea_promise.ml +++ b/src-ocaml/tea_promise.ml @@ -28,11 +28,24 @@ let result promise msg = Js.Promise.resolve resolve ) |> Js.Promise.catch (function err -> - let err_to_string err = - {j|$err|j} in - let reject = enq (Tea_result.Error (err_to_string err)) in + let reject = enq (Tea_result.Error err) in Js.Promise.resolve reject ) in () ) + + +let toTask promise = + Tea_task.nativeBinding (fun cb -> + let enqRes result _ev = cb result in + let enqResOk result = enqRes (Tea_result.Ok result) () in + let enqResError result = enqRes (Tea_result.Error result) () in + promise + |> Js.Promise.then_ (function res -> + let resolve = enqResOk res in + Js.Promise.resolve resolve) + |> Js.Promise.catch (function err -> + let reject = enqResError err in + Js.Promise.resolve reject) + |> ignore) diff --git a/src-ocaml/vdom.ml b/src-ocaml/vdom.ml index e5be78d..fe6e44b 100644 --- a/src-ocaml/vdom.ml +++ b/src-ocaml/vdom.ml @@ -87,9 +87,8 @@ let rec renderToHtmlString = "\""] in String.concat "" ["<"; - namespace; - if namespace = "" then "" else ":"; tagName; + if namespace = "" then "" else (" xmlns=\"" ^ namespace ^ "\""); String.concat "" (List.map (fun p -> renderProp p) props); ">"; String.concat "" (List.map (fun v -> renderToHtmlString v) vdoms); @@ -609,4 +608,4 @@ let map = fun vdom -> let tagger = wrapCallbacks func in ((Tagger ((Obj.magic tagger), (Obj.magic vdom)))[@implicit_arity ]) : - ('a -> 'b) -> 'a t -> 'b t) : ('a -> 'b) -> 'a t -> 'b t) \ No newline at end of file + ('a -> 'b) -> 'a t -> 'b t) : ('a -> 'b) -> 'a t -> 'b t) diff --git a/src-ocaml/web_window_localstorage.ml b/src-ocaml/web_window_localstorage.ml index 427ae07..488ccd4 100644 --- a/src-ocaml/web_window_localstorage.ml +++ b/src-ocaml/web_window_localstorage.ml @@ -4,38 +4,42 @@ type t = < length : int [@bs.get]; clear : unit -> unit [@bs.meth]; key : int -> string [@bs.meth]; - getItem : string -> string [@bs.meth]; + getItem : string -> string Js.Nullable.t [@bs.meth]; removeItem : string -> unit [@bs.meth]; setItem : string -> string -> unit [@bs.meth]; > Js.t -let length window = match Js.Undefined.toOption window##localStorage with +let localStorage window = + try Js.Undefined.toOption window##localStorage + with _ -> None + +let length window = match localStorage window with | None -> None | Some localStorage -> Some (localStorage##length) -let clear window = match Js.Undefined.toOption window##localStorage with +let clear window = match localStorage window with | None -> None | Some localStorage -> Some (localStorage##clear ()) -let key window idx = match Js.Undefined.toOption window##localStorage with +let key window idx = match localStorage window with | None -> None | Some localStorage -> Some (localStorage##key idx) -let getItem window key = match Js.Undefined.toOption window##localStorage with +let getItem window key = match localStorage window with | None -> None | Some localStorage -> try Some (localStorage##getItem key) with _ -> None -let removeItem window key = match Js.Undefined.toOption window##localStorage with +let removeItem window key = match localStorage window with | None -> None | Some localStorage -> Some (localStorage##removeItem key) -let setItem window key value = match Js.Undefined.toOption window##localStorage with +let setItem window key value = match localStorage window with | None -> None | Some localStorage -> Some (localStorage##setItem key value) diff --git a/src-reason/tea.re b/src-reason/tea.re index a8da3d3..9f45eda 100644 --- a/src-reason/tea.re +++ b/src-reason/tea.re @@ -17,6 +17,8 @@ module Svg = Tea_svg; module Task = Tea_task; +module Promise = Tea_promise; + module Program = Tea_program; module Time = Tea_time; diff --git a/src-reason/tea_ex.re b/src-reason/tea_ex.re index 5b20897..ea25c2f 100644 --- a/src-reason/tea_ex.re +++ b/src-reason/tea_ex.re @@ -1,5 +1,3 @@ -/* Everything here is not in Elm and is purely used as an extension and may vanish at any time if a better API comes out. */ - let render_event = (~key="", msg) => { open Vdom; let enableCall = callbacks => { @@ -9,10 +7,19 @@ let render_event = (~key="", msg) => { Tea_sub.registration(key, enableCall); }; +let window_resize_event = (~key="", msg) => { + let enableCall = callbacks_base => { + let callbacks = ref(callbacks_base); + let handler = Vdom.eventHandler(callbacks, ref(_ev => Some(msg))); + let () = Web_window.addEventListener("resize", handler, false); + () => Web_window.removeEventListener("resize", handler, false); + }; + Tea_sub.registration(key, enableCall); +}; + module LocalStorage = { open Tea_task; open Tea_result; - let length = nativeBinding(cb => switch (Web.Window.LocalStorage.length(Web.Window.window)) { @@ -20,7 +27,6 @@ module LocalStorage = { | Some(value) => cb(Ok(value)) } ); - let clear = nativeBinding(cb => switch (Web.Window.LocalStorage.clear(Web.Window.window)) { @@ -29,7 +35,6 @@ module LocalStorage = { } ); let clearCmd = () => Tea_task.attemptOpt(_ => None, clear); - let key = idx => nativeBinding(cb => switch (Web.Window.LocalStorage.key(Web.Window.window, idx)) { @@ -37,7 +42,6 @@ module LocalStorage = { | Some(value) => cb(Ok(value)) } ); - let getItem = key => nativeBinding(cb => switch (Web.Window.LocalStorage.getItem(Web.Window.window, key)) { @@ -45,7 +49,6 @@ module LocalStorage = { | Some(value) => cb(Ok(value)) } ); - let removeItem = key => nativeBinding(cb => switch (Web.Window.LocalStorage.removeItem(Web.Window.window, key)) { @@ -54,7 +57,6 @@ module LocalStorage = { } ); let removeItemCmd = key => Tea_task.attemptOpt(_ => None, removeItem(key)); - let setItem = (key, value) => nativeBinding(cb => switch (Web.Window.LocalStorage.setItem(Web.Window.window, key, value)) { diff --git a/src-reason/tea_html2.re b/src-reason/tea_html2.re index bd2f8bf..2167786 100644 --- a/src-reason/tea_html2.re +++ b/src-reason/tea_html2.re @@ -664,7 +664,7 @@ module Attributes = { let contenteditable = b => if (b) { - prop("contenteditable", "contenteditable"); + attribute("", "contenteditable", "true"); } else { noProp; }; diff --git a/src-reason/tea_promise.re b/src-reason/tea_promise.re new file mode 100644 index 0000000..e10cc02 --- /dev/null +++ b/src-reason/tea_promise.re @@ -0,0 +1,74 @@ +let cmd = (promise, tagger) => + Vdom.( + Tea_cmd.call( + fun + | callbacks => { + let _ = + promise + |> Js.Promise.then_( + fun + | res => + switch (tagger(res)) { + | Some(msg) => + let () = callbacks^.enqueue(msg); + Js.Promise.resolve(); + | None => Js.Promise.resolve() + }, + ); + + (); + }, + ) + ); + +let result = (promise, msg) => + Vdom.( + Tea_cmd.call( + fun + | callbacks => { + let enq = result => callbacks^.enqueue(msg(result)); + + let _ = + promise + |> Js.Promise.then_( + fun + | res => { + let resolve = enq(Tea_result.Ok(res)); + Js.Promise.resolve(resolve); + }, + ) + |> Js.Promise.catch( + fun + | err => { + let reject = enq(Tea_result.Error(err)); + Js.Promise.resolve(reject); + }, + ); + + (); + }, + ) + ); + +let toTask = promise => + Tea_task.nativeBinding(cb => + let enqRes = (result, _ev) => cb(result); + let enqResOk = result => enqRes(Tea_result.Ok(result), ()); + let enqResError = result => enqRes(Tea_result.Error(result), ()); + promise + |> Js.Promise.then_( + fun + | res => { + let resolve = enqResOk(res); + Js.Promise.resolve(resolve); + }, + ) + |> Js.Promise.catch( + fun + | err => { + let reject = enqResError(err); + Js.Promise.resolve(reject); + }, + ) + |> ignore; + ); diff --git a/src-reason/vdom.re b/src-reason/vdom.re index 89012b0..a6dcdba 100644 --- a/src-reason/vdom.re +++ b/src-reason/vdom.re @@ -1,63 +1,38 @@ -/* https://github.com/Matt-Esch/virtual-dom/blob/master/docs/vnode.md */ - type systemMessage('msg) = | Render | AddRenderMsg('msg) | RemoveRenderMsg('msg); - type applicationCallbacks('msg) = { enqueue: 'msg => unit, on: systemMessage('msg) => unit, }; - -/* Attributes are not properties */ -/* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes */ - type eventHandler('msg) = | EventHandlerCallback(string, Web.Node.event => option('msg)) | EventHandlerMsg('msg); - type eventCache('msg) = { handler: Web.Node.event_cb, cb: ref(Web.Node.event => option('msg)), }; - type property('msg) = | NoProp - | RawProp(string, string) /* TODO: This last string needs to be made something more generic, maybe a function... */ - /* Attribute (namespace, key, value) */ + | RawProp(string, string) | Attribute(string, string, string) | Data(string, string) - /* Event (name, userkey, callback) */ | Event(string, eventHandler('msg), ref(option(eventCache('msg)))) | Style(list((string, string))); - type properties('msg) = list(property('msg)); - type t('msg) = | CommentNode(string) | Text(string) - /* Node (namespace, tagName, key, unique, properties, children) */ | Node(string, string, string, string, properties('msg), list(t('msg))) - /* LazyGen (key, fnGenerator) */ | LazyGen(string, unit => t('msg), ref(t('msg))) - /* Tagger (tagger, vdom) */ | Tagger( ref(applicationCallbacks('msg)) => ref(applicationCallbacks('msg)), t('msg), ); -/* TODO: support Custom */ -/* Custom (key, cbAdd, cbRemove, cbChange, properties, children) */ -/* | Custom of string * (unit -> Web.Node.t) * (Web.Node.t -> unit) * */ - -/* Nodes */ - let noNode: t('msg) = (CommentNode(""): t('msg)); - let comment = (s: string): t('msg) => CommentNode(s); - let text = (s: string): t('msg) => Text(s); - let fullnode = ( namespace: string, @@ -69,7 +44,6 @@ let fullnode = ) : t('msg) => [@implicit_arity] Node(namespace, tagName, key, unique, props, vdoms); - let node = ( ~namespace: string="", @@ -81,41 +55,26 @@ let node = ) : t('msg) => fullnode(namespace, tagName, key, unique, props, vdoms); - let lazyGen = (key: string, fn: unit => t('msg)): t('msg) => [@implicit_arity] LazyGen(key, fn, ref(noNode)); - -/* Properties */ - let noProp: property('msg) = (NoProp: property('msg)); - let prop = (key: string, value: string): property('msg) => [@implicit_arity] RawProp(key, value); - let onCB = (name: string, key: string, cb: Web.Node.event => option('msg)) : property('msg) => [@implicit_arity] Event(name, [@implicit_arity] EventHandlerCallback(key, cb), ref(None)); - let onMsg = (name: string, msg: 'msg): property('msg) => [@implicit_arity] Event(name, EventHandlerMsg(msg), ref(None)); - let attribute = (namespace: string, key: string, value: string): property('msg) => [@implicit_arity] Attribute(namespace, key, value); - let data = (key: string, value: string): property('msg) => [@implicit_arity] Data(key, value); - let style = (key: string, value: string): property('msg) => Style([(key, value)]); - let styles = (s): property('msg) => Style(s); - -/* Accessors */ - -/* TODO: Need to properly escape and so forth */ let rec renderToHtmlString: t('msg) => string = ( fun | CommentNode(s) => "" @@ -147,18 +106,16 @@ let rec renderToHtmlString: t('msg) => string = ( ], ) ); - String.concat( "", [ "<", - namespace, + tagName, if (namespace == "") { ""; } else { - ":"; + " xmlns=\"" ++ namespace ++ "\""; }, - tagName, String.concat("", List.map(p => renderProp(p), props)), ">", String.concat("", List.map(v => renderToHtmlString(v), vdoms)), @@ -175,14 +132,8 @@ let rec renderToHtmlString: t('msg) => string = ( | [@implicit_arity] Tagger(_tagger, vdom) => renderToHtmlString(vdom): t('msg) => string ); - -/* TODO: Make a vdom 'patcher' that binds into the actual DOM for hot-loading into an existing template */ - -/* Diffing/Patching */ - let emptyEventHandler: Web.Node.event_cb = ((. _ev) => (): Web.Node.event_cb); let emptyEventCB = (_ev): option(Web.Node.event_cb) => None; - let eventHandler = ( callbacks: ref(applicationCallbacks('msg)), @@ -191,17 +142,15 @@ let eventHandler = : Web.Node.event_cb => (. ev) => switch (cb^(ev)) { - | None => () /* User ignored, do nothing */ + | None => () | Some(msg) => callbacks^.enqueue(msg) }; - let eventHandler_GetCB: (eventHandler('msg), Web.Node.event) => option('msg) = ( fun | [@implicit_arity] EventHandlerCallback(_, cb) => cb | EventHandlerMsg(msg) => (_ev => Some(msg)): (eventHandler('msg), Web.Node.event) => option('msg) ); - let compareEventHandlerTypes = (left: eventHandler('msg)): (eventHandler('msg) => bool) => fun @@ -215,7 +164,6 @@ let compareEventHandlerTypes = | EventHandlerMsg(lmsg) when msg == lmsg => true | _ => false }; - let eventHandler_Register = ( callbacks: ref(applicationCallbacks('msg)), @@ -229,7 +177,6 @@ let eventHandler_Register = let () = Web.Node.addEventListener(elem, name, handler, false); Some({handler, cb}); }; - let eventHandler_Unregister = (elem: Web.Node.t, name: string) : (option(eventCache('msg)) => option(eventCache('msg))) => @@ -239,7 +186,6 @@ let eventHandler_Unregister = let () = Web.Node.removeEventListener(elem, name, cache.handler, false); None; }; - let eventHandler_Mutate = ( callbacks: ref(applicationCallbacks('msg)), @@ -274,7 +220,6 @@ let eventHandler_Mutate = (); } }; - let patchVNodesOnElems_PropertiesApply_Add = ( callbacks: ref(applicationCallbacks('msg)), @@ -300,7 +245,6 @@ let patchVNodesOnElems_PropertiesApply_Add = (), s, ); - let patchVNodesOnElems_PropertiesApply_Remove = ( _callbacks: ref(applicationCallbacks('msg)), @@ -326,7 +270,6 @@ let patchVNodesOnElems_PropertiesApply_Remove = (), s, ); - let patchVNodesOnElems_PropertiesApply_RemoveAdd = ( callbacks: ref(applicationCallbacks('msg)), @@ -342,7 +285,6 @@ let patchVNodesOnElems_PropertiesApply_RemoveAdd = patchVNodesOnElems_PropertiesApply_Add(callbacks, elem, idx, newProp); (); }; - let patchVNodesOnElems_PropertiesApply_Mutate = ( _callbacks: ref(applicationCallbacks('msg)), @@ -357,10 +299,8 @@ let patchVNodesOnElems_PropertiesApply_Mutate = "This should never be called as all entries through NoProp are gated.", ) | [@implicit_arity] RawProp(k, v) as _newProp => - /* let () = Js.log ("Mutating RawProp", elem, oldProp, _newProp) in */ - Web.Node.setProp(elem, k, v) /* Wow setting properties is slow, unsure how to optimize this further though... */ + Web.Node.setProp(elem, k, v) | [@implicit_arity] Attribute(namespace, k, v) as _newProp => - /* let () = Js.log ("Mutating Attribute", namespace, k, v, elem) in */ Web.Node.setAttributeNsOptional(elem, namespace, k, v) | [@implicit_arity] Data(k, v) as _newProp => { Js.log(("TODO: Mutate Data Unhandled", k, v)); @@ -369,7 +309,6 @@ let patchVNodesOnElems_PropertiesApply_Mutate = | [@implicit_arity] Event(_newName, _newHandlerType, _newCache) as _newProp => failwith("This will never be called because it is gated") | Style(s) as _newProp => - /* let () = Js.log ("Mutating Style", elem, oldProp, _newProp) in */ [@ocaml.warning "-4"] ( switch (oldProp) { @@ -396,7 +335,6 @@ let patchVNodesOnElems_PropertiesApply_Mutate = ) } ); - let rec patchVNodesOnElems_PropertiesApply = ( callbacks: ref(applicationCallbacks('msg)), @@ -406,22 +344,12 @@ let rec patchVNodesOnElems_PropertiesApply = newProperties: list(property('msg)), ) : bool => - /* let () = Js.log ("PROPERTY-APPLY", elem, idx, oldProperties, newProperties) in */ [@ocaml.warning "-4"] ( switch (oldProperties, newProperties) { | ([], []) => true - | ([], [_newProp, ..._newRest]) => - /* Well this is wrong, the lengths should never differ, recreate node */ - false - /* let () = patchVNodesOnElems_PropertiesApply_Add callbacks elem idx newProp in - patchVNodesOnElems_PropertiesApply callbacks elem (idx+1) [] newRest */ - | ([_oldProp, ..._oldRest], []) => - /* Well this is wrong, the lengths should never differ, recreate node */ - false - /* let () = patchVNodesOnElems_PropertiesApply_Remove callbacks elem idx oldProp in - patchVNodesOnElems_PropertiesApply callbacks elem (idx+1) [] oldRest */ - /* NoProp */ + | ([], [_newProp, ..._newRest]) => false + | ([_oldProp, ..._oldRest], []) => false | ([NoProp, ...oldRest], [NoProp, ...newRest]) => patchVNodesOnElems_PropertiesApply( callbacks, @@ -430,12 +358,10 @@ let rec patchVNodesOnElems_PropertiesApply = oldRest, newRest, ) - /* RawProp */ | ( [[@implicit_arity] RawProp(oldK, oldV) as oldProp, ...oldRest], [[@implicit_arity] RawProp(newK, newV) as newProp, ...newRest], ) => - /* let () = Js.log ("RawProp Test", elem, idx, oldProp, newProp, oldK = newK && oldV = newV, oldRest, newRest) in */ let () = if (oldK == newK && oldV == newV) { (); @@ -455,7 +381,6 @@ let rec patchVNodesOnElems_PropertiesApply = oldRest, newRest, ); - /* Attribute */ | ( [ [@implicit_arity] Attribute(oldNS, oldK, oldV) as oldProp, @@ -485,7 +410,6 @@ let rec patchVNodesOnElems_PropertiesApply = oldRest, newRest, ); - /* Data */ | ( [[@implicit_arity] Data(oldK, oldV) as oldProp, ...oldRest], [[@implicit_arity] Data(newK, newV) as newProp, ...newRest], @@ -509,7 +433,6 @@ let rec patchVNodesOnElems_PropertiesApply = oldRest, newRest, ); - /* Event */ | ( [ [@implicit_arity] Event(oldName, oldHandlerType, oldCache) as _oldProp, @@ -538,7 +461,6 @@ let rec patchVNodesOnElems_PropertiesApply = oldRest, newRest, ); - /* Style */ | ( [Style(oldS) as oldProp, ...oldRest], [Style(newS) as newProp, ...newRest], @@ -580,7 +502,6 @@ let rec patchVNodesOnElems_PropertiesApply = ); } ); - let patchVNodesOnElems_Properties = ( callbacks: ref(applicationCallbacks('msg)), @@ -589,13 +510,6 @@ let patchVNodesOnElems_Properties = newProperties: list(property('msg)), ) : bool => - /* Profiling here show `=` to be very slow, but testing reveals it to be faster than checking through the properties - manually on times when there are few to no changes, which is most of the time, so keeping it for now... */ - /* TODO: Look into if there is a better way to quick test property comparisons, especially since it likely returns - false when events are included regardless of anything else. */ - /* if oldProperties = newProperties then - () - else */ patchVNodesOnElems_PropertiesApply( callbacks, elem, @@ -603,7 +517,6 @@ let patchVNodesOnElems_Properties = oldProperties, newProperties, ); - let genEmptyProps = (length: int): list(property('msg)) => { let rec aux = lst => fun @@ -611,10 +524,8 @@ let genEmptyProps = (length: int): list(property('msg)) => { | len => aux([noProp, ...lst], len - 1); aux([], length); }; - let mapEmptyProps = (props: list(property('msg))): list(property('msg)) => List.map(_ => noProp, props); - let rec patchVNodesOnElems_ReplaceNode = ( callbacks: ref(applicationCallbacks('msg)), @@ -658,7 +569,6 @@ let rec patchVNodesOnElems_ReplaceNode = ); let _attachedChild = Web.Node.insertBefore(elem, newChild, oldChild); let _removedChild = Web.Node.removeChild(elem, oldChild); - /* let () = Js.log ("Fullswap happened", oldChild, newChild) in */ (); } | _ => @@ -666,7 +576,6 @@ let rec patchVNodesOnElems_ReplaceNode = "Node replacement should never be passed anything but a node itself", ) ) - and patchVNodesOnElems_CreateElement = (callbacks: ref(applicationCallbacks('msg))): (t('msg) => Web.Node.t) => fun @@ -709,9 +618,7 @@ and patchVNodesOnElems_CreateElement = patchVNodesOnElems_CreateElement(callbacks, vdom); } | [@implicit_arity] Tagger(tagger, vdom) => - /* let () = Js.log ("Tagger", "creating", tagger, vdom) in */ patchVNodesOnElems_CreateElement(tagger(callbacks), vdom) - and patchVNodesOnElems_MutateNode = ( callbacks: ref(applicationCallbacks('msg)), @@ -743,14 +650,9 @@ and patchVNodesOnElems_MutateNode = newChildren, ) as newNode, ) => - /* We are being ordered to mutate the node, the key's are already handled */ if (oldUnique != newUnique || oldTagName != newTagName) { - /* let () = Js.log ("Node test", "unique swap", elem, elems.(idx), newNode) in */ patchVNodesOnElems_ReplaceNode(callbacks, elem, elems, idx, newNode); } else { - /* let () = Js.log ("Node test", "non-unique mutate", elem, elems.(idx), newNode) in */ - /* Same node type, just mutate things */ - let child = elems[idx]; let childChildren = Web.Node.childNodes(child); let () = @@ -762,7 +664,6 @@ and patchVNodesOnElems_MutateNode = )) { (); } else { - /* Properties mutation failed, full swap and log */ let () = Js.log( "VDom: Failed swapping properties because the property list length changed, use `noProp` to swap properties instead, not by altering the list structure. This is a massive inefficiency until this issue is resolved.", @@ -786,7 +687,6 @@ and patchVNodesOnElems_MutateNode = } | _ => failwith("Non-node passed to patchVNodesOnElems_MutateNode") } - and patchVNodesOnElems = ( callbacks: ref(applicationCallbacks('msg)), @@ -797,12 +697,10 @@ and patchVNodesOnElems = newVNodes: list(t('msg)), ) : unit => - /* let () = Js.log ("patchVNodesOnElems", elem, elems, idx, oldVNodes, newVNodes) in */ [@ocaml.warning "-4"] ( switch (oldVNodes, newVNodes) { | ([[@implicit_arity] Tagger(_oldTagger, oldVdom), ...oldRest], _) => - /* let () = Js.log ("Tagger", "old", oldTagger, oldVdom) in */ patchVNodesOnElems( callbacks, elem, @@ -815,7 +713,6 @@ and patchVNodesOnElems = [oldNode, ...oldRest], [[@implicit_arity] Tagger(newTagger, newVdom), ...newRest], ) => - /* let () = Js.log ("Tagger", "new", newTagger, newVdom) in */ let () = patchVNodesOnElems( newTagger(callbacks), @@ -834,7 +731,7 @@ and patchVNodesOnElems = | ([_oldVnode, ...oldRest], []) => let child = elems[idx]; let _removedChild = Web.Node.removeChild(elem, child); - patchVNodesOnElems(callbacks, elem, elems, idx, oldRest, []); /* Not changing idx so we can delete the rest too */ + patchVNodesOnElems(callbacks, elem, elems, idx, oldRest, []); | ([CommentNode(oldS), ...oldRest], [CommentNode(newS), ...newRest]) when oldS == newS => patchVNodesOnElems(callbacks, elem, elems, idx + 1, oldRest, newRest) @@ -852,8 +749,7 @@ and patchVNodesOnElems = [[@implicit_arity] LazyGen(newKey, newGen, newCache), ...newRest], ) => if (oldKey == newKey) { - /* let () = Js.log ("Lazy match!", oldKey, newKey, elem, elems, idx) in */ - let () = newCache := oldCache^; /* Don't forget to pass the cache along... */ + let () = newCache := oldCache^; patchVNodesOnElems(callbacks, elem, elems, idx + 1, oldRest, newRest); } else { switch (oldRest, newRest) { @@ -868,8 +764,6 @@ and patchVNodesOnElems = ], ) when olderKey == newKey && oldKey == newerKey => - /* let () = Js.log ("Lazy older newer swap", olderKey, oldKey, newKey, newerKey, elem, elems.(idx)) in */ - /* TODO: Test this branch, it is untested thus far */ let firstChild = elems[idx]; let secondChild = elems[idx + 1]; let _removedChild = Web.Node.removeChild(elem, secondChild); @@ -891,11 +785,10 @@ and patchVNodesOnElems = _, ) when olderKey == newKey => - /* let () = Js.log ("Lazy older match", olderKey, oldKey, newKey, elem, elems.(idx)) in */ let oldChild = elems[idx]; let _removedChild = Web.Node.removeChild(elem, oldChild); let oldVdom = olderCache^; - let () = newCache := oldVdom; /* Don't forget to pass the cache along... */ + let () = newCache := oldVdom; patchVNodesOnElems( callbacks, elem, @@ -912,10 +805,9 @@ and patchVNodesOnElems = ], ) when newerKey == oldKey => - /* let () = Js.log ("Lazy newer match", "parse", oldKey, newKey, newerKey, elem, elems.(idx)) in */ let oldChild = elems[idx]; let newVdom = newGen(); - let () = newCache := newVdom; /* Don't forget to pass the cache along... */ + let () = newCache := newVdom; let newChild = patchVNodesOnElems_CreateElement(callbacks, newVdom); let _attachedChild = Web.Node.insertBefore(elem, newChild, oldChild); @@ -928,10 +820,9 @@ and patchVNodesOnElems = newRest, ); | _ => - /* let () = Js.log ("Lazy nomatch", oldKey, newKey, elem, elems.(idx)) in */ let oldVdom = oldCache^; let newVdom = newGen(); - let () = newCache := newVdom; /* Don't forget to pass the cache along... */ + let () = newCache := newVdom; patchVNodesOnElems( callbacks, elem, @@ -969,9 +860,6 @@ and patchVNodesOnElems = ], ) => if (oldKey == newKey && oldKey != "") { - /* let () = Js.log ("Node test", "match", elem, elems.(idx), newNode) in */ - /* Do nothing, they are keyed identically */ - patchVNodesOnElems(callbacks, elem, elems, idx + 1, oldRest, newRest); } else if (oldKey == "" || newKey == "") { let () = @@ -985,7 +873,6 @@ and patchVNodesOnElems = ); patchVNodesOnElems(callbacks, elem, elems, idx + 1, oldRest, newRest); } else { - /* Keys do not match but do exist */ switch (oldRest, newRest) { | ( [ @@ -1020,8 +907,6 @@ and patchVNodesOnElems = && oldNamespace == newerNamespace && oldTagName == newerTagName && oldKey == newerKey => - /* let () = Js.log ("Node test", "older newer swap", elem, elems.(idx), newNode) in */ - /* TODO: Test this branch, it is untested thus far */ let firstChild = elems[idx]; let secondChild = elems[idx + 1]; let _removedChild = Web.Node.removeChild(elem, secondChild); @@ -1054,7 +939,6 @@ and patchVNodesOnElems = olderNamespace == newNamespace && olderTagName == newTagName && olderKey == newKey => - /* let () = Js.log ("Node test", "older match", elem, elems.(idx), newNode) in */ let oldChild = elems[idx]; let _removedChild = Web.Node.removeChild(elem, oldChild); patchVNodesOnElems( @@ -1084,7 +968,6 @@ and patchVNodesOnElems = oldNamespace == newerNamespace && oldTagName == newerTagName && oldKey == newerKey => - /* let () = Js.log ("Node test", "newer match", elem, elems.(idx), newNode) in */ let oldChild = elems[idx]; let newChild = patchVNodesOnElems_CreateElement(callbacks, newNode); let _attachedChild = @@ -1125,7 +1008,6 @@ and patchVNodesOnElems = patchVNodesOnElems(callbacks, elem, elems, idx + 1, oldRest, newRest); } ); - let patchVNodesIntoElement = ( callbacks: ref(applicationCallbacks('msg)), @@ -1136,10 +1018,9 @@ let patchVNodesIntoElement = : list(t('msg)) => { let elems = Web.Node.childNodes(elem); let () = - patchVNodesOnElems(callbacks, elem, elems, 0, oldVNodes, newVNodes); /* Planning to return an altered vdom set here instead of using mutation... */ + patchVNodesOnElems(callbacks, elem, elems, 0, oldVNodes, newVNodes); newVNodes; }; - let patchVNodeIntoElement = ( callbacks: ref(applicationCallbacks('msg)), @@ -1149,7 +1030,6 @@ let patchVNodeIntoElement = ) : list(t('msg)) => patchVNodesIntoElement(callbacks, elem, [oldVNode], [newVNode]); - let wrapCallbacks_On: type a b. (a => b, systemMessage(a)) => systemMessage(b) = func => @@ -1157,7 +1037,6 @@ let wrapCallbacks_On: | Render => Render | AddRenderMsg(msg) => AddRenderMsg(func(msg)) | RemoveRenderMsg(msg) => RemoveRenderMsg(func(msg)); - let wrapCallbacks: type a b. (a => b, ref(applicationCallbacks(b))) => ref(applicationCallbacks(a)) = @@ -1175,7 +1054,6 @@ let wrapCallbacks: }, }, ); - let map: ('a => 'b, t('a)) => t('b) = ( (func, vdom) => { let tagger = wrapCallbacks(func); diff --git a/src-reason/web_window_localstorage.re b/src-reason/web_window_localstorage.re index 16e70a3..7a8706b 100644 --- a/src-reason/web_window_localstorage.re +++ b/src-reason/web_window_localstorage.re @@ -3,46 +3,51 @@ type t = { [@bs.get] "length": int, [@bs.meth] "clear": unit => unit, [@bs.meth] "key": int => string, - [@bs.meth] "getItem": string => string, + [@bs.meth] "getItem": string => Js.Nullable.t(string), [@bs.meth] "removeItem": string => unit, [@bs.meth] "setItem": (string, string) => unit, }; +let localStorage = window => + try(Js.Undefined.toOption(window##localStorage)) { + | _ => None + }; + let length = window => - switch (Js.Undefined.toOption(window##localStorage)) { + switch (localStorage(window)) { | None => None | Some(localStorage) => Some(localStorage##length) }; let clear = window => - switch (Js.Undefined.toOption(window##localStorage)) { + switch (localStorage(window)) { | None => None | Some(localStorage) => Some(localStorage##clear()) }; let key = (window, idx) => - switch (Js.Undefined.toOption(window##localStorage)) { + switch (localStorage(window)) { | None => None | Some(localStorage) => Some(localStorage##key(idx)) }; let getItem = (window, key) => - switch (Js.Undefined.toOption(window##localStorage)) { + switch (localStorage(window)) { | None => None | Some(localStorage) => - try (Some(localStorage##getItem(key))) { + try(Some(localStorage##getItem(key))) { | _ => None } }; let removeItem = (window, key) => - switch (Js.Undefined.toOption(window##localStorage)) { + switch (localStorage(window)) { | None => None | Some(localStorage) => Some(localStorage##removeItem(key)) }; let setItem = (window, key, value) => - switch (Js.Undefined.toOption(window##localStorage)) { + switch (localStorage(window)) { | None => None | Some(localStorage) => Some(localStorage##setItem(key, value)) }; diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..b46dd18 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1683 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +JSONStream@^1.0.3: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8" + integrity sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A== + dependencies: + acorn "^7.0.0" + acorn-walk "^7.0.0" + xtend "^4.0.2" + +acorn-walk@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" + integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== + +acorn@^7.0.0: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +anymatch@^3.1.0, anymatch@~3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +array-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" + integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= + +asn1.js@^5.2.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" + integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + safer-buffer "^2.1.0" + +assert@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" + integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== + dependencies: + object-assign "^4.1.1" + util "0.10.3" + +available-typed-arrays@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5" + integrity sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ== + dependencies: + array-filter "^1.0.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base64-js@^1.0.2: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.0.0, bn.js@^5.1.1: + version "5.2.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.0.1, brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browser-pack@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.1.0.tgz#c34ba10d0b9ce162b5af227c7131c92c2ecd5774" + integrity sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA== + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.8.0" + defined "^1.0.0" + safe-buffer "^5.1.1" + through2 "^2.0.0" + umd "^3.0.0" + +browser-resolve@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-2.0.0.tgz#99b7304cb392f8d73dba741bb2d7da28c6d7842b" + integrity sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ== + dependencies: + resolve "^1.17.0" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" + integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== + dependencies: + bn.js "^5.0.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" + integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== + dependencies: + bn.js "^5.1.1" + browserify-rsa "^4.0.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + elliptic "^6.5.3" + inherits "^2.0.4" + parse-asn1 "^5.1.5" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +browserify-zlib@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== + dependencies: + pako "~1.0.5" + +browserify@^17.0.0: + version "17.0.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-17.0.0.tgz#4c48fed6c02bfa2b51fd3b670fddb805723cdc22" + integrity sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w== + dependencies: + JSONStream "^1.0.3" + assert "^1.4.0" + browser-pack "^6.0.1" + browser-resolve "^2.0.0" + browserify-zlib "~0.2.0" + buffer "~5.2.1" + cached-path-relative "^1.0.0" + concat-stream "^1.6.0" + console-browserify "^1.1.0" + constants-browserify "~1.0.0" + crypto-browserify "^3.0.0" + defined "^1.0.0" + deps-sort "^2.0.1" + domain-browser "^1.2.0" + duplexer2 "~0.1.2" + events "^3.0.0" + glob "^7.1.0" + has "^1.0.0" + htmlescape "^1.1.0" + https-browserify "^1.0.0" + inherits "~2.0.1" + insert-module-globals "^7.2.1" + labeled-stream-splicer "^2.0.0" + mkdirp-classic "^0.5.2" + module-deps "^6.2.3" + os-browserify "~0.3.0" + parents "^1.0.1" + path-browserify "^1.0.0" + process "~0.11.0" + punycode "^1.3.2" + querystring-es3 "~0.2.0" + read-only-stream "^2.0.0" + readable-stream "^2.0.2" + resolve "^1.1.4" + shasum-object "^1.0.0" + shell-quote "^1.6.1" + stream-browserify "^3.0.0" + stream-http "^3.0.0" + string_decoder "^1.1.1" + subarg "^1.0.0" + syntax-error "^1.1.1" + through2 "^2.0.0" + timers-browserify "^1.0.1" + tty-browserify "0.0.1" + url "~0.11.0" + util "~0.12.0" + vm-browserify "^1.0.0" + xtend "^4.0.0" + +bs-platform@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-9.0.2.tgz#a6eac70eb8924a322556dacaccbfbc9b2a0d3a37" + integrity sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA== + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + +buffer@~5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" + integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + +cached-path-relative@^1.0.0, cached-path-relative@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.2.tgz#a13df4196d26776220cc3356eb147a52dba2c6db" + integrity sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg== + +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +chalk@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chokidar@^3.4.0: + version "3.5.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" + integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.3.1" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +combine-source-map@^0.8.0, combine-source-map@~0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" + integrity sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos= + dependencies: + convert-source-map "~1.1.0" + inline-source-map "~0.6.0" + lodash.memoize "~3.0.3" + source-map "~0.5.3" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.4.7, concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +console-browserify@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" + integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== + +constants-browserify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= + +convert-source-map@~1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" + integrity sha1-SCnId+n+SbMWHzvzZziI4gRpmGA= + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +create-ecdh@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" + integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== + dependencies: + bn.js "^4.1.0" + elliptic "^6.5.3" + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-browserify@^3.0.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +dash-ast@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37" + integrity sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA== + +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= + +deps-sort@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.1.tgz#9dfdc876d2bcec3386b6829ac52162cda9fa208d" + integrity sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw== + dependencies: + JSONStream "^1.0.3" + shasum-object "^1.0.0" + subarg "^1.0.0" + through2 "^2.0.0" + +des.js@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" + integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +detective@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.0.tgz#feb2a77e85b904ecdea459ad897cc90a99bd2a7b" + integrity sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg== + dependencies: + acorn-node "^1.6.1" + defined "^1.0.0" + minimist "^1.1.1" + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +domain-browser@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== + +duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + integrity sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= + dependencies: + readable-stream "^2.0.2" + +elliptic@^6.5.3: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: + version "1.18.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" + integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.2" + is-callable "^1.2.3" + is-negative-zero "^2.0.1" + is-regex "^1.1.2" + is-string "^1.0.5" + object-inspect "^1.9.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.0" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +events@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +fast-safe-stringify@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" + integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-assigned-identifiers@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz#6dbf411de648cbaf8d9169ebb0d2d576191e2ff1" + integrity sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + +glob-parent@~5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@^7.1.0: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.2: + version "4.2.6" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" + integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + +has@^1.0.0, has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + +htmlescape@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" + integrity sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E= + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + +ieee754@^1.1.4: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= + +inline-source-map@~0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" + integrity sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU= + dependencies: + source-map "~0.5.3" + +insert-module-globals@^7.2.1: + version "7.2.1" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.2.1.tgz#d5e33185181a4e1f33b15f7bf100ee91890d5cb3" + integrity sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg== + dependencies: + JSONStream "^1.0.3" + acorn-node "^1.5.2" + combine-source-map "^0.8.0" + concat-stream "^1.6.1" + is-buffer "^1.1.0" + path-is-absolute "^1.0.1" + process "~0.11.0" + through2 "^2.0.0" + undeclared-identifiers "^1.1.2" + xtend "^4.0.0" + +is-arguments@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" + integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== + dependencies: + call-bind "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-bigint@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" + integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-boolean-object@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" + integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng== + dependencies: + call-bind "^1.0.2" + +is-buffer@^1.1.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-callable@^1.1.4, is-callable@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" + integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== + +is-core-module@^2.2.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" + integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" + integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-generator-function@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.9.tgz#e5f82c2323673e7fcad3d12858c83c4039f6399c" + integrity sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-negative-zero@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + +is-number-object@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb" + integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-regex@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" + integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== + dependencies: + call-bind "^1.0.2" + has-symbols "^1.0.2" + +is-string@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" + integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.5.tgz#f32e6e096455e329eb7b423862456aa213f0eb4e" + integrity sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug== + dependencies: + available-typed-arrays "^1.0.2" + call-bind "^1.0.2" + es-abstract "^1.18.0-next.2" + foreach "^2.0.5" + has-symbols "^1.0.1" + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + +labeled-stream-splicer@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz#42a41a16abcd46fd046306cf4f2c3576fffb1c21" + integrity sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw== + dependencies: + inherits "^2.0.1" + stream-splicer "^2.0.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +lodash.memoize@~3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" + integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= + +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.1.0, minimist@^1.1.1: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mkdirp-classic@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + +module-deps@^6.2.3: + version "6.2.3" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-6.2.3.tgz#15490bc02af4b56cf62299c7c17cba32d71a96ee" + integrity sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA== + dependencies: + JSONStream "^1.0.3" + browser-resolve "^2.0.0" + cached-path-relative "^1.0.2" + concat-stream "~1.6.0" + defined "^1.0.0" + detective "^5.2.0" + duplexer2 "^0.1.2" + inherits "^2.0.1" + parents "^1.0.0" + readable-stream "^2.0.2" + resolve "^1.4.0" + stream-combiner2 "^1.1.1" + subarg "^1.0.0" + through2 "^2.0.0" + xtend "^4.0.0" + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-all@4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba" + integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ== + dependencies: + ansi-styles "^3.2.1" + chalk "^2.4.1" + cross-spawn "^6.0.5" + memorystream "^0.3.1" + minimatch "^3.0.4" + pidtree "^0.3.0" + read-pkg "^3.0.0" + shell-quote "^1.6.1" + string.prototype.padend "^3.0.0" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-inspect@^1.9.0: + version "1.10.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" + integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +os-browserify@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + +os-shim@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" + integrity sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc= + +outpipe@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/outpipe/-/outpipe-1.1.1.tgz#50cf8616365e87e031e29a5ec9339a3da4725fa2" + integrity sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I= + dependencies: + shell-quote "^1.4.2" + +pako@~1.0.5: + version "1.0.11" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" + integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== + +parents@^1.0.0, parents@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" + integrity sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E= + dependencies: + path-platform "~0.11.15" + +parse-asn1@^5.0.0, parse-asn1@^5.1.5: + version "5.1.6" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" + integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== + dependencies: + asn1.js "^5.2.0" + browserify-aes "^1.0.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +path-browserify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-platform@~0.11.15: + version "0.11.15" + resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" + integrity sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I= + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +pbkdf2@^3.0.3: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" + integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== + +pidtree@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a" + integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA== + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pre-commit@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/pre-commit/-/pre-commit-1.2.2.tgz#dbcee0ee9de7235e57f79c56d7ce94641a69eec6" + integrity sha1-287g7p3nI15X95xW186UZBpp7sY= + dependencies: + cross-spawn "^5.0.1" + spawn-sync "^1.0.15" + which "1.2.x" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +process@~0.11.0: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= + +punycode@^1.3.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +querystring-es3@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +read-only-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" + integrity sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A= + dependencies: + readable-stream "^2.0.2" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@3, readable-stream@^3.5.0, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@^2.0.2, readable-stream@^2.2.2, readable-stream@~2.3.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== + dependencies: + picomatch "^2.2.1" + +resolve@^1.1.4, resolve@^1.10.0, resolve@^1.17.0, resolve@^1.4.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safer-buffer@^2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +"semver@2 || 3 || 4 || 5", semver@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shasum-object@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shasum-object/-/shasum-object-1.0.0.tgz#0b7b74ff5b66ecf9035475522fa05090ac47e29e" + integrity sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg== + dependencies: + fast-safe-stringify "^2.0.7" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shell-quote@^1.4.2, shell-quote@^1.6.1: + version "1.7.2" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" + integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== + +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== + +source-map@~0.5.3: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +spawn-sync@^1.0.15: + version "1.0.15" + resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476" + integrity sha1-sAeZVX63+wyDdsKdROih6mfldHY= + dependencies: + concat-stream "^1.4.7" + os-shim "^0.1.2" + +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.8" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.8.tgz#eb1e97ad99b11bf3f82a3b71a0472dd9a00f2ecf" + integrity sha512-NDgA96EnaLSvtbM7trJj+t1LUR3pirkDCcz9nOUlPb5DMBGsH7oES6C3hs3j7R9oHEa1EMvReS/BUAIT5Tcr0g== + +stream-browserify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" + integrity sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA== + dependencies: + inherits "~2.0.4" + readable-stream "^3.5.0" + +stream-combiner2@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + integrity sha1-+02KFCDqNidk4hrUeAOXvry0HL4= + dependencies: + duplexer2 "~0.1.0" + readable-stream "^2.0.2" + +stream-http@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" + integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.4" + readable-stream "^3.6.0" + xtend "^4.0.2" + +stream-splicer@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.1.tgz#0b13b7ee2b5ac7e0609a7463d83899589a363fcd" + integrity sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg== + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.2" + +string.prototype.padend@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz#6858ca4f35c5268ebd5e8615e1327d55f59ee311" + integrity sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +subarg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" + integrity sha1-9izxdYHplrSPyWVpn1TAauJouNI= + dependencies: + minimist "^1.1.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +syntax-error@^1.1.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c" + integrity sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w== + dependencies: + acorn-node "^1.2.0" + +through2@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +through2@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" + integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== + dependencies: + readable-stream "3" + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +timers-browserify@^1.0.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + integrity sha1-ycWLV1voQHN1y14kYtrO50NZ9B0= + dependencies: + process "~0.11.0" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tty-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +umd@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.3.tgz#aa9fe653c42b9097678489c01000acb69f0b26cf" + integrity sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow== + +unbox-primitive@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" + +undeclared-identifiers@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz#9254c1d37bdac0ac2b52de4b6722792d2a91e30f" + integrity sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw== + dependencies: + acorn-node "^1.3.0" + dash-ast "^1.0.0" + get-assigned-identifiers "^1.2.0" + simple-concat "^1.0.0" + xtend "^4.0.1" + +url@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= + dependencies: + inherits "2.0.1" + +util@~0.12.0: + version "0.12.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.3.tgz#971bb0292d2cc0c892dab7c6a5d37c2bec707888" + integrity sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog== + dependencies: + inherits "^2.0.3" + is-arguments "^1.0.4" + is-generator-function "^1.0.7" + is-typed-array "^1.1.3" + safe-buffer "^5.1.2" + which-typed-array "^1.1.2" + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +vm-browserify@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" + integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== + +watchify@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/watchify/-/watchify-4.0.0.tgz#53b002d51e7b0eb640b851bb4de517a689973392" + integrity sha512-2Z04dxwoOeNxa11qzWumBTgSAohTC0+ScuY7XMenPnH+W2lhTcpEOJP4g2EIG/SWeLadPk47x++Yh+8BqPM/lA== + dependencies: + anymatch "^3.1.0" + browserify "^17.0.0" + chokidar "^3.4.0" + defined "^1.0.0" + outpipe "^1.1.0" + through2 "^4.0.2" + xtend "^4.0.2" + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-typed-array@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.4.tgz#8fcb7d3ee5adf2d771066fba7cf37e32fe8711ff" + integrity sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA== + dependencies: + available-typed-arrays "^1.0.2" + call-bind "^1.0.0" + es-abstract "^1.18.0-next.1" + foreach "^2.0.5" + function-bind "^1.1.1" + has-symbols "^1.0.1" + is-typed-array "^1.1.3" + +which@1.2.x: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + integrity sha1-mofEN48D6CfOyvGs31bHNsAcFOU= + dependencies: + isexe "^2.0.0" + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=