diff --git a/ToDo.txt b/ToDo.txt
index c8f3bf9..75b26fc 100644
--- a/ToDo.txt
+++ b/ToDo.txt
@@ -51,6 +51,7 @@ LOGGING:
OTHER:
- extend installer to movee HIDScripts to a fixed absolute path
+- proper error extraction from gRPC calls
TO FIX:
- debug out of HIDScript puts way to much CPU load on journaling daemon (floods logs)
diff --git a/web_client/build.sh b/web_client/build.sh
index 4626bf7..590ea6f 100755
--- a/web_client/build.sh
+++ b/web_client/build.sh
@@ -1,4 +1,4 @@
#!/bin/bash
# dependencies for the web app
-gopherjs build -o ../www/webapp.js main.go
+gopherjs build -o ../www/webapp.js #main.go
diff --git a/web_client/index.html b/web_client/index.html
index f027e2e..17c8e55 100644
--- a/web_client/index.html
+++ b/web_client/index.html
@@ -1,8 +1,18 @@
-
- See Javascript console for details, entry script is webapp.js (generated by gopherjs)
+
+
+
+`
+)
+
diff --git a/www/index.html b/www/index.html
index 9d3f45f..17c8e55 100644
--- a/www/index.html
+++ b/www/index.html
@@ -1,11 +1,18 @@
-
Hello
+
+
P4wnP1 by MaMe82
+
+
-
-
Testpage for P4wnP1 service
+
+
P4wnP1 service - USB settings
See Javascript console for details, entry script is webapp.js (generated by gopherjs)
-
+
+
+
+
+
diff --git a/www/p4wnp1.css b/www/p4wnp1.css
new file mode 100644
index 0000000..6d3fd9a
--- /dev/null
+++ b/www/p4wnp1.css
@@ -0,0 +1,194 @@
+/*
+
+
+*/
+
+html {
+ height: 100%;
+}
+
+body {
+ font-family: "Open Sans", sans-serif;
+ font-size: 1em;
+ line-height: 1.6;
+ background: linear-gradient(45deg, #9e9e9e, #c4c4c4 66%, #9e9e9e);
+}
+
+input {
+ /*border-radius: 99999px;*/
+ background-color: #707070;
+ background: linear-gradient(to top, #9e9e9e, #f4f4f4);
+ height: 30px;
+ box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.7);
+
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
+ font-size: 0.9em;
+ font-weight: 600;
+
+}
+
+button {
+ border-radius: 99999px;
+ background-color: #707070;
+ background: linear-gradient(to top, #f4f4f4, #9e9e9e);
+
+ height: 30px;
+ width: 100px;
+
+ text-transform: uppercase;
+ font-size: 0.9em;
+ font-weight: 800;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
+
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ letter-spacing: 1px;
+
+}
+
+.toggle-switch {
+ position: relative;
+ display: block;
+ width: 80px;
+ height: 30px;
+ background-color: gray;
+ background: linear-gradient(to top, #f4f4f4, #9e9e9e 20%);
+ border-radius: 99999px;
+ /* box-shadow: h-offset v-offset blur spread color inset initial inherit */
+ box-shadow: 1px 1px 1px 0 #3f3f3f, -1px -1px 1px 0 #ffffff; /* 2px offset gray to top, white to bottom */
+ cursor: pointer;
+}
+
+
+.toggle-switch input[type="checkbox"] {
+ display: none;
+}
+
+
+.toggle-switch div {
+ top: 50%;
+ left: 50%;
+ width: 80%;
+ height: 60%;
+ border-radius: 99999px;
+ -moz-transform: translate(-50%, -50%);
+ -ms-transform: translate(-50%, -50%);
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+ position: absolute;
+ background-color: #707070;
+ box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.7);
+}
+
+.toggle-switch input[type="checkbox"]:checked ~ div {
+ /* box-shadow: h-offset v-offset blur spread color inset initial inherit */
+ box-shadow: inset 0 0 9px 0 rgba(0, 100, 0, 0.8),0 0 11px 1px rgb(150,255,0);
+ background-color: rgb(150,250,0);
+}
+
+.toggle-switch input[type="checkbox"] ~ .toggle-switch-slider {
+ display: block;
+ width: 30px;
+ height: 30px;
+ position: absolute;
+ background: linear-gradient(to top, #9e9e9e 20%, #f4f4f4);
+ border-radius: 50%;
+ box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.7);
+ top: 0;
+ left: 0;
+ /*
+ transition: all 0.3s ease-in 0s;
+ */
+ transition: .25s;
+}
+
+.toggle-switch input[type="checkbox"] ~ .toggle-switch-slider:after {
+ content: "";
+ display: block;
+ left: 15%;
+ top: 15%;
+ width: 70%;
+ height: 70%;
+ border-radius: 50%;
+ position: absolute;
+ background: linear-gradient(to top, #f4f4f4, #9e9e9e);
+ /*
+ z-index: 1;
+ */
+
+
+}
+
+
+.toggle-switch input[type="checkbox"]:checked ~ .toggle-switch-slider {
+ -moz-transform: translate(-100%, 0);
+ -ms-transform: translate(-100%, 0);
+ -webkit-transform: translate(-100%, 0);
+ transform: translate(-100%, 0);
+
+
+ left: 100%;
+
+}
+
+
+.toggle-switch div > .on,.off {
+
+
+
+
+ position: absolute;
+
+
+ /*
+ background-color: #34A7C1;
+ */
+
+ top: 50%;
+ text-transform: uppercase;
+
+ -webkit-transform: translateY(-50%);
+ transform: translateY(-50%);
+ font-size: 0.8em;
+ font-weight: 600;
+ z-index: 2;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ letter-spacing: 1px;
+
+
+ transition: .25s;
+}
+
+
+.on {
+ left: 10%;
+ color: transparent;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0);
+}
+
+.toggle-switch input[type="checkbox"]:checked ~ div > .on {
+ color: rgb(0,154,0);
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
+}
+
+.off {
+ right: 10%;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
+}
+
+.toggle-switch input[type="checkbox"]:checked + div > .off {
+ color: transparent;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0);
+}
+
+
diff --git a/www/webapp.js b/www/webapp.js
index 1a7763e..c430f4e 100644
--- a/www/webapp.js
+++ b/www/webapp.js
@@ -2081,7 +2081,7 @@ var $isASCII = function(s) {
};
$packages["github.com/gopherjs/gopherjs/js"] = (function() {
- var $pkg = {}, $init, Object, Error, sliceType, sliceType$1, ptrType, ptrType$1, MakeFunc, Keys, init;
+ var $pkg = {}, $init, Object, Error, M, sliceType, sliceType$1, ptrType, sliceType$2, funcType, ptrType$1, MakeFunc, Keys, MakeWrapper, init;
Object = $pkg.Object = $newType(0, $kindStruct, "js.Object", true, "github.com/gopherjs/gopherjs/js", true, function(object_) {
this.$val = this;
if (arguments.length === 0) {
@@ -2098,9 +2098,12 @@ $packages["github.com/gopherjs/gopherjs/js"] = (function() {
}
this.Object = Object_;
});
+ M = $pkg.M = $newType(4, $kindMap, "js.M", true, "github.com/gopherjs/gopherjs/js", true, null);
sliceType = $sliceType($emptyInterface);
sliceType$1 = $sliceType($String);
ptrType = $ptrType(Object);
+ sliceType$2 = $sliceType(ptrType);
+ funcType = $funcType([sliceType$2], [ptrType], true);
ptrType$1 = $ptrType(Error);
Object.ptr.prototype.Get = function(key) {
var key, o;
@@ -2237,6 +2240,30 @@ $packages["github.com/gopherjs/gopherjs/js"] = (function() {
return s;
};
$pkg.Keys = Keys;
+ MakeWrapper = function(i) {
+ var i, i$1, m, methods, o, v;
+ v = i;
+ o = new ($global.Object)();
+ o.__internal_object__ = v;
+ methods = v.constructor.methods;
+ i$1 = 0;
+ while (true) {
+ if (!(i$1 < $parseInt(methods.length))) { break; }
+ m = [m];
+ m[0] = methods[i$1];
+ if (!($internalize(m[0].pkg, $String) === "")) {
+ i$1 = i$1 + (1) >> 0;
+ continue;
+ }
+ o[$externalize($internalize(m[0].name, $String), $String)] = $externalize((function(m) { return function(args) {
+ var args;
+ return $externalizeFunction(v[$externalize($internalize(m[0].prop, $String), $String)], m[0].typ, $externalize(true, $Bool)).apply(v, $externalize(args, sliceType$2));
+ }; })(m), funcType);
+ i$1 = i$1 + (1) >> 0;
+ }
+ return o;
+ };
+ $pkg.MakeWrapper = MakeWrapper;
init = function() {
var e;
e = new Error.ptr(null);
@@ -2246,6 +2273,7 @@ $packages["github.com/gopherjs/gopherjs/js"] = (function() {
ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Stack", name: "Stack", pkg: "", typ: $funcType([], [$String], false)}];
Object.init("github.com/gopherjs/gopherjs/js", [{prop: "object", name: "object", anonymous: false, exported: false, typ: ptrType, tag: ""}]);
Error.init("", [{prop: "Object", name: "Object", anonymous: true, exported: true, typ: ptrType, tag: ""}]);
+ M.init($String, $emptyInterface);
$init = function() {
$pkg.$init = function() {};
/* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -2266,7 +2294,7 @@ $packages["runtime/internal/sys"] = (function() {
return $pkg;
})();
$packages["runtime"] = (function() {
- var $pkg = {}, $init, js, sys, TypeAssertionError, errorString, ptrType$4, init, GOROOT, Goexit, SetFinalizer, KeepAlive, throw$1;
+ var $pkg = {}, $init, js, sys, TypeAssertionError, errorString, ptrType$4, init, GOROOT, Caller, Goexit, SetFinalizer, KeepAlive, throw$1;
js = $packages["github.com/gopherjs/gopherjs/js"];
sys = $packages["runtime/internal/sys"];
TypeAssertionError = $pkg.TypeAssertionError = $newType(0, $kindStruct, "runtime.TypeAssertionError", true, "runtime", true, function(interfaceString_, concreteString_, assertedString_, missingMethod_) {
@@ -2308,6 +2336,36 @@ $packages["runtime"] = (function() {
return "/usr/local/go";
};
$pkg.GOROOT = GOROOT;
+ Caller = function(skip) {
+ var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, file, info, line, ok, parts, pc, skip;
+ pc = 0;
+ file = "";
+ line = 0;
+ ok = false;
+ info = new ($global.Error)().stack.split($externalize("\n", $String))[(skip + 2 >> 0)];
+ if (info === undefined) {
+ _tmp = 0;
+ _tmp$1 = "";
+ _tmp$2 = 0;
+ _tmp$3 = false;
+ pc = _tmp;
+ file = _tmp$1;
+ line = _tmp$2;
+ ok = _tmp$3;
+ return [pc, file, line, ok];
+ }
+ parts = info.substring(($parseInt(info.indexOf($externalize("(", $String))) >> 0) + 1 >> 0, $parseInt(info.indexOf($externalize(")", $String))) >> 0).split($externalize(":", $String));
+ _tmp$4 = 0;
+ _tmp$5 = $internalize(parts[0], $String);
+ _tmp$6 = $parseInt(parts[1]) >> 0;
+ _tmp$7 = true;
+ pc = _tmp$4;
+ file = _tmp$5;
+ line = _tmp$6;
+ ok = _tmp$7;
+ return [pc, file, line, ok];
+ };
+ $pkg.Caller = Caller;
Goexit = function() {
$curGoroutine.exit = $externalize(true, $Bool);
$throw(null);
@@ -2402,7 +2460,7 @@ $packages["errors"] = (function() {
return $pkg;
})();
$packages["internal/race"] = (function() {
- var $pkg = {}, $init, Acquire, Release, ReleaseMerge, ReadRange, WriteRange;
+ var $pkg = {}, $init, Acquire, Release, ReleaseMerge, Disable, Enable, ReadRange, WriteRange;
Acquire = function(addr) {
var addr;
};
@@ -2415,6 +2473,12 @@ $packages["internal/race"] = (function() {
var addr;
};
$pkg.ReleaseMerge = ReleaseMerge;
+ Disable = function() {
+ };
+ $pkg.Disable = Disable;
+ Enable = function() {
+ };
+ $pkg.Enable = Enable;
ReadRange = function(addr, len) {
var addr, len;
};
@@ -2432,7 +2496,7 @@ $packages["internal/race"] = (function() {
return $pkg;
})();
$packages["sync/atomic"] = (function() {
- var $pkg = {}, $init, js, Value, ptrType, CompareAndSwapInt32, CompareAndSwapUint64, CompareAndSwapPointer, AddInt32, LoadUint64, LoadPointer, StorePointer;
+ var $pkg = {}, $init, js, Value, ptrType, CompareAndSwapInt32, CompareAndSwapUint64, CompareAndSwapPointer, AddInt32, LoadInt32, LoadUint64, LoadPointer, StoreInt32, StorePointer;
js = $packages["github.com/gopherjs/gopherjs/js"];
Value = $pkg.Value = $newType(0, $kindStruct, "atomic.Value", true, "sync/atomic", true, function(v_) {
this.$val = this;
@@ -2477,6 +2541,11 @@ $packages["sync/atomic"] = (function() {
return new$1;
};
$pkg.AddInt32 = AddInt32;
+ LoadInt32 = function(addr) {
+ var addr;
+ return addr.$get();
+ };
+ $pkg.LoadInt32 = LoadInt32;
LoadUint64 = function(addr) {
var addr;
return addr.$get();
@@ -2487,6 +2556,11 @@ $packages["sync/atomic"] = (function() {
return addr.$get();
};
$pkg.LoadPointer = LoadPointer;
+ StoreInt32 = function(addr, val) {
+ var addr, val;
+ addr.$set(val);
+ };
+ $pkg.StoreInt32 = StoreInt32;
StorePointer = function(addr, val) {
var addr, val;
addr.$set(val);
@@ -2524,7 +2598,7 @@ $packages["sync/atomic"] = (function() {
return $pkg;
})();
$packages["sync"] = (function() {
- var $pkg = {}, $init, js, race, runtime, atomic, Pool, Map, readOnly, entry, Mutex, poolLocalInternal, poolLocal, notifyList, ptrType, sliceType, ptrType$1, chanType, sliceType$1, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, sliceType$4, funcType, funcType$1, ptrType$15, mapType, ptrType$16, arrayType$2, semWaiters, semAwoken, expunged, allPools, runtime_registerPoolCleanup, runtime_SemacquireMutex, runtime_Semrelease, runtime_notifyListCheck, runtime_canSpin, runtime_nanotime, throw$1, newEntry, poolCleanup, init, indexLocal, init$1, runtime_doSpin;
+ var $pkg = {}, $init, js, race, runtime, atomic, Pool, Map, readOnly, entry, Mutex, Locker, poolLocalInternal, poolLocal, notifyList, RWMutex, rlocker, ptrType, sliceType, ptrType$1, chanType, sliceType$1, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, sliceType$4, ptrType$8, ptrType$9, funcType, funcType$1, ptrType$15, mapType, ptrType$16, arrayType$2, semWaiters, semAwoken, expunged, allPools, runtime_registerPoolCleanup, runtime_Semacquire, runtime_SemacquireMutex, runtime_Semrelease, runtime_notifyListCheck, runtime_canSpin, runtime_nanotime, throw$1, newEntry, poolCleanup, init, indexLocal, init$1, runtime_doSpin;
js = $packages["github.com/gopherjs/gopherjs/js"];
race = $packages["internal/race"];
runtime = $packages["runtime"];
@@ -2585,6 +2659,7 @@ $packages["sync"] = (function() {
this.state = state_;
this.sema = sema_;
});
+ Locker = $pkg.Locker = $newType(8, $kindInterface, "sync.Locker", true, "sync", true, null);
poolLocalInternal = $pkg.poolLocalInternal = $newType(0, $kindStruct, "sync.poolLocalInternal", true, "sync", false, function(private$0_, shared_, Mutex_) {
this.$val = this;
if (arguments.length === 0) {
@@ -2623,6 +2698,38 @@ $packages["sync"] = (function() {
this.head = head_;
this.tail = tail_;
});
+ RWMutex = $pkg.RWMutex = $newType(0, $kindStruct, "sync.RWMutex", true, "sync", true, function(w_, writerSem_, readerSem_, readerCount_, readerWait_) {
+ this.$val = this;
+ if (arguments.length === 0) {
+ this.w = new Mutex.ptr(0, 0);
+ this.writerSem = 0;
+ this.readerSem = 0;
+ this.readerCount = 0;
+ this.readerWait = 0;
+ return;
+ }
+ this.w = w_;
+ this.writerSem = writerSem_;
+ this.readerSem = readerSem_;
+ this.readerCount = readerCount_;
+ this.readerWait = readerWait_;
+ });
+ rlocker = $pkg.rlocker = $newType(0, $kindStruct, "sync.rlocker", true, "sync", false, function(w_, writerSem_, readerSem_, readerCount_, readerWait_) {
+ this.$val = this;
+ if (arguments.length === 0) {
+ this.w = new Mutex.ptr(0, 0);
+ this.writerSem = 0;
+ this.readerSem = 0;
+ this.readerCount = 0;
+ this.readerWait = 0;
+ return;
+ }
+ this.w = w_;
+ this.writerSem = writerSem_;
+ this.readerSem = readerSem_;
+ this.readerCount = readerCount_;
+ this.readerWait = readerWait_;
+ });
ptrType = $ptrType(Pool);
sliceType = $sliceType(ptrType);
ptrType$1 = $ptrType($Uint32);
@@ -2634,6 +2741,8 @@ $packages["sync"] = (function() {
ptrType$6 = $ptrType($Int32);
ptrType$7 = $ptrType(poolLocal);
sliceType$4 = $sliceType($emptyInterface);
+ ptrType$8 = $ptrType(rlocker);
+ ptrType$9 = $ptrType(RWMutex);
funcType = $funcType([], [$emptyInterface], false);
funcType$1 = $funcType([$emptyInterface, $emptyInterface], [$Bool], false);
ptrType$15 = $ptrType(Map);
@@ -2673,6 +2782,13 @@ $packages["sync"] = (function() {
runtime_registerPoolCleanup = function(cleanup) {
var cleanup;
};
+ runtime_Semacquire = function(s) {
+ var s, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ $r = runtime_SemacquireMutex(s, false); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semacquire }; } $f.s = s; $f.$s = $s; $f.$r = $r; return $f;
+ };
runtime_SemacquireMutex = function(s, lifo) {
var _entry, _entry$1, _entry$2, _entry$3, _entry$4, _key, _key$1, _key$2, _r, ch, lifo, s, $s, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _entry$4 = $f._entry$4; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _r = $f._r; ch = $f.ch; lifo = $f.lifo; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -3317,18 +3433,151 @@ $packages["sync"] = (function() {
runtime_doSpin = function() {
$throwRuntimeError("native function not implemented: sync.runtime_doSpin");
};
+ RWMutex.ptr.prototype.RLock = function() {
+ var rw, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ rw = this;
+ if (false) {
+ $unused(rw.w.state);
+ race.Disable();
+ }
+ /* */ if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { $s = 1; continue; }
+ /* */ $s = 2; continue;
+ /* if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { */ case 1:
+ $r = runtime_Semacquire((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ /* } */ case 2:
+ if (false) {
+ race.Enable();
+ race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))));
+ }
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RLock }; } $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ RWMutex.prototype.RLock = function() { return this.$val.RLock(); };
+ RWMutex.ptr.prototype.RUnlock = function() {
+ var r, rw, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ rw = this;
+ if (false) {
+ $unused(rw.w.state);
+ race.ReleaseMerge(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))));
+ race.Disable();
+ }
+ r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1);
+ /* */ if (r < 0) { $s = 1; continue; }
+ /* */ $s = 2; continue;
+ /* if (r < 0) { */ case 1:
+ if (((r + 1 >> 0) === 0) || ((r + 1 >> 0) === -1073741824)) {
+ race.Enable();
+ throw$1("sync: RUnlock of unlocked RWMutex");
+ }
+ /* */ if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { $s = 3; continue; }
+ /* */ $s = 4; continue;
+ /* if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { */ case 3:
+ $r = runtime_Semrelease((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ /* } */ case 4:
+ /* } */ case 2:
+ if (false) {
+ race.Enable();
+ }
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RUnlock }; } $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ RWMutex.prototype.RUnlock = function() { return this.$val.RUnlock(); };
+ RWMutex.ptr.prototype.Lock = function() {
+ var r, rw, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ rw = this;
+ if (false) {
+ $unused(rw.w.state);
+ race.Disable();
+ }
+ $r = rw.w.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1073741824) + 1073741824 >> 0;
+ /* */ if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { $s = 2; continue; }
+ /* */ $s = 3; continue;
+ /* if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { */ case 2:
+ $r = runtime_Semacquire((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ /* } */ case 3:
+ if (false) {
+ race.Enable();
+ race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))));
+ race.Acquire(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))));
+ }
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Lock }; } $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ RWMutex.prototype.Lock = function() { return this.$val.Lock(); };
+ RWMutex.ptr.prototype.Unlock = function() {
+ var i, r, rw, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; i = $f.i; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ rw = this;
+ if (false) {
+ $unused(rw.w.state);
+ race.Release(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))));
+ race.Release(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))));
+ race.Disable();
+ }
+ r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1073741824);
+ if (r >= 1073741824) {
+ race.Enable();
+ throw$1("sync: Unlock of unlocked RWMutex");
+ }
+ i = 0;
+ /* while (true) { */ case 1:
+ /* if (!(i < ((r >> 0)))) { break; } */ if(!(i < ((r >> 0)))) { $s = 2; continue; }
+ $r = runtime_Semrelease((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))), false); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ i = i + (1) >> 0;
+ /* } */ $s = 1; continue; case 2:
+ $r = rw.w.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ if (false) {
+ race.Enable();
+ }
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Unlock }; } $f.i = i; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ RWMutex.prototype.Unlock = function() { return this.$val.Unlock(); };
+ RWMutex.ptr.prototype.RLocker = function() {
+ var rw;
+ rw = this;
+ return ($pointerOfStructConversion(rw, ptrType$8));
+ };
+ RWMutex.prototype.RLocker = function() { return this.$val.RLocker(); };
+ rlocker.ptr.prototype.Lock = function() {
+ var r, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ r = this;
+ $r = ($pointerOfStructConversion(r, ptrType$9)).RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Lock }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ rlocker.prototype.Lock = function() { return this.$val.Lock(); };
+ rlocker.ptr.prototype.Unlock = function() {
+ var r, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ r = this;
+ $r = ($pointerOfStructConversion(r, ptrType$9)).RUnlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Unlock }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ rlocker.prototype.Unlock = function() { return this.$val.Unlock(); };
ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "getSlow", name: "getSlow", pkg: "sync", typ: $funcType([], [$emptyInterface], false)}, {prop: "pin", name: "pin", pkg: "sync", typ: $funcType([], [ptrType$7], false)}, {prop: "pinSlow", name: "pinSlow", pkg: "sync", typ: $funcType([], [ptrType$7], false)}];
ptrType$15.methods = [{prop: "Load", name: "Load", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface, $Bool], false)}, {prop: "Store", name: "Store", pkg: "", typ: $funcType([$emptyInterface, $emptyInterface], [], false)}, {prop: "LoadOrStore", name: "LoadOrStore", pkg: "", typ: $funcType([$emptyInterface, $emptyInterface], [$emptyInterface, $Bool], false)}, {prop: "Delete", name: "Delete", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "Range", name: "Range", pkg: "", typ: $funcType([funcType$1], [], false)}, {prop: "missLocked", name: "missLocked", pkg: "sync", typ: $funcType([], [], false)}, {prop: "dirtyLocked", name: "dirtyLocked", pkg: "sync", typ: $funcType([], [], false)}];
ptrType$4.methods = [{prop: "load", name: "load", pkg: "sync", typ: $funcType([], [$emptyInterface, $Bool], false)}, {prop: "tryStore", name: "tryStore", pkg: "sync", typ: $funcType([ptrType$3], [$Bool], false)}, {prop: "unexpungeLocked", name: "unexpungeLocked", pkg: "sync", typ: $funcType([], [$Bool], false)}, {prop: "storeLocked", name: "storeLocked", pkg: "sync", typ: $funcType([ptrType$3], [], false)}, {prop: "tryLoadOrStore", name: "tryLoadOrStore", pkg: "sync", typ: $funcType([$emptyInterface], [$emptyInterface, $Bool, $Bool], false)}, {prop: "delete$", name: "delete", pkg: "sync", typ: $funcType([], [$Bool], false)}, {prop: "tryExpungeLocked", name: "tryExpungeLocked", pkg: "sync", typ: $funcType([], [$Bool], false)}];
ptrType$16.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}];
+ ptrType$9.methods = [{prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}, {prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "RLocker", name: "RLocker", pkg: "", typ: $funcType([], [Locker], false)}];
+ ptrType$8.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}];
Pool.init("sync", [{prop: "local", name: "local", anonymous: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "localSize", name: "localSize", anonymous: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "store", name: "store", anonymous: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "New", name: "New", anonymous: false, exported: true, typ: funcType, tag: ""}]);
Map.init("sync", [{prop: "mu", name: "mu", anonymous: false, exported: false, typ: Mutex, tag: ""}, {prop: "read", name: "read", anonymous: false, exported: false, typ: atomic.Value, tag: ""}, {prop: "dirty", name: "dirty", anonymous: false, exported: false, typ: mapType, tag: ""}, {prop: "misses", name: "misses", anonymous: false, exported: false, typ: $Int, tag: ""}]);
readOnly.init("sync", [{prop: "m", name: "m", anonymous: false, exported: false, typ: mapType, tag: ""}, {prop: "amended", name: "amended", anonymous: false, exported: false, typ: $Bool, tag: ""}]);
entry.init("sync", [{prop: "p", name: "p", anonymous: false, exported: false, typ: $UnsafePointer, tag: ""}]);
Mutex.init("sync", [{prop: "state", name: "state", anonymous: false, exported: false, typ: $Int32, tag: ""}, {prop: "sema", name: "sema", anonymous: false, exported: false, typ: $Uint32, tag: ""}]);
+ Locker.init([{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]);
poolLocalInternal.init("sync", [{prop: "private$0", name: "private", anonymous: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "shared", name: "shared", anonymous: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "Mutex", name: "Mutex", anonymous: true, exported: true, typ: Mutex, tag: ""}]);
poolLocal.init("sync", [{prop: "poolLocalInternal", name: "poolLocalInternal", anonymous: true, exported: false, typ: poolLocalInternal, tag: ""}, {prop: "pad", name: "pad", anonymous: false, exported: false, typ: arrayType$2, tag: ""}]);
notifyList.init("sync", [{prop: "wait", name: "wait", anonymous: false, exported: false, typ: $Uint32, tag: ""}, {prop: "notify", name: "notify", anonymous: false, exported: false, typ: $Uint32, tag: ""}, {prop: "lock", name: "lock", anonymous: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "head", name: "head", anonymous: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "tail", name: "tail", anonymous: false, exported: false, typ: $UnsafePointer, tag: ""}]);
+ RWMutex.init("sync", [{prop: "w", name: "w", anonymous: false, exported: false, typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", anonymous: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", anonymous: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", anonymous: false, exported: false, typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", anonymous: false, exported: false, typ: $Int32, tag: ""}]);
+ rlocker.init("sync", [{prop: "w", name: "w", anonymous: false, exported: false, typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", anonymous: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", anonymous: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", anonymous: false, exported: false, typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", anonymous: false, exported: false, typ: $Int32, tag: ""}]);
$init = function() {
$pkg.$init = function() {};
/* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -3348,12 +3597,46 @@ $packages["sync"] = (function() {
return $pkg;
})();
$packages["io"] = (function() {
- var $pkg = {}, $init, errors, sync, atomic, RuneScanner, errWhence, errOffset;
+ var $pkg = {}, $init, errors, sync, atomic, Reader, Writer, ReaderFrom, RuneScanner, stringWriter, sliceType, errWhence, errOffset, WriteString;
errors = $packages["errors"];
sync = $packages["sync"];
atomic = $packages["sync/atomic"];
+ Reader = $pkg.Reader = $newType(8, $kindInterface, "io.Reader", true, "io", true, null);
+ Writer = $pkg.Writer = $newType(8, $kindInterface, "io.Writer", true, "io", true, null);
+ ReaderFrom = $pkg.ReaderFrom = $newType(8, $kindInterface, "io.ReaderFrom", true, "io", true, null);
RuneScanner = $pkg.RuneScanner = $newType(8, $kindInterface, "io.RuneScanner", true, "io", true, null);
+ stringWriter = $pkg.stringWriter = $newType(8, $kindInterface, "io.stringWriter", true, "io", false, null);
+ sliceType = $sliceType($Uint8);
+ WriteString = function(w, s) {
+ var _r, _r$1, _tuple, _tuple$1, _tuple$2, err, n, ok, s, sw, w, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; n = $f.n; ok = $f.ok; s = $f.s; sw = $f.sw; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ n = 0;
+ err = $ifaceNil;
+ _tuple = $assertType(w, stringWriter, true);
+ sw = _tuple[0];
+ ok = _tuple[1];
+ /* */ if (ok) { $s = 1; continue; }
+ /* */ $s = 2; continue;
+ /* if (ok) { */ case 1:
+ _r = sw.WriteString(s); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ _tuple$1 = _r;
+ n = _tuple$1[0];
+ err = _tuple$1[1];
+ $s = -1; return [n, err];
+ /* } */ case 2:
+ _r$1 = w.Write((new sliceType($stringToBytes(s)))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
+ _tuple$2 = _r$1;
+ n = _tuple$2[0];
+ err = _tuple$2[1];
+ $s = -1; return [n, err];
+ /* */ } return; } if ($f === undefined) { $f = { $blk: WriteString }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.n = n; $f.ok = ok; $f.s = s; $f.sw = sw; $f.w = w; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.WriteString = WriteString;
+ Reader.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]);
+ Writer.init([{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]);
+ ReaderFrom.init([{prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([Reader], [$Int64, $error], false)}]);
RuneScanner.init([{prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}]);
+ stringWriter.init([{prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]);
$init = function() {
$pkg.$init = function() {};
/* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -3374,12 +3657,43 @@ $packages["io"] = (function() {
return $pkg;
})();
$packages["math"] = (function() {
- var $pkg = {}, $init, js, arrayType, arrayType$1, arrayType$2, structType, math, buf, init, Float32bits, Float64bits;
+ var $pkg = {}, $init, js, arrayType, arrayType$1, arrayType$2, structType, math, zero, posInf, negInf, nan, buf, Inf, IsInf, IsNaN, NaN, init, Float32bits, Float32frombits, Float64bits, Float64frombits;
js = $packages["github.com/gopherjs/gopherjs/js"];
arrayType = $arrayType($Uint32, 2);
arrayType$1 = $arrayType($Float32, 2);
arrayType$2 = $arrayType($Float64, 1);
structType = $structType("math", [{prop: "uint32array", name: "uint32array", anonymous: false, exported: false, typ: arrayType, tag: ""}, {prop: "float32array", name: "float32array", anonymous: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "float64array", name: "float64array", anonymous: false, exported: false, typ: arrayType$2, tag: ""}]);
+ Inf = function(sign) {
+ var sign;
+ if (sign >= 0) {
+ return posInf;
+ } else {
+ return negInf;
+ }
+ };
+ $pkg.Inf = Inf;
+ IsInf = function(f, sign) {
+ var f, sign;
+ if (f === posInf) {
+ return sign >= 0;
+ }
+ if (f === negInf) {
+ return sign <= 0;
+ }
+ return false;
+ };
+ $pkg.IsInf = IsInf;
+ IsNaN = function(f) {
+ var f, is;
+ is = false;
+ is = !((f === f));
+ return is;
+ };
+ $pkg.IsNaN = IsNaN;
+ NaN = function() {
+ return nan;
+ };
+ $pkg.NaN = NaN;
init = function() {
var ab;
ab = new ($global.ArrayBuffer)(8);
@@ -3393,18 +3707,35 @@ $packages["math"] = (function() {
return buf.uint32array[0];
};
$pkg.Float32bits = Float32bits;
+ Float32frombits = function(b) {
+ var b;
+ buf.uint32array[0] = b;
+ return buf.float32array[0];
+ };
+ $pkg.Float32frombits = Float32frombits;
Float64bits = function(f) {
var f, x, x$1;
buf.float64array[0] = f;
return (x = $shiftLeft64((new $Uint64(0, buf.uint32array[1])), 32), x$1 = (new $Uint64(0, buf.uint32array[0])), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low));
};
$pkg.Float64bits = Float64bits;
+ Float64frombits = function(b) {
+ var b;
+ buf.uint32array[0] = ((b.$low >>> 0));
+ buf.uint32array[1] = (($shiftRightUint64(b, 32).$low >>> 0));
+ return buf.float64array[0];
+ };
+ $pkg.Float64frombits = Float64frombits;
$init = function() {
$pkg.$init = function() {};
/* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
$r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
buf = new structType.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$2.zero());
math = $global.Math;
+ zero = 0;
+ posInf = 1 / zero;
+ negInf = -1 / zero;
+ nan = 0 / zero;
init();
/* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
};
@@ -3412,7 +3743,7 @@ $packages["math"] = (function() {
return $pkg;
})();
$packages["syscall"] = (function() {
- var $pkg = {}, $init, js, race, runtime, sync, SockaddrLinklayer, SockaddrNetlink, mmapper, Errno, Sockaddr, SockaddrInet4, SockaddrInet6, SockaddrUnix, Timespec, Stat_t, RawSockaddrInet4, RawSockaddrInet6, RawSockaddrUnix, RawSockaddrLinklayer, RawSockaddrNetlink, RawSockaddr, RawSockaddrAny, _Socklen, Linger, Iovec, IPMreq, IPMreqn, IPv6Mreq, Msghdr, sliceType, sliceType$1, ptrType$2, ptrType$4, arrayType$1, ptrType$8, arrayType$2, ptrType$11, arrayType$4, arrayType$7, arrayType$8, arrayType$9, arrayType$10, ptrType$18, ptrType$19, structType, ptrType$22, ptrType$24, ptrType$25, mapType, funcType$2, funcType$3, ptrType$26, ptrType$27, ptrType$28, ptrType$29, arrayType$15, ptrType$31, warningPrinted, lineBuffer, syscallModule, alreadyTriedToLoad, minusOne, envs, mapper, errEAGAIN, errEINVAL, errENOENT, ioSync, ioSync$24ptr, errors, init, printWarning, printToConsole, indexByte, runtime_envs, syscall, Syscall, Syscall6, BytePtrFromString, readInt, readIntBE, readIntLE, ParseDirent, CloseOnExec, SetNonblock, msanRead, msanWrite, itoa, uitoa, anyToSockaddr, Accept, Accept4, SetsockoptIPMreqn, Recvmsg, SendmsgN, ReadDirent, direntIno, direntReclen, direntNamlen, errnoErr, Read, Write, GetsockoptInt, Recvfrom, Sendto, SetsockoptByte, SetsockoptInt, SetsockoptInet4Addr, SetsockoptIPMreq, SetsockoptIPv6Mreq, SetsockoptLinger, Close, Fchdir, Fchmod, fcntl, Fsync, Getdents, read, write, munmap, Fchown, Fstat, Ftruncate, Lstat, Pread, Pwrite, Seek, Shutdown, accept, accept4, getsockopt, setsockopt, recvfrom, sendto, recvmsg, sendmsg, mmap;
+ var $pkg = {}, $init, js, race, runtime, sync, SockaddrLinklayer, SockaddrNetlink, mmapper, Errno, Sockaddr, SockaddrInet4, SockaddrInet6, SockaddrUnix, Timespec, Stat_t, RawSockaddrInet4, RawSockaddrInet6, RawSockaddrUnix, RawSockaddrLinklayer, RawSockaddrNetlink, RawSockaddr, RawSockaddrAny, _Socklen, Linger, Iovec, IPMreq, IPMreqn, IPv6Mreq, Msghdr, sliceType, sliceType$1, ptrType$2, ptrType$4, arrayType$1, ptrType$8, arrayType$2, ptrType$11, arrayType$4, arrayType$7, arrayType$8, arrayType$9, arrayType$10, ptrType$18, ptrType$19, structType, ptrType$22, ptrType$24, ptrType$25, mapType, funcType$2, funcType$3, ptrType$26, ptrType$27, ptrType$28, ptrType$29, arrayType$15, ptrType$31, warningPrinted, lineBuffer, syscallModule, alreadyTriedToLoad, minusOne, envs, mapper, errEAGAIN, errEINVAL, errENOENT, ioSync, ioSync$24ptr, errors, init, printWarning, printToConsole, Exit, indexByte, runtime_envs, syscall, Syscall, Syscall6, BytePtrFromString, readInt, readIntBE, readIntLE, ParseDirent, CloseOnExec, SetNonblock, msanRead, msanWrite, itoa, uitoa, anyToSockaddr, Accept, Accept4, SetsockoptIPMreqn, Recvmsg, SendmsgN, ReadDirent, direntIno, direntReclen, direntNamlen, errnoErr, Read, Write, GetsockoptInt, Recvfrom, Sendto, SetsockoptByte, SetsockoptInt, SetsockoptInet4Addr, SetsockoptIPMreq, SetsockoptIPv6Mreq, SetsockoptLinger, Close, Fchdir, Fchmod, fcntl, Fsync, Getdents, read, write, munmap, Fchown, Fstat, Ftruncate, Lstat, Pread, Pwrite, Seek, Shutdown, accept, accept4, getsockopt, setsockopt, recvfrom, sendto, recvmsg, sendmsg, mmap;
js = $packages["github.com/gopherjs/gopherjs/js"];
race = $packages["internal/race"];
runtime = $packages["runtime"];
@@ -3781,6 +4112,11 @@ $packages["syscall"] = (function() {
lineBuffer = $subslice(lineBuffer, (i + 1 >> 0));
}
};
+ Exit = function(code) {
+ var code;
+ Syscall(231, ((code >>> 0)), 0, 0);
+ };
+ $pkg.Exit = Exit;
indexByte = function(s, c) {
var _i, _ref, b, c, i, s;
_ref = s;
@@ -5214,7 +5550,15 @@ $packages["syscall"] = (function() {
return $pkg;
})();
$packages["github.com/gopherjs/gopherjs/nosync"] = (function() {
- var $pkg = {}, $init, Once, funcType$1, ptrType$4;
+ var $pkg = {}, $init, Mutex, Once, ptrType$1, funcType$1, ptrType$4;
+ Mutex = $pkg.Mutex = $newType(0, $kindStruct, "nosync.Mutex", true, "github.com/gopherjs/gopherjs/nosync", true, function(locked_) {
+ this.$val = this;
+ if (arguments.length === 0) {
+ this.locked = false;
+ return;
+ }
+ this.locked = locked_;
+ });
Once = $pkg.Once = $newType(0, $kindStruct, "nosync.Once", true, "github.com/gopherjs/gopherjs/nosync", true, function(doing_, done_) {
this.$val = this;
if (arguments.length === 0) {
@@ -5225,8 +5569,27 @@ $packages["github.com/gopherjs/gopherjs/nosync"] = (function() {
this.doing = doing_;
this.done = done_;
});
+ ptrType$1 = $ptrType(Mutex);
funcType$1 = $funcType([], [], false);
ptrType$4 = $ptrType(Once);
+ Mutex.ptr.prototype.Lock = function() {
+ var m;
+ m = this;
+ if (m.locked) {
+ $panic(new $String("nosync: mutex is already locked"));
+ }
+ m.locked = true;
+ };
+ Mutex.prototype.Lock = function() { return this.$val.Lock(); };
+ Mutex.ptr.prototype.Unlock = function() {
+ var m;
+ m = this;
+ if (!m.locked) {
+ $panic(new $String("nosync: unlock of unlocked mutex"));
+ }
+ m.locked = false;
+ };
+ Mutex.prototype.Unlock = function() { return this.$val.Unlock(); };
Once.ptr.prototype.Do = function(f) {
var f, o, $s, $deferred, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; o = $f.o; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred);
@@ -5248,7 +5611,9 @@ $packages["github.com/gopherjs/gopherjs/nosync"] = (function() {
/* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } }
};
Once.prototype.Do = function(f) { return this.$val.Do(f); };
+ ptrType$1.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}];
ptrType$4.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType$1], [], false)}];
+ Mutex.init("github.com/gopherjs/gopherjs/nosync", [{prop: "locked", name: "locked", anonymous: false, exported: false, typ: $Bool, tag: ""}]);
Once.init("github.com/gopherjs/gopherjs/nosync", [{prop: "doing", name: "doing", anonymous: false, exported: false, typ: $Bool, tag: ""}, {prop: "done", name: "done", anonymous: false, exported: false, typ: $Bool, tag: ""}]);
$init = function() {
$pkg.$init = function() {};
@@ -9535,7 +9900,7 @@ $packages["internal/testlog"] = (function() {
return $pkg;
})();
$packages["os"] = (function() {
- var $pkg = {}, $init, errors, js, poll, testlog, io, runtime, sync, atomic, syscall, time, timeout, PathError, SyscallError, LinkError, file, dirInfo, File, FileInfo, FileMode, fileStat, sliceType, ptrType, sliceType$1, ptrType$1, sliceType$2, ptrType$2, ptrType$3, ptrType$4, sliceType$5, ptrType$12, ptrType$13, funcType$1, ptrType$15, arrayType$2, arrayType$5, ptrType$16, errFinished, lstat, runtime_args, init, NewSyscallError, IsNotExist, underlyingError, wrapSyscallError, isNotExist, sigpipe, syscallMode, NewFile, newFile, epipecheck, basename, init$1, Lstat, fillFileStatFromSys, timespecToTime, lstatNolog;
+ var $pkg = {}, $init, errors, js, poll, testlog, io, runtime, sync, atomic, syscall, time, timeout, PathError, SyscallError, LinkError, file, dirInfo, File, FileInfo, FileMode, fileStat, sliceType, ptrType, sliceType$1, ptrType$1, sliceType$2, ptrType$2, ptrType$3, ptrType$4, sliceType$5, ptrType$12, ptrType$13, funcType$1, ptrType$15, arrayType$2, arrayType$5, ptrType$16, errFinished, lstat, runtime_args, init, runtime_beforeExit, NewSyscallError, IsNotExist, underlyingError, wrapSyscallError, isNotExist, sigpipe, syscallMode, NewFile, newFile, epipecheck, basename, init$1, Exit, Lstat, fillFileStatFromSys, timespecToTime, lstatNolog;
errors = $packages["errors"];
js = $packages["github.com/gopherjs/gopherjs/js"];
poll = $packages["internal/poll"];
@@ -9673,6 +10038,8 @@ $packages["os"] = (function() {
$pkg.Args = new sliceType(["?"]);
}
};
+ runtime_beforeExit = function() {
+ };
File.ptr.prototype.Readdir = function(n) {
var _r, f, n, $s, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -10498,6 +10865,14 @@ $packages["os"] = (function() {
}
$pkg.Args = runtime_args();
};
+ Exit = function(code) {
+ var code;
+ if (code === 0) {
+ runtime_beforeExit();
+ }
+ syscall.Exit(code);
+ };
+ $pkg.Exit = Exit;
Lstat = function(name) {
var name, $s, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -10712,7 +11087,7 @@ $packages["os"] = (function() {
return $pkg;
})();
$packages["unicode/utf8"] = (function() {
- var $pkg = {}, $init, acceptRange, first, acceptRanges, DecodeRuneInString, RuneLen, EncodeRune, RuneCount, RuneCountInString, ValidRune;
+ var $pkg = {}, $init, acceptRange, first, acceptRanges, DecodeRune, DecodeRuneInString, RuneLen, EncodeRune, RuneCount, RuneCountInString, ValidString, ValidRune;
acceptRange = $pkg.acceptRange = $newType(0, $kindStruct, "utf8.acceptRange", true, "unicode/utf8", false, function(lo_, hi_) {
this.$val = this;
if (arguments.length === 0) {
@@ -10723,6 +11098,82 @@ $packages["unicode/utf8"] = (function() {
this.lo = lo_;
this.hi = hi_;
});
+ DecodeRune = function(p) {
+ var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, b1, b2, b3, mask, n, p, p0, r, size, sz, x, x$1;
+ r = 0;
+ size = 0;
+ n = p.$length;
+ if (n < 1) {
+ _tmp = 65533;
+ _tmp$1 = 0;
+ r = _tmp;
+ size = _tmp$1;
+ return [r, size];
+ }
+ p0 = (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]);
+ x = ((p0 < 0 || p0 >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[p0]);
+ if (x >= 240) {
+ mask = (((x >> 0)) << 31 >> 0) >> 31 >> 0;
+ _tmp$2 = (((((0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]) >> 0)) & ~mask) >> 0) | (65533 & mask);
+ _tmp$3 = 1;
+ r = _tmp$2;
+ size = _tmp$3;
+ return [r, size];
+ }
+ sz = (x & 7) >>> 0;
+ accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange);
+ if (n < ((sz >> 0))) {
+ _tmp$4 = 65533;
+ _tmp$5 = 1;
+ r = _tmp$4;
+ size = _tmp$5;
+ return [r, size];
+ }
+ b1 = (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]);
+ if (b1 < accept.lo || accept.hi < b1) {
+ _tmp$6 = 65533;
+ _tmp$7 = 1;
+ r = _tmp$6;
+ size = _tmp$7;
+ return [r, size];
+ }
+ if (sz === 2) {
+ _tmp$8 = (((((p0 & 31) >>> 0) >> 0)) << 6 >> 0) | ((((b1 & 63) >>> 0) >> 0));
+ _tmp$9 = 2;
+ r = _tmp$8;
+ size = _tmp$9;
+ return [r, size];
+ }
+ b2 = (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]);
+ if (b2 < 128 || 191 < b2) {
+ _tmp$10 = 65533;
+ _tmp$11 = 1;
+ r = _tmp$10;
+ size = _tmp$11;
+ return [r, size];
+ }
+ if (sz === 3) {
+ _tmp$12 = ((((((p0 & 15) >>> 0) >> 0)) << 12 >> 0) | (((((b1 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((b2 & 63) >>> 0) >> 0));
+ _tmp$13 = 3;
+ r = _tmp$12;
+ size = _tmp$13;
+ return [r, size];
+ }
+ b3 = (3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3]);
+ if (b3 < 128 || 191 < b3) {
+ _tmp$14 = 65533;
+ _tmp$15 = 1;
+ r = _tmp$14;
+ size = _tmp$15;
+ return [r, size];
+ }
+ _tmp$16 = (((((((p0 & 7) >>> 0) >> 0)) << 18 >> 0) | (((((b1 & 63) >>> 0) >> 0)) << 12 >> 0)) | (((((b2 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((b3 & 63) >>> 0) >> 0));
+ _tmp$17 = 4;
+ r = _tmp$16;
+ size = _tmp$17;
+ return [r, size];
+ };
+ $pkg.DecodeRune = DecodeRune;
DecodeRuneInString = function(s) {
var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, mask, n, r, s, s0, s1, s2, s3, size, sz, x, x$1;
r = 0;
@@ -10945,6 +11396,47 @@ $packages["unicode/utf8"] = (function() {
return n;
};
$pkg.RuneCountInString = RuneCountInString;
+ ValidString = function(s) {
+ var accept, c, c$1, c$2, i, n, s, si, size, x, x$1;
+ n = s.length;
+ i = 0;
+ while (true) {
+ if (!(i < n)) { break; }
+ si = s.charCodeAt(i);
+ if (si < 128) {
+ i = i + (1) >> 0;
+ continue;
+ }
+ x = ((si < 0 || si >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[si]);
+ if (x === 241) {
+ return false;
+ }
+ size = ((((x & 7) >>> 0) >> 0));
+ if ((i + size >> 0) > n) {
+ return false;
+ }
+ accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange);
+ c = s.charCodeAt((i + 1 >> 0));
+ if (c < accept.lo || accept.hi < c) {
+ return false;
+ } else if (size === 2) {
+ } else {
+ c$1 = s.charCodeAt((i + 2 >> 0));
+ if (c$1 < 128 || 191 < c$1) {
+ return false;
+ } else if (size === 3) {
+ } else {
+ c$2 = s.charCodeAt((i + 3 >> 0));
+ if (c$2 < 128 || 191 < c$2) {
+ return false;
+ }
+ }
+ }
+ i = i + (size) >> 0;
+ }
+ return true;
+ };
+ $pkg.ValidString = ValidString;
ValidRune = function(r) {
var r;
if (0 <= r && r < 55296) {
@@ -10967,10 +11459,22 @@ $packages["unicode/utf8"] = (function() {
return $pkg;
})();
$packages["strconv"] = (function() {
- var $pkg = {}, $init, errors, math, utf8, decimal, leftCheat, extFloat, floatInfo, decimalSlice, sliceType$3, sliceType$4, sliceType$5, arrayType, sliceType$6, arrayType$1, arrayType$2, ptrType$1, arrayType$3, arrayType$4, ptrType$2, ptrType$3, ptrType$4, optimize, leftcheats, smallPowersOfTen, powersOfTen, uint64pow10, float32info, float32info$24ptr, float64info, float64info$24ptr, isPrint16, isNotPrint16, isPrint32, isNotPrint32, isGraphic, shifts, digitZero, trim, rightShift, prefixIsLessThan, leftShift, shouldRoundUp, frexp10Many, adjustLastDigitFixed, adjustLastDigit, AppendFloat, genericFtoa, bigFtoa, formatDigits, roundShortest, fmtE, fmtF, fmtB, min, max, FormatInt, Itoa, small, formatBits, appendQuotedWith, appendQuotedRuneWith, appendEscapedRune, AppendQuote, AppendQuoteToASCII, AppendQuoteRune, AppendQuoteRuneToASCII, CanBackquote, unhex, UnquoteChar, Unquote, contains, bsearch16, bsearch32, IsPrint, isInGraphicList;
+ var $pkg = {}, $init, errors, math, utf8, NumError, decimal, leftCheat, extFloat, floatInfo, decimalSlice, sliceType, sliceType$1, sliceType$2, sliceType$3, sliceType$4, sliceType$5, arrayType, sliceType$6, ptrType, arrayType$1, arrayType$2, ptrType$1, arrayType$3, arrayType$4, ptrType$2, ptrType$3, ptrType$4, optimize, powtab, float64pow10, float32pow10, leftcheats, smallPowersOfTen, powersOfTen, uint64pow10, float32info, float32info$24ptr, float64info, float64info$24ptr, isPrint16, isNotPrint16, isPrint32, isNotPrint32, isGraphic, shifts, ParseBool, equalIgnoreCase, special, readFloat, atof64exact, atof32exact, atof32, atof64, ParseFloat, syntaxError, rangeError, baseError, bitSizeError, ParseUint, ParseInt, Atoi, digitZero, trim, rightShift, prefixIsLessThan, leftShift, shouldRoundUp, frexp10Many, adjustLastDigitFixed, adjustLastDigit, AppendFloat, genericFtoa, bigFtoa, formatDigits, roundShortest, fmtE, fmtF, fmtB, min, max, FormatInt, Itoa, small, formatBits, quoteWith, appendQuotedWith, appendQuotedRuneWith, appendEscapedRune, Quote, AppendQuote, AppendQuoteToASCII, AppendQuoteRune, AppendQuoteRuneToASCII, CanBackquote, unhex, UnquoteChar, Unquote, contains, bsearch16, bsearch32, IsPrint, isInGraphicList;
errors = $packages["errors"];
math = $packages["math"];
utf8 = $packages["unicode/utf8"];
+ NumError = $pkg.NumError = $newType(0, $kindStruct, "strconv.NumError", true, "strconv", true, function(Func_, Num_, Err_) {
+ this.$val = this;
+ if (arguments.length === 0) {
+ this.Func = "";
+ this.Num = "";
+ this.Err = $ifaceNil;
+ return;
+ }
+ this.Func = Func_;
+ this.Num = Num_;
+ this.Err = Err_;
+ });
decimal = $pkg.decimal = $newType(0, $kindStruct, "strconv.decimal", true, "strconv", false, function(d_, nd_, dp_, neg_, trunc_) {
this.$val = this;
if (arguments.length === 0) {
@@ -11035,11 +11539,15 @@ $packages["strconv"] = (function() {
this.dp = dp_;
this.neg = neg_;
});
+ sliceType = $sliceType($Int);
+ sliceType$1 = $sliceType($Float64);
+ sliceType$2 = $sliceType($Float32);
sliceType$3 = $sliceType(leftCheat);
sliceType$4 = $sliceType($Uint16);
sliceType$5 = $sliceType($Uint32);
arrayType = $arrayType($Uint8, 800);
sliceType$6 = $sliceType($Uint8);
+ ptrType = $ptrType(NumError);
arrayType$1 = $arrayType($Uint8, 24);
arrayType$2 = $arrayType($Uint8, 32);
ptrType$1 = $ptrType(floatInfo);
@@ -11048,6 +11556,792 @@ $packages["strconv"] = (function() {
ptrType$2 = $ptrType(decimal);
ptrType$3 = $ptrType(decimalSlice);
ptrType$4 = $ptrType(extFloat);
+ ParseBool = function(str) {
+ var _1, str;
+ _1 = str;
+ if (_1 === ("1") || _1 === ("t") || _1 === ("T") || _1 === ("true") || _1 === ("TRUE") || _1 === ("True")) {
+ return [true, $ifaceNil];
+ } else if (_1 === ("0") || _1 === ("f") || _1 === ("F") || _1 === ("false") || _1 === ("FALSE") || _1 === ("False")) {
+ return [false, $ifaceNil];
+ }
+ return [false, syntaxError("ParseBool", str)];
+ };
+ $pkg.ParseBool = ParseBool;
+ equalIgnoreCase = function(s1, s2) {
+ var c1, c2, i, s1, s2;
+ if (!((s1.length === s2.length))) {
+ return false;
+ }
+ i = 0;
+ while (true) {
+ if (!(i < s1.length)) { break; }
+ c1 = s1.charCodeAt(i);
+ if (65 <= c1 && c1 <= 90) {
+ c1 = c1 + (32) << 24 >>> 24;
+ }
+ c2 = s2.charCodeAt(i);
+ if (65 <= c2 && c2 <= 90) {
+ c2 = c2 + (32) << 24 >>> 24;
+ }
+ if (!((c1 === c2))) {
+ return false;
+ }
+ i = i + (1) >> 0;
+ }
+ return true;
+ };
+ special = function(s) {
+ var _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, f, ok, s;
+ f = 0;
+ ok = false;
+ if (s.length === 0) {
+ return [f, ok];
+ }
+ _1 = s.charCodeAt(0);
+ if (_1 === (43)) {
+ if (equalIgnoreCase(s, "+inf") || equalIgnoreCase(s, "+infinity")) {
+ _tmp = math.Inf(1);
+ _tmp$1 = true;
+ f = _tmp;
+ ok = _tmp$1;
+ return [f, ok];
+ }
+ } else if (_1 === (45)) {
+ if (equalIgnoreCase(s, "-inf") || equalIgnoreCase(s, "-infinity")) {
+ _tmp$2 = math.Inf(-1);
+ _tmp$3 = true;
+ f = _tmp$2;
+ ok = _tmp$3;
+ return [f, ok];
+ }
+ } else if ((_1 === (110)) || (_1 === (78))) {
+ if (equalIgnoreCase(s, "nan")) {
+ _tmp$4 = math.NaN();
+ _tmp$5 = true;
+ f = _tmp$4;
+ ok = _tmp$5;
+ return [f, ok];
+ }
+ } else if ((_1 === (105)) || (_1 === (73))) {
+ if (equalIgnoreCase(s, "inf") || equalIgnoreCase(s, "infinity")) {
+ _tmp$6 = math.Inf(1);
+ _tmp$7 = true;
+ f = _tmp$6;
+ ok = _tmp$7;
+ return [f, ok];
+ }
+ } else {
+ return [f, ok];
+ }
+ return [f, ok];
+ };
+ decimal.ptr.prototype.set = function(s) {
+ var b, e, esign, i, ok, s, sawdigits, sawdot, x, x$1;
+ ok = false;
+ b = this;
+ i = 0;
+ b.neg = false;
+ b.trunc = false;
+ if (i >= s.length) {
+ return ok;
+ }
+ if ((s.charCodeAt(i) === 43)) {
+ i = i + (1) >> 0;
+ } else if ((s.charCodeAt(i) === 45)) {
+ b.neg = true;
+ i = i + (1) >> 0;
+ }
+ sawdot = false;
+ sawdigits = false;
+ while (true) {
+ if (!(i < s.length)) { break; }
+ if ((s.charCodeAt(i) === 46)) {
+ if (sawdot) {
+ return ok;
+ }
+ sawdot = true;
+ b.dp = b.nd;
+ i = i + (1) >> 0;
+ continue;
+ } else if (48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57) {
+ sawdigits = true;
+ if ((s.charCodeAt(i) === 48) && (b.nd === 0)) {
+ b.dp = b.dp - (1) >> 0;
+ i = i + (1) >> 0;
+ continue;
+ }
+ if (b.nd < 800) {
+ (x = b.d, x$1 = b.nd, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1] = s.charCodeAt(i)));
+ b.nd = b.nd + (1) >> 0;
+ } else if (!((s.charCodeAt(i) === 48))) {
+ b.trunc = true;
+ }
+ i = i + (1) >> 0;
+ continue;
+ }
+ break;
+ }
+ if (!sawdigits) {
+ return ok;
+ }
+ if (!sawdot) {
+ b.dp = b.nd;
+ }
+ if (i < s.length && ((s.charCodeAt(i) === 101) || (s.charCodeAt(i) === 69))) {
+ i = i + (1) >> 0;
+ if (i >= s.length) {
+ return ok;
+ }
+ esign = 1;
+ if (s.charCodeAt(i) === 43) {
+ i = i + (1) >> 0;
+ } else if (s.charCodeAt(i) === 45) {
+ i = i + (1) >> 0;
+ esign = -1;
+ }
+ if (i >= s.length || s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) {
+ return ok;
+ }
+ e = 0;
+ while (true) {
+ if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; }
+ if (e < 10000) {
+ e = (($imul(e, 10)) + ((s.charCodeAt(i) >> 0)) >> 0) - 48 >> 0;
+ }
+ i = i + (1) >> 0;
+ }
+ b.dp = b.dp + (($imul(e, esign))) >> 0;
+ }
+ if (!((i === s.length))) {
+ return ok;
+ }
+ ok = true;
+ return ok;
+ };
+ decimal.prototype.set = function(s) { return this.$val.set(s); };
+ readFloat = function(s) {
+ var _1, c, dp, e, esign, exp, i, mantissa, nd, ndMant, neg, ok, s, sawdigits, sawdot, trunc, x;
+ mantissa = new $Uint64(0, 0);
+ exp = 0;
+ neg = false;
+ trunc = false;
+ ok = false;
+ i = 0;
+ if (i >= s.length) {
+ return [mantissa, exp, neg, trunc, ok];
+ }
+ if ((s.charCodeAt(i) === 43)) {
+ i = i + (1) >> 0;
+ } else if ((s.charCodeAt(i) === 45)) {
+ neg = true;
+ i = i + (1) >> 0;
+ }
+ sawdot = false;
+ sawdigits = false;
+ nd = 0;
+ ndMant = 0;
+ dp = 0;
+ while (true) {
+ if (!(i < s.length)) { break; }
+ c = s.charCodeAt(i);
+ _1 = true;
+ if (_1 === ((c === 46))) {
+ if (sawdot) {
+ return [mantissa, exp, neg, trunc, ok];
+ }
+ sawdot = true;
+ dp = nd;
+ i = i + (1) >> 0;
+ continue;
+ } else if (_1 === (48 <= c && c <= 57)) {
+ sawdigits = true;
+ if ((c === 48) && (nd === 0)) {
+ dp = dp - (1) >> 0;
+ i = i + (1) >> 0;
+ continue;
+ }
+ nd = nd + (1) >> 0;
+ if (ndMant < 19) {
+ mantissa = $mul64(mantissa, (new $Uint64(0, 10)));
+ mantissa = (x = (new $Uint64(0, (c - 48 << 24 >>> 24))), new $Uint64(mantissa.$high + x.$high, mantissa.$low + x.$low));
+ ndMant = ndMant + (1) >> 0;
+ } else if (!((s.charCodeAt(i) === 48))) {
+ trunc = true;
+ }
+ i = i + (1) >> 0;
+ continue;
+ }
+ break;
+ }
+ if (!sawdigits) {
+ return [mantissa, exp, neg, trunc, ok];
+ }
+ if (!sawdot) {
+ dp = nd;
+ }
+ if (i < s.length && ((s.charCodeAt(i) === 101) || (s.charCodeAt(i) === 69))) {
+ i = i + (1) >> 0;
+ if (i >= s.length) {
+ return [mantissa, exp, neg, trunc, ok];
+ }
+ esign = 1;
+ if (s.charCodeAt(i) === 43) {
+ i = i + (1) >> 0;
+ } else if (s.charCodeAt(i) === 45) {
+ i = i + (1) >> 0;
+ esign = -1;
+ }
+ if (i >= s.length || s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) {
+ return [mantissa, exp, neg, trunc, ok];
+ }
+ e = 0;
+ while (true) {
+ if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; }
+ if (e < 10000) {
+ e = (($imul(e, 10)) + ((s.charCodeAt(i) >> 0)) >> 0) - 48 >> 0;
+ }
+ i = i + (1) >> 0;
+ }
+ dp = dp + (($imul(e, esign))) >> 0;
+ }
+ if (!((i === s.length))) {
+ return [mantissa, exp, neg, trunc, ok];
+ }
+ if (!((mantissa.$high === 0 && mantissa.$low === 0))) {
+ exp = dp - ndMant >> 0;
+ }
+ ok = true;
+ return [mantissa, exp, neg, trunc, ok];
+ };
+ decimal.ptr.prototype.floatBits = function(flt) {
+ var _tmp, _tmp$1, b, bits, d, exp, flt, mant, n, n$1, n$2, overflow, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, y, y$1, y$2, y$3, $s;
+ /* */ $s = 0; s: while (true) { switch ($s) { case 0:
+ b = new $Uint64(0, 0);
+ overflow = false;
+ d = this;
+ exp = 0;
+ mant = new $Uint64(0, 0);
+ /* */ if (d.nd === 0) { $s = 1; continue; }
+ /* */ $s = 2; continue;
+ /* if (d.nd === 0) { */ case 1:
+ mant = new $Uint64(0, 0);
+ exp = flt.bias;
+ /* goto out */ $s = 3; continue;
+ /* } */ case 2:
+ /* */ if (d.dp > 310) { $s = 4; continue; }
+ /* */ $s = 5; continue;
+ /* if (d.dp > 310) { */ case 4:
+ /* goto overflow */ $s = 6; continue;
+ /* } */ case 5:
+ /* */ if (d.dp < -330) { $s = 7; continue; }
+ /* */ $s = 8; continue;
+ /* if (d.dp < -330) { */ case 7:
+ mant = new $Uint64(0, 0);
+ exp = flt.bias;
+ /* goto out */ $s = 3; continue;
+ /* } */ case 8:
+ exp = 0;
+ while (true) {
+ if (!(d.dp > 0)) { break; }
+ n = 0;
+ if (d.dp >= powtab.$length) {
+ n = 27;
+ } else {
+ n = (x = d.dp, ((x < 0 || x >= powtab.$length) ? ($throwRuntimeError("index out of range"), undefined) : powtab.$array[powtab.$offset + x]));
+ }
+ d.Shift(-n);
+ exp = exp + (n) >> 0;
+ }
+ while (true) {
+ if (!(d.dp < 0 || (d.dp === 0) && d.d[0] < 53)) { break; }
+ n$1 = 0;
+ if (-d.dp >= powtab.$length) {
+ n$1 = 27;
+ } else {
+ n$1 = (x$1 = -d.dp, ((x$1 < 0 || x$1 >= powtab.$length) ? ($throwRuntimeError("index out of range"), undefined) : powtab.$array[powtab.$offset + x$1]));
+ }
+ d.Shift(n$1);
+ exp = exp - (n$1) >> 0;
+ }
+ exp = exp - (1) >> 0;
+ if (exp < (flt.bias + 1 >> 0)) {
+ n$2 = (flt.bias + 1 >> 0) - exp >> 0;
+ d.Shift(-n$2);
+ exp = exp + (n$2) >> 0;
+ }
+ /* */ if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { $s = 9; continue; }
+ /* */ $s = 10; continue;
+ /* if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { */ case 9:
+ /* goto overflow */ $s = 6; continue;
+ /* } */ case 10:
+ d.Shift((((1 + flt.mantbits >>> 0) >> 0)));
+ mant = d.RoundedInteger();
+ /* */ if ((x$2 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) { $s = 11; continue; }
+ /* */ $s = 12; continue;
+ /* if ((x$2 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) { */ case 11:
+ mant = $shiftRightUint64(mant, (1));
+ exp = exp + (1) >> 0;
+ /* */ if ((exp - flt.bias >> 0) >= (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0)) { $s = 13; continue; }
+ /* */ $s = 14; continue;
+ /* if ((exp - flt.bias >> 0) >= (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0)) { */ case 13:
+ /* goto overflow */ $s = 6; continue;
+ /* } */ case 14:
+ /* } */ case 12:
+ if ((x$3 = (x$4 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high & x$4.$high, (mant.$low & x$4.$low) >>> 0)), (x$3.$high === 0 && x$3.$low === 0))) {
+ exp = flt.bias;
+ }
+ /* goto out */ $s = 3; continue;
+ /* overflow: */ case 6:
+ mant = new $Uint64(0, 0);
+ exp = (((y$2 = flt.expbits, y$2 < 32 ? (1 << y$2) : 0) >> 0) - 1 >> 0) + flt.bias >> 0;
+ overflow = true;
+ /* out: */ case 3:
+ bits = (x$5 = (x$6 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$6.$high - 0, x$6.$low - 1)), new $Uint64(mant.$high & x$5.$high, (mant.$low & x$5.$low) >>> 0));
+ bits = (x$7 = $shiftLeft64((new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$3 = flt.expbits, y$3 < 32 ? (1 << y$3) : 0) >> 0) - 1 >> 0))))), flt.mantbits), new $Uint64(bits.$high | x$7.$high, (bits.$low | x$7.$low) >>> 0));
+ if (d.neg) {
+ bits = (x$8 = $shiftLeft64($shiftLeft64(new $Uint64(0, 1), flt.mantbits), flt.expbits), new $Uint64(bits.$high | x$8.$high, (bits.$low | x$8.$low) >>> 0));
+ }
+ _tmp = bits;
+ _tmp$1 = overflow;
+ b = _tmp;
+ overflow = _tmp$1;
+ $s = -1; return [b, overflow];
+ /* */ } return; }
+ };
+ decimal.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); };
+ atof64exact = function(mantissa, exp, neg) {
+ var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, exp, f, mantissa, neg, ok, x, x$1, x$2;
+ f = 0;
+ ok = false;
+ if (!((x = $shiftRightUint64(mantissa, float64info.mantbits), (x.$high === 0 && x.$low === 0)))) {
+ return [f, ok];
+ }
+ f = ($flatten64(mantissa));
+ if (neg) {
+ f = -f;
+ }
+ if ((exp === 0)) {
+ _tmp = f;
+ _tmp$1 = true;
+ f = _tmp;
+ ok = _tmp$1;
+ return [f, ok];
+ } else if (exp > 0 && exp <= 37) {
+ if (exp > 22) {
+ f = f * ((x$1 = exp - 22 >> 0, ((x$1 < 0 || x$1 >= float64pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float64pow10.$array[float64pow10.$offset + x$1])));
+ exp = 22;
+ }
+ if (f > 1e+15 || f < -1e+15) {
+ return [f, ok];
+ }
+ _tmp$2 = f * ((exp < 0 || exp >= float64pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float64pow10.$array[float64pow10.$offset + exp]);
+ _tmp$3 = true;
+ f = _tmp$2;
+ ok = _tmp$3;
+ return [f, ok];
+ } else if (exp < 0 && exp >= -22) {
+ _tmp$4 = f / (x$2 = -exp, ((x$2 < 0 || x$2 >= float64pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float64pow10.$array[float64pow10.$offset + x$2]));
+ _tmp$5 = true;
+ f = _tmp$4;
+ ok = _tmp$5;
+ return [f, ok];
+ }
+ return [f, ok];
+ };
+ atof32exact = function(mantissa, exp, neg) {
+ var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, exp, f, mantissa, neg, ok, x, x$1, x$2;
+ f = 0;
+ ok = false;
+ if (!((x = $shiftRightUint64(mantissa, float32info.mantbits), (x.$high === 0 && x.$low === 0)))) {
+ return [f, ok];
+ }
+ f = ($flatten64(mantissa));
+ if (neg) {
+ f = -f;
+ }
+ if ((exp === 0)) {
+ _tmp = f;
+ _tmp$1 = true;
+ f = _tmp;
+ ok = _tmp$1;
+ return [f, ok];
+ } else if (exp > 0 && exp <= 17) {
+ if (exp > 10) {
+ f = $fround(f * ((x$1 = exp - 10 >> 0, ((x$1 < 0 || x$1 >= float32pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float32pow10.$array[float32pow10.$offset + x$1]))));
+ exp = 10;
+ }
+ if (f > 1e+07 || f < -1e+07) {
+ return [f, ok];
+ }
+ _tmp$2 = $fround(f * ((exp < 0 || exp >= float32pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float32pow10.$array[float32pow10.$offset + exp]));
+ _tmp$3 = true;
+ f = _tmp$2;
+ ok = _tmp$3;
+ return [f, ok];
+ } else if (exp < 0 && exp >= -10) {
+ _tmp$4 = $fround(f / (x$2 = -exp, ((x$2 < 0 || x$2 >= float32pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float32pow10.$array[float32pow10.$offset + x$2])));
+ _tmp$5 = true;
+ f = _tmp$4;
+ ok = _tmp$5;
+ return [f, ok];
+ }
+ return [f, ok];
+ };
+ atof32 = function(s) {
+ var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, b$1, d, err, exp, ext, f, f$1, mantissa, neg, ok, ok$1, ok$2, ok$3, ovf, ovf$1, s, trunc, val;
+ f = 0;
+ err = $ifaceNil;
+ _tuple = special(s);
+ val = _tuple[0];
+ ok = _tuple[1];
+ if (ok) {
+ _tmp = ($fround(val));
+ _tmp$1 = $ifaceNil;
+ f = _tmp;
+ err = _tmp$1;
+ return [f, err];
+ }
+ if (optimize) {
+ _tuple$1 = readFloat(s);
+ mantissa = _tuple$1[0];
+ exp = _tuple$1[1];
+ neg = _tuple$1[2];
+ trunc = _tuple$1[3];
+ ok$1 = _tuple$1[4];
+ if (ok$1) {
+ if (!trunc) {
+ _tuple$2 = atof32exact(mantissa, exp, neg);
+ f$1 = _tuple$2[0];
+ ok$2 = _tuple$2[1];
+ if (ok$2) {
+ _tmp$2 = f$1;
+ _tmp$3 = $ifaceNil;
+ f = _tmp$2;
+ err = _tmp$3;
+ return [f, err];
+ }
+ }
+ ext = new extFloat.ptr(new $Uint64(0, 0), 0, false);
+ ok$3 = ext.AssignDecimal(mantissa, exp, neg, trunc, float32info);
+ if (ok$3) {
+ _tuple$3 = ext.floatBits(float32info);
+ b = _tuple$3[0];
+ ovf = _tuple$3[1];
+ f = math.Float32frombits(((b.$low >>> 0)));
+ if (ovf) {
+ err = rangeError("ParseFloat", s);
+ }
+ _tmp$4 = f;
+ _tmp$5 = err;
+ f = _tmp$4;
+ err = _tmp$5;
+ return [f, err];
+ }
+ }
+ }
+ d = new decimal.ptr(arrayType.zero(), 0, 0, false, false);
+ if (!d.set(s)) {
+ _tmp$6 = 0;
+ _tmp$7 = syntaxError("ParseFloat", s);
+ f = _tmp$6;
+ err = _tmp$7;
+ return [f, err];
+ }
+ _tuple$4 = d.floatBits(float32info);
+ b$1 = _tuple$4[0];
+ ovf$1 = _tuple$4[1];
+ f = math.Float32frombits(((b$1.$low >>> 0)));
+ if (ovf$1) {
+ err = rangeError("ParseFloat", s);
+ }
+ _tmp$8 = f;
+ _tmp$9 = err;
+ f = _tmp$8;
+ err = _tmp$9;
+ return [f, err];
+ };
+ atof64 = function(s) {
+ var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, b$1, d, err, exp, ext, f, f$1, mantissa, neg, ok, ok$1, ok$2, ok$3, ovf, ovf$1, s, trunc, val;
+ f = 0;
+ err = $ifaceNil;
+ _tuple = special(s);
+ val = _tuple[0];
+ ok = _tuple[1];
+ if (ok) {
+ _tmp = val;
+ _tmp$1 = $ifaceNil;
+ f = _tmp;
+ err = _tmp$1;
+ return [f, err];
+ }
+ if (optimize) {
+ _tuple$1 = readFloat(s);
+ mantissa = _tuple$1[0];
+ exp = _tuple$1[1];
+ neg = _tuple$1[2];
+ trunc = _tuple$1[3];
+ ok$1 = _tuple$1[4];
+ if (ok$1) {
+ if (!trunc) {
+ _tuple$2 = atof64exact(mantissa, exp, neg);
+ f$1 = _tuple$2[0];
+ ok$2 = _tuple$2[1];
+ if (ok$2) {
+ _tmp$2 = f$1;
+ _tmp$3 = $ifaceNil;
+ f = _tmp$2;
+ err = _tmp$3;
+ return [f, err];
+ }
+ }
+ ext = new extFloat.ptr(new $Uint64(0, 0), 0, false);
+ ok$3 = ext.AssignDecimal(mantissa, exp, neg, trunc, float64info);
+ if (ok$3) {
+ _tuple$3 = ext.floatBits(float64info);
+ b = _tuple$3[0];
+ ovf = _tuple$3[1];
+ f = math.Float64frombits(b);
+ if (ovf) {
+ err = rangeError("ParseFloat", s);
+ }
+ _tmp$4 = f;
+ _tmp$5 = err;
+ f = _tmp$4;
+ err = _tmp$5;
+ return [f, err];
+ }
+ }
+ }
+ d = new decimal.ptr(arrayType.zero(), 0, 0, false, false);
+ if (!d.set(s)) {
+ _tmp$6 = 0;
+ _tmp$7 = syntaxError("ParseFloat", s);
+ f = _tmp$6;
+ err = _tmp$7;
+ return [f, err];
+ }
+ _tuple$4 = d.floatBits(float64info);
+ b$1 = _tuple$4[0];
+ ovf$1 = _tuple$4[1];
+ f = math.Float64frombits(b$1);
+ if (ovf$1) {
+ err = rangeError("ParseFloat", s);
+ }
+ _tmp$8 = f;
+ _tmp$9 = err;
+ f = _tmp$8;
+ err = _tmp$9;
+ return [f, err];
+ };
+ ParseFloat = function(s, bitSize) {
+ var _tuple, bitSize, err, f, s;
+ if (bitSize === 32) {
+ _tuple = atof32(s);
+ f = _tuple[0];
+ err = _tuple[1];
+ return [(f), err];
+ }
+ return atof64(s);
+ };
+ $pkg.ParseFloat = ParseFloat;
+ NumError.ptr.prototype.Error = function() {
+ var _r, e, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ e = this;
+ _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ $s = -1; return "strconv." + e.Func + ": " + "parsing " + Quote(e.Num) + ": " + _r;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: NumError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ NumError.prototype.Error = function() { return this.$val.Error(); };
+ syntaxError = function(fn, str) {
+ var fn, str;
+ return new NumError.ptr(fn, str, $pkg.ErrSyntax);
+ };
+ rangeError = function(fn, str) {
+ var fn, str;
+ return new NumError.ptr(fn, str, $pkg.ErrRange);
+ };
+ baseError = function(fn, str, base) {
+ var base, fn, str;
+ return new NumError.ptr(fn, str, errors.New("invalid base " + Itoa(base)));
+ };
+ bitSizeError = function(fn, str, bitSize) {
+ var bitSize, fn, str;
+ return new NumError.ptr(fn, str, errors.New("invalid bit size " + Itoa(bitSize)));
+ };
+ ParseUint = function(s, base, bitSize) {
+ var _1, _i, _ref, base, bitSize, c, cutoff, d, maxVal, n, n1, s, s0, x, x$1, x$2;
+ if (s.length === 0) {
+ return [new $Uint64(0, 0), syntaxError("ParseUint", s)];
+ }
+ s0 = s;
+ if (2 <= base && base <= 36) {
+ } else if ((base === 0)) {
+ if ((s.charCodeAt(0) === 48) && s.length > 1 && ((s.charCodeAt(1) === 120) || (s.charCodeAt(1) === 88))) {
+ if (s.length < 3) {
+ return [new $Uint64(0, 0), syntaxError("ParseUint", s0)];
+ }
+ base = 16;
+ s = $substring(s, 2);
+ } else if ((s.charCodeAt(0) === 48)) {
+ base = 8;
+ s = $substring(s, 1);
+ } else {
+ base = 10;
+ }
+ } else {
+ return [new $Uint64(0, 0), baseError("ParseUint", s0, base)];
+ }
+ if (bitSize === 0) {
+ bitSize = 32;
+ } else if (bitSize < 0 || bitSize > 64) {
+ return [new $Uint64(0, 0), bitSizeError("ParseUint", s0, bitSize)];
+ }
+ cutoff = new $Uint64(0, 0);
+ _1 = base;
+ if (_1 === (10)) {
+ cutoff = new $Uint64(429496729, 2576980378);
+ } else if (_1 === (16)) {
+ cutoff = new $Uint64(268435456, 0);
+ } else {
+ cutoff = (x = $div64(new $Uint64(4294967295, 4294967295), (new $Uint64(0, base)), false), new $Uint64(x.$high + 0, x.$low + 1));
+ }
+ maxVal = (x$1 = $shiftLeft64(new $Uint64(0, 1), ((bitSize >>> 0))), new $Uint64(x$1.$high - 0, x$1.$low - 1));
+ n = new $Uint64(0, 0);
+ _ref = (new sliceType$6($stringToBytes(s)));
+ _i = 0;
+ while (true) {
+ if (!(_i < _ref.$length)) { break; }
+ c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]);
+ d = 0;
+ if (48 <= c && c <= 57) {
+ d = c - 48 << 24 >>> 24;
+ } else if (97 <= c && c <= 122) {
+ d = (c - 97 << 24 >>> 24) + 10 << 24 >>> 24;
+ } else if (65 <= c && c <= 90) {
+ d = (c - 65 << 24 >>> 24) + 10 << 24 >>> 24;
+ } else {
+ return [new $Uint64(0, 0), syntaxError("ParseUint", s0)];
+ }
+ if (d >= ((base << 24 >>> 24))) {
+ return [new $Uint64(0, 0), syntaxError("ParseUint", s0)];
+ }
+ if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) {
+ return [maxVal, rangeError("ParseUint", s0)];
+ }
+ n = $mul64(n, ((new $Uint64(0, base))));
+ n1 = (x$2 = (new $Uint64(0, d)), new $Uint64(n.$high + x$2.$high, n.$low + x$2.$low));
+ if ((n1.$high < n.$high || (n1.$high === n.$high && n1.$low < n.$low)) || (n1.$high > maxVal.$high || (n1.$high === maxVal.$high && n1.$low > maxVal.$low))) {
+ return [maxVal, rangeError("ParseUint", s0)];
+ }
+ n = n1;
+ _i++;
+ }
+ return [n, $ifaceNil];
+ };
+ $pkg.ParseUint = ParseUint;
+ ParseInt = function(s, base, bitSize) {
+ var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, base, bitSize, cutoff, err, i, n, neg, s, s0, un, x, x$1;
+ i = new $Int64(0, 0);
+ err = $ifaceNil;
+ if (s.length === 0) {
+ _tmp = new $Int64(0, 0);
+ _tmp$1 = syntaxError("ParseInt", s);
+ i = _tmp;
+ err = _tmp$1;
+ return [i, err];
+ }
+ s0 = s;
+ neg = false;
+ if (s.charCodeAt(0) === 43) {
+ s = $substring(s, 1);
+ } else if (s.charCodeAt(0) === 45) {
+ neg = true;
+ s = $substring(s, 1);
+ }
+ un = new $Uint64(0, 0);
+ _tuple = ParseUint(s, base, bitSize);
+ un = _tuple[0];
+ err = _tuple[1];
+ if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual($assertType(err, ptrType).Err, $pkg.ErrRange))) {
+ $assertType(err, ptrType).Func = "ParseInt";
+ $assertType(err, ptrType).Num = s0;
+ _tmp$2 = new $Int64(0, 0);
+ _tmp$3 = err;
+ i = _tmp$2;
+ err = _tmp$3;
+ return [i, err];
+ }
+ if (bitSize === 0) {
+ bitSize = 32;
+ }
+ cutoff = ($shiftLeft64(new $Uint64(0, 1), (((bitSize - 1 >> 0) >>> 0))));
+ if (!neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low >= cutoff.$low))) {
+ _tmp$4 = ((x = new $Uint64(cutoff.$high - 0, cutoff.$low - 1), new $Int64(x.$high, x.$low)));
+ _tmp$5 = rangeError("ParseInt", s0);
+ i = _tmp$4;
+ err = _tmp$5;
+ return [i, err];
+ }
+ if (neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low > cutoff.$low))) {
+ _tmp$6 = (x$1 = (new $Int64(cutoff.$high, cutoff.$low)), new $Int64(-x$1.$high, -x$1.$low));
+ _tmp$7 = rangeError("ParseInt", s0);
+ i = _tmp$6;
+ err = _tmp$7;
+ return [i, err];
+ }
+ n = (new $Int64(un.$high, un.$low));
+ if (neg) {
+ n = new $Int64(-n.$high, -n.$low);
+ }
+ _tmp$8 = n;
+ _tmp$9 = $ifaceNil;
+ i = _tmp$8;
+ err = _tmp$9;
+ return [i, err];
+ };
+ $pkg.ParseInt = ParseInt;
+ Atoi = function(s) {
+ var _i, _ref, _tuple, _tuple$1, ch, err, i64, n, nerr, ok, s, s0, sLen;
+ sLen = s.length;
+ if (true && (0 < sLen && sLen < 10) || false && (0 < sLen && sLen < 19)) {
+ s0 = s;
+ if ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43)) {
+ s = $substring(s, 1);
+ if (s.length < 1) {
+ return [0, new NumError.ptr("Atoi", s0, $pkg.ErrSyntax)];
+ }
+ }
+ n = 0;
+ _ref = (new sliceType$6($stringToBytes(s)));
+ _i = 0;
+ while (true) {
+ if (!(_i < _ref.$length)) { break; }
+ ch = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]);
+ ch = ch - (48) << 24 >>> 24;
+ if (ch > 9) {
+ return [0, new NumError.ptr("Atoi", s0, $pkg.ErrSyntax)];
+ }
+ n = ($imul(n, 10)) + ((ch >> 0)) >> 0;
+ _i++;
+ }
+ if (s0.charCodeAt(0) === 45) {
+ n = -n;
+ }
+ return [n, $ifaceNil];
+ }
+ _tuple = ParseInt(s, 10, 0);
+ i64 = _tuple[0];
+ err = _tuple[1];
+ _tuple$1 = $assertType(err, ptrType, true);
+ nerr = _tuple$1[0];
+ ok = _tuple$1[1];
+ if (ok) {
+ nerr.Func = "Atoi";
+ }
+ return [(((i64.$low + ((i64.$high >> 31) * 4294967296)) >> 0)), err];
+ };
+ $pkg.Atoi = Atoi;
decimal.ptr.prototype.String = function() {
var a, buf, n, w;
a = this;
@@ -11340,6 +12634,41 @@ $packages["strconv"] = (function() {
return n;
};
decimal.prototype.RoundedInteger = function() { return this.$val.RoundedInteger(); };
+ extFloat.ptr.prototype.floatBits = function(flt) {
+ var bits, exp, f, flt, mant, n, overflow, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, y$1, y$2;
+ bits = new $Uint64(0, 0);
+ overflow = false;
+ f = this;
+ f.Normalize();
+ exp = f.exp + 63 >> 0;
+ if (exp < (flt.bias + 1 >> 0)) {
+ n = (flt.bias + 1 >> 0) - exp >> 0;
+ f.mant = $shiftRightUint64(f.mant, (((n >>> 0))));
+ exp = exp + (n) >> 0;
+ }
+ mant = $shiftRightUint64(f.mant, ((63 - flt.mantbits >>> 0)));
+ if (!((x = (x$1 = f.mant, x$2 = $shiftLeft64(new $Uint64(0, 1), ((62 - flt.mantbits >>> 0))), new $Uint64(x$1.$high & x$2.$high, (x$1.$low & x$2.$low) >>> 0)), (x.$high === 0 && x.$low === 0)))) {
+ mant = (x$3 = new $Uint64(0, 1), new $Uint64(mant.$high + x$3.$high, mant.$low + x$3.$low));
+ }
+ if ((x$4 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$4.$high && mant.$low === x$4.$low))) {
+ mant = $shiftRightUint64(mant, (1));
+ exp = exp + (1) >> 0;
+ }
+ if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) {
+ mant = new $Uint64(0, 0);
+ exp = (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0) + flt.bias >> 0;
+ overflow = true;
+ } else if ((x$5 = (x$6 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high & x$6.$high, (mant.$low & x$6.$low) >>> 0)), (x$5.$high === 0 && x$5.$low === 0))) {
+ exp = flt.bias;
+ }
+ bits = (x$7 = (x$8 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$8.$high - 0, x$8.$low - 1)), new $Uint64(mant.$high & x$7.$high, (mant.$low & x$7.$low) >>> 0));
+ bits = (x$9 = $shiftLeft64((new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$2 = flt.expbits, y$2 < 32 ? (1 << y$2) : 0) >> 0) - 1 >> 0))))), flt.mantbits), new $Uint64(bits.$high | x$9.$high, (bits.$low | x$9.$low) >>> 0));
+ if (f.neg) {
+ bits = (x$10 = $shiftLeft64(new $Uint64(0, 1), ((flt.mantbits + flt.expbits >>> 0))), new $Uint64(bits.$high | x$10.$high, (bits.$low | x$10.$low) >>> 0));
+ }
+ return [bits, overflow];
+ };
+ extFloat.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); };
extFloat.ptr.prototype.AssignComputeBounds = function(mant, exp, neg, flt) {
var _tmp, _tmp$1, exp, expBiased, f, flt, lower, mant, neg, upper, x, x$1, x$2, x$3, x$4;
lower = new extFloat.ptr(new $Uint64(0, 0), 0, false);
@@ -12200,6 +13529,10 @@ $packages["strconv"] = (function() {
s = ($bytesToString($subslice(new sliceType$6(a), i)));
return [d, s];
};
+ quoteWith = function(s, quote, ASCIIonly, graphicOnly) {
+ var ASCIIonly, _q, graphicOnly, quote, s;
+ return ($bytesToString(appendQuotedWith($makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))), s, quote, ASCIIonly, graphicOnly)));
+ };
appendQuotedWith = function(buf, s, quote, ASCIIonly, graphicOnly) {
var ASCIIonly, _tuple, buf, graphicOnly, quote, r, s, width;
buf = $append(buf, quote);
@@ -12303,6 +13636,11 @@ $packages["strconv"] = (function() {
}
return buf;
};
+ Quote = function(s) {
+ var s;
+ return quoteWith(s, 34, false, false);
+ };
+ $pkg.Quote = Quote;
AppendQuote = function(dst, s) {
var dst, s;
return appendQuotedWith(dst, s, 34, false, false);
@@ -12680,8 +14018,10 @@ $packages["strconv"] = (function() {
i = bsearch16(isGraphic, rr);
return i < isGraphic.$length && (rr === ((i < 0 || i >= isGraphic.$length) ? ($throwRuntimeError("index out of range"), undefined) : isGraphic.$array[isGraphic.$offset + i]));
};
+ ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}];
ptrType$2.methods = [{prop: "set", name: "set", pkg: "strconv", typ: $funcType([$String], [$Bool], false)}, {prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Assign", name: "Assign", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "Shift", name: "Shift", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundDown", name: "RoundDown", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundUp", name: "RoundUp", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundedInteger", name: "RoundedInteger", pkg: "", typ: $funcType([], [$Uint64], false)}];
ptrType$4.methods = [{prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "AssignComputeBounds", name: "AssignComputeBounds", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, ptrType$1], [extFloat, extFloat], false)}, {prop: "Normalize", name: "Normalize", pkg: "", typ: $funcType([], [$Uint], false)}, {prop: "Multiply", name: "Multiply", pkg: "", typ: $funcType([extFloat], [], false)}, {prop: "AssignDecimal", name: "AssignDecimal", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, $Bool, ptrType$1], [$Bool], false)}, {prop: "frexp10", name: "frexp10", pkg: "strconv", typ: $funcType([], [$Int, $Int], false)}, {prop: "FixedDecimal", name: "FixedDecimal", pkg: "", typ: $funcType([ptrType$3, $Int], [$Bool], false)}, {prop: "ShortestDecimal", name: "ShortestDecimal", pkg: "", typ: $funcType([ptrType$3, ptrType$4, ptrType$4], [$Bool], false)}];
+ NumError.init("", [{prop: "Func", name: "Func", anonymous: false, exported: true, typ: $String, tag: ""}, {prop: "Num", name: "Num", anonymous: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", anonymous: false, exported: true, typ: $error, tag: ""}]);
decimal.init("strconv", [{prop: "d", name: "d", anonymous: false, exported: false, typ: arrayType, tag: ""}, {prop: "nd", name: "nd", anonymous: false, exported: false, typ: $Int, tag: ""}, {prop: "dp", name: "dp", anonymous: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", anonymous: false, exported: false, typ: $Bool, tag: ""}, {prop: "trunc", name: "trunc", anonymous: false, exported: false, typ: $Bool, tag: ""}]);
leftCheat.init("strconv", [{prop: "delta", name: "delta", anonymous: false, exported: false, typ: $Int, tag: ""}, {prop: "cutoff", name: "cutoff", anonymous: false, exported: false, typ: $String, tag: ""}]);
extFloat.init("strconv", [{prop: "mant", name: "mant", anonymous: false, exported: false, typ: $Uint64, tag: ""}, {prop: "exp", name: "exp", anonymous: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", anonymous: false, exported: false, typ: $Bool, tag: ""}]);
@@ -12694,6 +14034,9 @@ $packages["strconv"] = (function() {
$r = math.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
$r = utf8.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
optimize = true;
+ powtab = new sliceType([1, 3, 6, 9, 13, 16, 19, 23, 26]);
+ float64pow10 = new sliceType$1([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, 1e+21, 1e+22]);
+ float32pow10 = new sliceType$2([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10]);
$pkg.ErrRange = errors.New("value out of range");
$pkg.ErrSyntax = errors.New("invalid syntax");
leftcheats = new sliceType$3([new leftCheat.ptr(0, ""), new leftCheat.ptr(1, "5"), new leftCheat.ptr(1, "25"), new leftCheat.ptr(1, "125"), new leftCheat.ptr(2, "625"), new leftCheat.ptr(2, "3125"), new leftCheat.ptr(2, "15625"), new leftCheat.ptr(3, "78125"), new leftCheat.ptr(3, "390625"), new leftCheat.ptr(3, "1953125"), new leftCheat.ptr(4, "9765625"), new leftCheat.ptr(4, "48828125"), new leftCheat.ptr(4, "244140625"), new leftCheat.ptr(4, "1220703125"), new leftCheat.ptr(5, "6103515625"), new leftCheat.ptr(5, "30517578125"), new leftCheat.ptr(5, "152587890625"), new leftCheat.ptr(6, "762939453125"), new leftCheat.ptr(6, "3814697265625"), new leftCheat.ptr(6, "19073486328125"), new leftCheat.ptr(7, "95367431640625"), new leftCheat.ptr(7, "476837158203125"), new leftCheat.ptr(7, "2384185791015625"), new leftCheat.ptr(7, "11920928955078125"), new leftCheat.ptr(8, "59604644775390625"), new leftCheat.ptr(8, "298023223876953125"), new leftCheat.ptr(8, "1490116119384765625"), new leftCheat.ptr(9, "7450580596923828125"), new leftCheat.ptr(9, "37252902984619140625"), new leftCheat.ptr(9, "186264514923095703125"), new leftCheat.ptr(10, "931322574615478515625"), new leftCheat.ptr(10, "4656612873077392578125"), new leftCheat.ptr(10, "23283064365386962890625"), new leftCheat.ptr(10, "116415321826934814453125"), new leftCheat.ptr(11, "582076609134674072265625"), new leftCheat.ptr(11, "2910383045673370361328125"), new leftCheat.ptr(11, "14551915228366851806640625"), new leftCheat.ptr(12, "72759576141834259033203125"), new leftCheat.ptr(12, "363797880709171295166015625"), new leftCheat.ptr(12, "1818989403545856475830078125"), new leftCheat.ptr(13, "9094947017729282379150390625"), new leftCheat.ptr(13, "45474735088646411895751953125"), new leftCheat.ptr(13, "227373675443232059478759765625"), new leftCheat.ptr(13, "1136868377216160297393798828125"), new leftCheat.ptr(14, "5684341886080801486968994140625"), new leftCheat.ptr(14, "28421709430404007434844970703125"), new leftCheat.ptr(14, "142108547152020037174224853515625"), new leftCheat.ptr(15, "710542735760100185871124267578125"), new leftCheat.ptr(15, "3552713678800500929355621337890625"), new leftCheat.ptr(15, "17763568394002504646778106689453125"), new leftCheat.ptr(16, "88817841970012523233890533447265625"), new leftCheat.ptr(16, "444089209850062616169452667236328125"), new leftCheat.ptr(16, "2220446049250313080847263336181640625"), new leftCheat.ptr(16, "11102230246251565404236316680908203125"), new leftCheat.ptr(17, "55511151231257827021181583404541015625"), new leftCheat.ptr(17, "277555756156289135105907917022705078125"), new leftCheat.ptr(17, "1387778780781445675529539585113525390625"), new leftCheat.ptr(18, "6938893903907228377647697925567626953125"), new leftCheat.ptr(18, "34694469519536141888238489627838134765625"), new leftCheat.ptr(18, "173472347597680709441192448139190673828125"), new leftCheat.ptr(19, "867361737988403547205962240695953369140625")]);
@@ -12724,7 +14067,7 @@ $packages["unicode"] = (function() {
return $pkg;
})();
$packages["reflect"] = (function() {
- var $pkg = {}, $init, errors, js, math, runtime, strconv, sync, unicode, utf8, uncommonType, funcType, name, nameData, mapIter, Type, Kind, tflag, rtype, typeAlg, method, ChanDir, arrayType, chanType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, Method, nameOff, typeOff, textOff, StructField, StructTag, fieldScan, Value, flag, ValueError, sliceType$1, ptrType$1, sliceType$2, sliceType$3, ptrType$2, funcType$1, sliceType$4, ptrType$3, ptrType$4, sliceType$5, sliceType$6, sliceType$7, ptrType$5, ptrType$6, structType$3, sliceType$8, sliceType$9, sliceType$10, sliceType$11, ptrType$7, ptrType$8, sliceType$13, sliceType$14, ptrType$9, sliceType$15, ptrType$15, sliceType$17, ptrType$16, funcType$3, funcType$4, funcType$5, ptrType$17, arrayType$12, ptrType$18, initialized, uncommonTypeMap, nameMap, nameOffList, typeOffList, callHelper, jsObjectPtr, selectHelper, kindNames, methodCache, uint8Type, init, jsType, reflectType, setKindType, newName, newNameOff, newTypeOff, internalStr, isWrapped, copyStruct, makeValue, MakeSlice, TypeOf, ValueOf, FuncOf, SliceOf, Zero, unsafe_New, makeInt, typedmemmove, keyFor, mapaccess, mapassign, mapdelete, mapiterinit, mapiterkey, mapiternext, maplen, cvtDirect, methodReceiver, valueInterface, ifaceE2I, methodName, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, chanrecv, chansend, PtrTo, implements$1, directlyAssignable, haveIdenticalType, haveIdenticalUnderlyingType, toType, ifaceIndir, overflowFloat32, New, convertOp, makeFloat, makeComplex, makeString, makeBytes, makeRunes, cvtInt, cvtUint, cvtFloatInt, cvtFloatUint, cvtIntFloat, cvtUintFloat, cvtFloat, cvtComplex, cvtIntString, cvtUintString, cvtBytesString, cvtStringBytes, cvtRunesString, cvtStringRunes, cvtT2I, cvtI2I;
+ var $pkg = {}, $init, errors, js, math, runtime, strconv, sync, unicode, utf8, uncommonType, funcType, name, nameData, mapIter, Type, Kind, tflag, rtype, typeAlg, method, ChanDir, arrayType, chanType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, Method, nameOff, typeOff, textOff, StructField, StructTag, fieldScan, Value, flag, ValueError, sliceType$1, ptrType$1, sliceType$2, sliceType$3, ptrType$2, funcType$1, sliceType$4, ptrType$3, ptrType$4, sliceType$5, sliceType$6, sliceType$7, ptrType$5, ptrType$6, structType$3, sliceType$8, sliceType$9, sliceType$10, sliceType$11, ptrType$7, ptrType$8, sliceType$13, sliceType$14, ptrType$9, sliceType$15, ptrType$15, sliceType$17, ptrType$16, funcType$3, funcType$4, funcType$5, ptrType$17, arrayType$12, ptrType$18, initialized, uncommonTypeMap, nameMap, nameOffList, typeOffList, callHelper, jsObjectPtr, selectHelper, kindNames, methodCache, uint8Type, init, jsType, reflectType, setKindType, newName, newNameOff, newTypeOff, internalStr, isWrapped, copyStruct, makeValue, MakeSlice, TypeOf, ValueOf, FuncOf, SliceOf, Zero, unsafe_New, makeInt, typedmemmove, makemap, keyFor, mapaccess, mapassign, mapdelete, mapiterinit, mapiterkey, mapiternext, maplen, cvtDirect, Copy, methodReceiver, valueInterface, ifaceE2I, methodName, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, chanrecv, chansend, PtrTo, implements$1, directlyAssignable, haveIdenticalType, haveIdenticalUnderlyingType, toType, ifaceIndir, overflowFloat32, typesMustMatch, grow, Append, AppendSlice, MakeMap, MakeMapWithSize, Indirect, New, convertOp, makeFloat, makeComplex, makeString, makeBytes, makeRunes, cvtInt, cvtUint, cvtFloatInt, cvtFloatUint, cvtIntFloat, cvtUintFloat, cvtFloat, cvtComplex, cvtIntString, cvtUintString, cvtBytesString, cvtStringBytes, cvtRunesString, cvtStringRunes, cvtT2I, cvtI2I;
errors = $packages["errors"];
js = $packages["github.com/gopherjs/gopherjs/js"];
math = $packages["math"];
@@ -13499,6 +14842,12 @@ $packages["reflect"] = (function() {
var dst, src, t;
dst.$set(src.$get());
};
+ makemap = function(t, cap) {
+ var cap, m, t;
+ m = 0;
+ m = (new ($global.Object)());
+ return m;
+ };
keyFor = function(t, key) {
var k, key, kv, t;
kv = key;
@@ -13636,6 +14985,51 @@ $packages["reflect"] = (function() {
$s = -1; return new Value.ptr(_r$6, (val), (((new flag(v.flag).ro() | ((v.flag & 128) >>> 0)) >>> 0) | ((_r$7 >>> 0))) >>> 0);
/* */ } return; } if ($f === undefined) { $f = { $blk: cvtDirect }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f.k = k; $f.slice = slice; $f.srcVal = srcVal; $f.typ = typ; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f;
};
+ Copy = function(dst, src) {
+ var _r, _v, dk, dst, dstVal, sk, src, srcVal, stringCopy, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _v = $f._v; dk = $f.dk; dst = $f.dst; dstVal = $f.dstVal; sk = $f.sk; src = $f.src; srcVal = $f.srcVal; stringCopy = $f.stringCopy; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ dk = new flag(dst.flag).kind();
+ if (!((dk === 17)) && !((dk === 23))) {
+ $panic(new ValueError.ptr("reflect.Copy", dk));
+ }
+ if (dk === 17) {
+ new flag(dst.flag).mustBeAssignable();
+ }
+ new flag(dst.flag).mustBeExported();
+ sk = new flag(src.flag).kind();
+ stringCopy = false;
+ /* */ if (!((sk === 17)) && !((sk === 23))) { $s = 1; continue; }
+ /* */ $s = 2; continue;
+ /* if (!((sk === 17)) && !((sk === 23))) { */ case 1:
+ if (!(sk === 24)) { _v = false; $s = 3; continue s; }
+ _r = dst.typ.Elem().Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ _v = _r === 8; case 3:
+ stringCopy = _v;
+ if (!stringCopy) {
+ $panic(new ValueError.ptr("reflect.Copy", sk));
+ }
+ /* } */ case 2:
+ new flag(src.flag).mustBeExported();
+ /* */ if (!stringCopy) { $s = 5; continue; }
+ /* */ $s = 6; continue;
+ /* if (!stringCopy) { */ case 5:
+ $r = typesMustMatch("reflect.Copy", dst.typ.Elem(), src.typ.Elem()); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ /* } */ case 6:
+ dstVal = $clone(dst, Value).object();
+ if (dk === 17) {
+ dstVal = new (jsType(SliceOf(dst.typ.Elem())))(dstVal);
+ }
+ srcVal = $clone(src, Value).object();
+ if (sk === 17) {
+ srcVal = new (jsType(SliceOf(src.typ.Elem())))(srcVal);
+ }
+ if (stringCopy) {
+ $s = -1; return $parseInt($copyString(dstVal, srcVal)) >> 0;
+ }
+ $s = -1; return $parseInt($copySlice(dstVal, srcVal)) >> 0;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: Copy }; } $f._r = _r; $f._v = _v; $f.dk = dk; $f.dst = dst; $f.dstVal = dstVal; $f.sk = sk; $f.src = src; $f.srcVal = srcVal; $f.stringCopy = stringCopy; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.Copy = Copy;
methodReceiver = function(op, v, i) {
var _$38, _r, fn, i, m, m$1, ms, op, prop, rcvr, t, tt, v, x, $s, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _$38 = $f._$38; _r = $f._r; fn = $f.fn; i = $f.i; m = $f.m; m$1 = $f.m$1; ms = $f.ms; op = $f.op; prop = $f.prop; rcvr = $f.rcvr; t = $f.t; tt = $f.tt; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -16487,6 +17881,138 @@ $packages["reflect"] = (function() {
return (v.ptr);
};
Value.prototype.UnsafeAddr = function() { return this.$val.UnsafeAddr(); };
+ typesMustMatch = function(what, t1, t2) {
+ var _r, _r$1, t1, t2, what, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; t1 = $f.t1; t2 = $f.t2; what = $f.what; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ /* */ if (!($interfaceIsEqual(t1, t2))) { $s = 1; continue; }
+ /* */ $s = 2; continue;
+ /* if (!($interfaceIsEqual(t1, t2))) { */ case 1:
+ _r = t1.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ _r$1 = t2.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
+ $panic(new $String(what + ": " + _r + " != " + _r$1));
+ /* } */ case 2:
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: typesMustMatch }; } $f._r = _r; $f._r$1 = _r$1; $f.t1 = t1; $f.t2 = t2; $f.what = what; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ grow = function(s, extra) {
+ var _q, _r, _r$1, _r$2, _r$3, extra, i0, i1, m, s, t, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; extra = $f.extra; i0 = $f.i0; i1 = $f.i1; m = $f.m; s = $f.s; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ i0 = $clone(s, Value).Len();
+ i1 = i0 + extra >> 0;
+ if (i1 < i0) {
+ $panic(new $String("reflect.Append: slice overflow"));
+ }
+ m = $clone(s, Value).Cap();
+ /* */ if (i1 <= m) { $s = 1; continue; }
+ /* */ $s = 2; continue;
+ /* if (i1 <= m) { */ case 1:
+ _r = $clone(s, Value).Slice(0, i1); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ $s = -1; return [_r, i0, i1];
+ /* } */ case 2:
+ if (m === 0) {
+ m = extra;
+ } else {
+ while (true) {
+ if (!(m < i1)) { break; }
+ if (i0 < 1024) {
+ m = m + (m) >> 0;
+ } else {
+ m = m + ((_q = m / 4, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))) >> 0;
+ }
+ }
+ }
+ _r$1 = $clone(s, Value).Type(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
+ _r$2 = MakeSlice(_r$1, i1, m); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
+ t = _r$2;
+ _r$3 = Copy($clone(t, Value), $clone(s, Value)); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
+ _r$3;
+ $s = -1; return [t, i0, i1];
+ /* */ } return; } if ($f === undefined) { $f = { $blk: grow }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.extra = extra; $f.i0 = i0; $f.i1 = i1; $f.m = m; $f.s = s; $f.t = t; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ Append = function(s, x) {
+ var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, i, i0, i1, j, s, x, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; i = $f.i; i0 = $f.i0; i1 = $f.i1; j = $f.j; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ new flag(s.flag).mustBe(23);
+ _r = grow($clone(s, Value), x.$length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ _tuple = _r;
+ s = _tuple[0];
+ i0 = _tuple[1];
+ i1 = _tuple[2];
+ _tmp = i0;
+ _tmp$1 = 0;
+ i = _tmp;
+ j = _tmp$1;
+ /* while (true) { */ case 2:
+ /* if (!(i < i1)) { break; } */ if(!(i < i1)) { $s = 3; continue; }
+ _r$1 = $clone(s, Value).Index(i); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
+ $r = $clone(_r$1, Value).Set($clone(((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j]), Value)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ _tmp$2 = i + 1 >> 0;
+ _tmp$3 = j + 1 >> 0;
+ i = _tmp$2;
+ j = _tmp$3;
+ /* } */ $s = 2; continue; case 3:
+ $s = -1; return s;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: Append }; } $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.i = i; $f.i0 = i0; $f.i1 = i1; $f.j = j; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.Append = Append;
+ AppendSlice = function(s, t) {
+ var _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, i0, i1, s, t, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; i0 = $f.i0; i1 = $f.i1; s = $f.s; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ new flag(s.flag).mustBe(23);
+ new flag(t.flag).mustBe(23);
+ _r = $clone(s, Value).Type(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ _r$1 = _r.Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
+ _arg = _r$1;
+ _r$2 = $clone(t, Value).Type(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
+ _r$3 = _r$2.Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
+ _arg$1 = _r$3;
+ $r = typesMustMatch("reflect.AppendSlice", _arg, _arg$1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ _r$4 = grow($clone(s, Value), $clone(t, Value).Len()); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
+ _tuple = _r$4;
+ s = _tuple[0];
+ i0 = _tuple[1];
+ i1 = _tuple[2];
+ _r$5 = $clone(s, Value).Slice(i0, i1); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
+ _r$6 = Copy($clone(_r$5, Value), $clone(t, Value)); /* */ $s = 8; case 8: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; }
+ _r$6;
+ $s = -1; return s;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: AppendSlice }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f.i0 = i0; $f.i1 = i1; $f.s = s; $f.t = t; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.AppendSlice = AppendSlice;
+ MakeMap = function(typ) {
+ var _r, typ, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ _r = MakeMapWithSize(typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ $s = -1; return _r;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: MakeMap }; } $f._r = _r; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.MakeMap = MakeMap;
+ MakeMapWithSize = function(typ, n) {
+ var _r, _r$1, m, n, typ, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; m = $f.m; n = $f.n; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ _r = typ.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ /* */ if (!((_r === 21))) { $s = 1; continue; }
+ /* */ $s = 2; continue;
+ /* if (!((_r === 21))) { */ case 1:
+ $panic(new $String("reflect.MakeMapWithSize of non-map type"));
+ /* } */ case 2:
+ m = makemap($assertType(typ, ptrType$1), n);
+ _r$1 = typ.common(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
+ $s = -1; return new Value.ptr(_r$1, m, 21);
+ /* */ } return; } if ($f === undefined) { $f = { $blk: MakeMapWithSize }; } $f._r = _r; $f._r$1 = _r$1; $f.m = m; $f.n = n; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.MakeMapWithSize = MakeMapWithSize;
+ Indirect = function(v) {
+ var _r, v, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ if (!(($clone(v, Value).Kind() === 22))) {
+ $s = -1; return v;
+ }
+ _r = $clone(v, Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ $s = -1; return _r;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: Indirect }; } $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.Indirect = Indirect;
New = function(typ) {
var _r, _r$1, fl, ptr, typ, $s, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; fl = $f.fl; ptr = $f.ptr; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -16913,7 +18439,7 @@ $packages["reflect"] = (function() {
return $pkg;
})();
$packages["fmt"] = (function() {
- var $pkg = {}, $init, errors, io, math, os, reflect, strconv, sync, utf8, fmtFlags, fmt, State, Formatter, Stringer, GoStringer, buffer, pp, scanError, ss, ssave, sliceType, ptrType, ptrType$1, arrayType, arrayType$1, sliceType$1, sliceType$2, arrayType$2, ptrType$2, ptrType$5, ptrType$25, funcType, ppFree, space, ssFree, complexError, boolError, newPrinter, Fprintf, Printf, Sprintf, Errorf, Fprintln, Println, getField, tooLarge, parsenum, intFromArg, parseArgNumber, isSpace, notSpace, indexRune;
+ var $pkg = {}, $init, errors, io, math, os, reflect, strconv, sync, utf8, fmtFlags, fmt, State, Formatter, Stringer, GoStringer, buffer, pp, scanError, ss, ssave, sliceType, ptrType, ptrType$1, arrayType, arrayType$1, sliceType$1, sliceType$2, arrayType$2, ptrType$2, ptrType$5, ptrType$25, funcType, ppFree, space, ssFree, complexError, boolError, newPrinter, Fprintf, Printf, Sprintf, Errorf, Fprint, Print, Sprint, Fprintln, Println, Sprintln, getField, tooLarge, parsenum, intFromArg, parseArgNumber, isSpace, notSpace, indexRune;
errors = $packages["errors"];
io = $packages["io"];
math = $packages["math"];
@@ -17663,6 +19189,48 @@ $packages["fmt"] = (function() {
/* */ } return; } if ($f === undefined) { $f = { $blk: Errorf }; } $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.format = format; $f.$s = $s; $f.$r = $r; return $f;
};
$pkg.Errorf = Errorf;
+ Fprint = function(w, a) {
+ var _r, _r$1, _tuple, a, err, n, p, w, x, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ n = 0;
+ err = $ifaceNil;
+ _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ p = _r;
+ $r = p.doPrint(a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ _r$1 = w.Write((x = p.buf, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
+ _tuple = _r$1;
+ n = _tuple[0];
+ err = _tuple[1];
+ p.free();
+ $s = -1; return [n, err];
+ /* */ } return; } if ($f === undefined) { $f = { $blk: Fprint }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.Fprint = Fprint;
+ Print = function(a) {
+ var _r, _tuple, a, err, n, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ n = 0;
+ err = $ifaceNil;
+ _r = Fprint(os.Stdout, a); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ _tuple = _r;
+ n = _tuple[0];
+ err = _tuple[1];
+ $s = -1; return [n, err];
+ /* */ } return; } if ($f === undefined) { $f = { $blk: Print }; } $f._r = _r; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.Print = Print;
+ Sprint = function(a) {
+ var _r, a, p, s, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ p = _r;
+ $r = p.doPrint(a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ s = ($bytesToString(p.buf));
+ p.free();
+ $s = -1; return s;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: Sprint }; } $f._r = _r; $f.a = a; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.Sprint = Sprint;
Fprintln = function(w, a) {
var _r, _r$1, _tuple, a, err, n, p, w, x, $s, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -17693,6 +19261,18 @@ $packages["fmt"] = (function() {
/* */ } return; } if ($f === undefined) { $f = { $blk: Println }; } $f._r = _r; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f;
};
$pkg.Println = Println;
+ Sprintln = function(a) {
+ var _r, a, p, s, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ p = _r;
+ $r = p.doPrintln(a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ s = ($bytesToString(p.buf));
+ p.free();
+ $s = -1; return s;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: Sprintln }; } $f._r = _r; $f.a = a; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.Sprintln = Sprintln;
getField = function(v, i) {
var _r, _r$1, i, v, val, $s, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; i = $f.i; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -19026,6 +20606,32 @@ $packages["fmt"] = (function() {
/* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrintf }; } $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f.a = a; $f.afterIndex = afterIndex; $f.arg = arg; $f.argNum = argNum; $f.c = c; $f.end = end; $f.format = format; $f.i = i; $f.i$1 = i$1; $f.lasti = lasti; $f.p = p; $f.size = size; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f;
};
pp.prototype.doPrintf = function(format, a) { return this.$val.doPrintf(format, a); };
+ pp.ptr.prototype.doPrint = function(a) {
+ var _i, _r, _ref, _v, a, arg, argNum, isString, p, prevString, $s, $r;
+ /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _v = $f._v; a = $f.a; arg = $f.arg; argNum = $f.argNum; isString = $f.isString; p = $f.p; prevString = $f.prevString; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ p = this;
+ prevString = false;
+ _ref = a;
+ _i = 0;
+ /* while (true) { */ case 1:
+ /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; }
+ argNum = _i;
+ arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]);
+ if (!(!($interfaceIsEqual(arg, $ifaceNil)))) { _v = false; $s = 3; continue s; }
+ _r = reflect.TypeOf(arg).Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
+ _v = _r === 24; case 3:
+ isString = _v;
+ if (argNum > 0 && !isString && !prevString) {
+ (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32);
+ }
+ $r = p.printArg(arg, 118); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ prevString = isString;
+ _i++;
+ /* } */ $s = 1; continue; case 2:
+ $s = -1; return;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrint }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._v = _v; $f.a = a; $f.arg = arg; $f.argNum = argNum; $f.isString = isString; $f.p = p; $f.prevString = prevString; $f.$s = $s; $f.$r = $r; return $f;
+ };
+ pp.prototype.doPrint = function(a) { return this.$val.doPrint(a); };
pp.ptr.prototype.doPrintln = function(a) {
var _i, _ref, a, arg, argNum, p, $s, $r;
/* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; a = $f.a; arg = $f.arg; argNum = $f.argNum; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -19948,13 +21554,110 @@ $packages["github.com/johanbrandhorst/protobuf/vendor/golang.org/x/net/context"]
return $pkg;
})();
$packages["strings"] = (function() {
- var $pkg = {}, $init, errors, js, io, unicode, utf8, sliceType, Join, HasSuffix, TrimSuffix;
+ var $pkg = {}, $init, errors, js, io, unicode, utf8, sliceType, sliceType$3, Index, LastIndex, Count, explode, Contains, genSplit, Split, Join, HasPrefix, HasSuffix, TrimSuffix;
errors = $packages["errors"];
js = $packages["github.com/gopherjs/gopherjs/js"];
io = $packages["io"];
unicode = $packages["unicode"];
utf8 = $packages["unicode/utf8"];
sliceType = $sliceType($Uint8);
+ sliceType$3 = $sliceType($String);
+ Index = function(s, sep) {
+ var s, sep;
+ return $parseInt(s.indexOf(sep)) >> 0;
+ };
+ $pkg.Index = Index;
+ LastIndex = function(s, sep) {
+ var s, sep;
+ return $parseInt(s.lastIndexOf(sep)) >> 0;
+ };
+ $pkg.LastIndex = LastIndex;
+ Count = function(s, sep) {
+ var n, pos, s, sep;
+ n = 0;
+ if ((sep.length === 0)) {
+ return utf8.RuneCountInString(s) + 1 >> 0;
+ } else if (sep.length > s.length) {
+ return 0;
+ } else if ((sep.length === s.length)) {
+ if (sep === s) {
+ return 1;
+ }
+ return 0;
+ }
+ while (true) {
+ pos = Index(s, sep);
+ if (pos === -1) {
+ break;
+ }
+ n = n + (1) >> 0;
+ s = $substring(s, (pos + sep.length >> 0));
+ }
+ return n;
+ };
+ $pkg.Count = Count;
+ explode = function(s, n) {
+ var _tuple, a, ch, i, l, n, s, size, x;
+ l = utf8.RuneCountInString(s);
+ if (n < 0 || n > l) {
+ n = l;
+ }
+ a = $makeSlice(sliceType$3, n);
+ i = 0;
+ while (true) {
+ if (!(i < (n - 1 >> 0))) { break; }
+ _tuple = utf8.DecodeRuneInString(s);
+ ch = _tuple[0];
+ size = _tuple[1];
+ ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, size));
+ s = $substring(s, size);
+ if (ch === 65533) {
+ ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = "\xEF\xBF\xBD");
+ }
+ i = i + (1) >> 0;
+ }
+ if (n > 0) {
+ (x = n - 1 >> 0, ((x < 0 || x >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + x] = s));
+ }
+ return a;
+ };
+ Contains = function(s, substr) {
+ var s, substr;
+ return Index(s, substr) >= 0;
+ };
+ $pkg.Contains = Contains;
+ genSplit = function(s, sep, sepSave, n) {
+ var a, i, m, n, s, sep, sepSave;
+ if (n === 0) {
+ return sliceType$3.nil;
+ }
+ if (sep === "") {
+ return explode(s, n);
+ }
+ if (n < 0) {
+ n = Count(s, sep) + 1 >> 0;
+ }
+ a = $makeSlice(sliceType$3, n);
+ n = n - (1) >> 0;
+ i = 0;
+ while (true) {
+ if (!(i < n)) { break; }
+ m = Index(s, sep);
+ if (m < 0) {
+ break;
+ }
+ ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, (m + sepSave >> 0)));
+ s = $substring(s, (m + sep.length >> 0));
+ i = i + (1) >> 0;
+ }
+ ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = s);
+ return $subslice(a, 0, (i + 1 >> 0));
+ };
+ Split = function(s, sep) {
+ var s, sep;
+ return genSplit(s, sep, 0, -1);
+ };
+ $pkg.Split = Split;
Join = function(a, sep) {
var _1, _i, _ref, a, b, bp, i, n, s, sep;
_1 = a.$length;
@@ -19988,6 +21691,11 @@ $packages["strings"] = (function() {
return ($bytesToString(b));
};
$pkg.Join = Join;
+ HasPrefix = function(s, prefix) {
+ var prefix, s;
+ return s.length >= prefix.length && $substring(s, 0, prefix.length) === prefix;
+ };
+ $pkg.HasPrefix = HasPrefix;
HasSuffix = function(s, suffix) {
var s, suffix;
return s.length >= suffix.length && $substring(s, (s.length - suffix.length >> 0)) === suffix;
@@ -25735,12 +27443,1225 @@ $packages["../proto/gopherjs"] = (function() {
$pkg.$init = $init;
return $pkg;
})();
+$packages["github.com/oskca/gopherjs-dom"] = (function() {
+ var $pkg = {}, $init, js;
+ js = $packages["github.com/gopherjs/gopherjs/js"];
+ $init = function() {
+ $pkg.$init = function() {};
+ /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.$init = $init;
+ return $pkg;
+})();
+$packages["github.com/oskca/gopherjs-json"] = (function() {
+ var $pkg = {}, $init, js, json, Stringify, Parse;
+ js = $packages["github.com/gopherjs/gopherjs/js"];
+ Stringify = function(obj) {
+ var obj;
+ return $internalize(json.stringify($externalize(obj, $emptyInterface)), $String);
+ };
+ $pkg.Stringify = Stringify;
+ Parse = function(jsonStr) {
+ var jsonStr;
+ return json.parse($externalize(jsonStr, $String));
+ };
+ $pkg.Parse = Parse;
+ $init = function() {
+ $pkg.$init = function() {};
+ /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
+ $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
+ json = $global.JSON;
+ /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
+ };
+ $pkg.$init = $init;
+ return $pkg;
+})();
+ (function() {
+/*!
+ * Vue.js v2.1.10
+ * (c) 2014-2017 Evan You
+ * Released under the MIT License.
+ */
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";function e(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function t(e){var t=parseFloat(e);return isNaN(t)?e:t}function n(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i
-1)return e.splice(n,1)}}function i(e,t){return ii.call(e,t)}function o(e){return"string"==typeof e||"number"==typeof e}function a(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}function s(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function c(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function u(e,t){for(var n in t)e[n]=t[n];return e}function l(e){return null!==e&&"object"==typeof e}function f(e){return li.call(e)===fi}function p(e){for(var t={},n=0;n1?c(n):n;for(var r=c(arguments,1),i=0,o=n.length;i=0&&Gi[n].id>e.id;)n--;Gi.splice(Math.max(n,eo)+1,0,e)}else Gi.push(e);Qi||(Qi=!0,Ai(xe))}}function Ae(e){ro.clear(),Oe(e,ro)}function Oe(e,t){var n,r,i=Array.isArray(e);if((i||l(e))&&Object.isExtensible(e)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)Oe(e[n],t);else for(r=Object.keys(e),n=r.length;n--;)Oe(e[r[n]],t)}}function Se(e){e._watchers=[];var t=e.$options;t.props&&Te(e,t.props),t.methods&&Ne(e,t.methods),t.data?Ee(e):k(e._data={},!0),t.computed&&Ie(e,t.computed),t.watch&&Le(e,t.watch)}function Te(e,t){var n=e.$options.propsData||{},r=e.$options._propKeys=Object.keys(t),i=!e.$parent;Mi.shouldConvert=i;for(var o=function(i){var o=r[i];A(e,o,P(o,t,n,e))},a=0;a-1:e.test(t)}function We(e,t){for(var n in e){var r=e[n];if(r){var i=Ke(r.componentOptions);i&&!t(i)&&(Ze(r),e[n]=null)}}}function Ze(e){e&&(e.componentInstance._inactive||we(e.componentInstance,"deactivated"),e.componentInstance.$destroy())}function Ge(e){var t={};t.get=function(){return vi},Object.defineProperty(e,"config",t),e.util=Fi,e.set=O,e.delete=S,e.nextTick=Ai,e.options=Object.create(null),vi._assetTypes.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,u(e.options.components,co),Be(e),ze(e),Ve(e),Je(e)}function Ye(e){for(var t=e.data,n=e,r=e;r.componentInstance;)r=r.componentInstance._vnode,r.data&&(t=Qe(r.data,t));for(;n=n.parent;)n.data&&(t=Qe(t,n.data));return Xe(t)}function Qe(e,t){return{staticClass:et(e.staticClass,t.staticClass),class:e.class?[e.class,t.class]:t.class}}function Xe(e){var t=e.class,n=e.staticClass;return n||t?et(n,tt(t)):""}function et(e,t){return e?t?e+" "+t:e:t||""}function tt(e){var t="";if(!e)return t;if("string"==typeof e)return e;if(Array.isArray(e)){for(var n,r=0,i=e.length;r-1?ko[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:ko[e]=/HTMLUnknownElement/.test(t.toString())}function it(e){if("string"==typeof e){if(e=document.querySelector(e),!e)return document.createElement("div")}return e}function ot(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&"multiple"in t.data.attrs&&n.setAttribute("multiple","multiple"),n)}function at(e,t){return document.createElementNS(bo[e],t)}function st(e){return document.createTextNode(e)}function ct(e){return document.createComment(e)}function ut(e,t,n){e.insertBefore(t,n)}function lt(e,t){e.removeChild(t)}function ft(e,t){e.appendChild(t)}function pt(e){return e.parentNode}function dt(e){return e.nextSibling}function vt(e){return e.tagName}function ht(e,t){e.textContent=t}function mt(e,t,n){e.setAttribute(t,n)}function gt(e,t){var n=e.data.ref;if(n){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[n])?r(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])&&a[n].indexOf(o)<0?a[n].push(o):a[n]=[o]:a[n]=o}}function yt(e){return null==e}function _t(e){return null!=e}function bt(e,t){return e.key===t.key&&e.tag===t.tag&&e.isComment===t.isComment&&!e.data==!t.data}function $t(e,t,n){var r,i,o={};for(r=t;r<=n;++r)i=e[r].key,_t(i)&&(o[i]=r);return o}function wt(e){function t(e){return new Hi(O.tagName(e).toLowerCase(),{},[],void 0,e)}function r(e,t){function n(){0===--n.listeners&&i(e)}return n.listeners=t,n}function i(e){var t=O.parentNode(e);t&&O.removeChild(t,e)}function a(e,t,n,r,i){if(e.isRootInsert=!i,!s(e,t,n,r)){var o=e.data,a=e.children,c=e.tag;_t(c)?(e.elm=e.ns?O.createElementNS(e.ns,c):O.createElement(c,e),v(e),f(e,a,t),_t(o)&&d(e,t),l(n,e.elm,r)):e.isComment?(e.elm=O.createComment(e.text),l(n,e.elm,r)):(e.elm=O.createTextNode(e.text),l(n,e.elm,r))}}function s(e,t,n,r){var i=e.data;if(_t(i)){var o=_t(e.componentInstance)&&i.keepAlive;if(_t(i=i.hook)&&_t(i=i.init)&&i(e,!1,n,r),_t(e.componentInstance))return c(e,t),o&&u(e,t,n,r),!0}}function c(e,t){e.data.pendingInsert&&t.push.apply(t,e.data.pendingInsert),e.elm=e.componentInstance.$el,p(e)?(d(e,t),v(e)):(gt(e),t.push(e))}function u(e,t,n,r){for(var i,o=e;o.componentInstance;)if(o=o.componentInstance._vnode,_t(i=o.data)&&_t(i=i.transition)){for(i=0;ip?(u=yt(n[m+1])?null:n[m+1].elm,h(e,u,n,f,m,r)):f>m&&g(e,t,l,p)}function b(e,t,n,r){if(e!==t){if(t.isStatic&&e.isStatic&&t.key===e.key&&(t.isCloned||t.isOnce))return t.elm=e.elm,void(t.componentInstance=e.componentInstance);var i,o=t.data,a=_t(o);a&&_t(i=o.hook)&&_t(i=i.prepatch)&&i(e,t);var s=t.elm=e.elm,c=e.children,u=t.children;if(a&&p(t)){for(i=0;i-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+e.getAttribute("class")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function zt(e,t){if(t&&t.trim())if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t);else{for(var n=" "+e.getAttribute("class")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");e.setAttribute("class",n.trim())}}function Vt(e){Yo(function(){Yo(e)})}function Jt(e,t){(e._transitionClasses||(e._transitionClasses=[])).push(t),Bt(e,t)}function Kt(e,t){e._transitionClasses&&r(e._transitionClasses,t),zt(e,t)}function qt(e,t,n){var r=Wt(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Jo?Wo:Go,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=Jo,l=a,f=o.length):t===Ko?u>0&&(n=Ko,l=u,f=c.length):(l=Math.max(a,u),n=l>0?a>u?Jo:Ko:null,f=n?n===Jo?o.length:c.length:0);var p=n===Jo&&Qo.test(r[qo+"Property"]);return{type:n,timeout:l,propCount:f,hasTransform:p}}function Zt(e,t){for(;e.length1,j=n._enterCb=en(function(){E&&(Kt(n,k),Kt(n,x)),j.cancelled?(E&&Kt(n,C),T&&T(n)):S&&S(n),n._enterCb=null});e.data.show||ne(e.data.hook||(e.data.hook={}),"insert",function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),O&&O(n,j)},"transition-insert"),A&&A(n),E&&(Jt(n,C),Jt(n,x),Vt(function(){Jt(n,k),Kt(n,C),j.cancelled||I||qt(n,o,j)})),e.data.show&&(t&&t(),O&&O(n,j)),E||I||j()}}}function Qt(e,t){function n(){g.cancelled||(e.data.show||((r.parentNode._pending||(r.parentNode._pending={}))[e.key]=e),l&&l(r),h&&(Jt(r,s),Jt(r,u),Vt(function(){Jt(r,c),Kt(r,s),g.cancelled||m||qt(r,a,g)})),f&&f(r,g),h||m||g())}var r=e.elm;r._enterCb&&(r._enterCb.cancelled=!0,r._enterCb());var i=Xt(e.data.transition);if(!i)return t();if(!r._leaveCb&&1===r.nodeType){var o=i.css,a=i.type,s=i.leaveClass,c=i.leaveToClass,u=i.leaveActiveClass,l=i.beforeLeave,f=i.leave,p=i.afterLeave,d=i.leaveCancelled,v=i.delayLeave,h=o!==!1&&!bi,m=f&&(f._length||f.length)>1,g=r._leaveCb=en(function(){r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[e.key]=null),h&&(Kt(r,c),Kt(r,u)),g.cancelled?(h&&Kt(r,s),d&&d(r)):(t(),p&&p(r)),r._leaveCb=null});v?v(n):n()}}function Xt(e){if(e){if("object"==typeof e){var t={};return e.css!==!1&&u(t,Xo(e.name||"v")),u(t,e),t}return"string"==typeof e?Xo(e):void 0}}function en(e){var t=!1;return function(){t||(t=!0,e())}}function tn(e,t){t.data.show||Yt(t)}function nn(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s-1,a.selected!==o&&(a.selected=o);else if(h(on(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function rn(e,t){for(var n=0,r=t.length;n',n.innerHTML.indexOf(t)>0}function _n(e){return pa=pa||document.createElement("div"),pa.innerHTML=e,pa.textContent}function bn(e,t){return t&&(e=e.replace(os,"\n")),e.replace(rs,"<").replace(is,">").replace(as,"&").replace(ss,'"')}function $n(e,t){function n(t){f+=t,e=e.substring(t)}function r(){var t=e.match(Ca);if(t){var r={tagName:t[1],attrs:[],start:f};n(t[0].length);for(var i,o;!(i=e.match(xa))&&(o=e.match(ba));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=f,r}}function i(e){var n=e.tagName,r=e.unarySlash;u&&("p"===s&&ma(n)&&o(s),ha(n)&&s===n&&o(n));for(var i=l(n)||"html"===n&&"head"===s||!!r,a=e.attrs.length,f=new Array(a),p=0;p=0&&c[i].lowerCasedTag!==o;i--);else i=0;if(i>=0){for(var a=c.length-1;a>=i;a--)t.end&&t.end(c[a].tag,n,r);c.length=i,s=i&&c[i-1].tag}else"br"===o?t.start&&t.start(e,[],!0,n,r):"p"===o&&(t.start&&t.start(e,[],!1,n,r),t.end&&t.end(e,n,r))}for(var a,s,c=[],u=t.expectHTML,l=t.isUnaryTag||pi,f=0;e;){if(a=e,s&&ts(s)){var p=s.toLowerCase(),d=ns[p]||(ns[p]=new RegExp("([\\s\\S]*?)("+p+"[^>]*>)","i")),v=0,h=e.replace(d,function(e,n,r){return v=r.length,"script"!==p&&"style"!==p&&"noscript"!==p&&(n=n.replace(//g,"$1").replace(//g,"$1")),t.chars&&t.chars(n),""});f+=e.length-h.length,e=h,o(p,f-v,f)}else{var m=e.indexOf("<");if(0===m){if(Oa.test(e)){var g=e.indexOf("-->");if(g>=0){n(g+3);continue}}if(Sa.test(e)){var y=e.indexOf("]>");if(y>=0){n(y+2);continue}}var _=e.match(Aa);if(_){n(_[0].length);continue}var b=e.match(ka);if(b){var $=f;n(b[0].length),o(b[1],$,f);continue}var w=r();if(w){i(w);continue}}var C=void 0,x=void 0,k=void 0;if(m>0){for(x=e.slice(m);!(ka.test(x)||Ca.test(x)||Oa.test(x)||Sa.test(x)||(k=x.indexOf("<",1),k<0));)m+=k,x=e.slice(m);C=e.substring(0,m),n(m)}m<0&&(C=e,e=""),t.chars&&C&&t.chars(C)}if(e===a&&t.chars){t.chars(e);break}}o()}function wn(e){function t(){(a||(a=[])).push(e.slice(v,i).trim()),v=i+1}var n,r,i,o,a,s=!1,c=!1,u=!1,l=!1,f=0,p=0,d=0,v=0;for(i=0;i=0&&(m=e.charAt(h)," "===m);h--);m&&/[\w$]/.test(m)||(l=!0)}}else void 0===o?(v=i+1,o=e.slice(0,i).trim()):t();if(void 0===o?o=e.slice(0,i).trim():0!==v&&t(),a)for(i=0;ia&&o.push(JSON.stringify(e.slice(a,i)));var s=wn(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a=Ea}function Dn(e){return 34===e||39===e}function Pn(e){var t=1;for(La=Na;!Mn();)if(e=Ln(),Dn(e))Rn(e);else if(91===e&&t++,93===e&&t--,0===t){Ma=Na;break}}function Rn(e){for(var t=e;!Mn()&&(e=Ln(),e!==t););}function Fn(e,t){Da=t.warn||kn,Pa=t.getTagNamespace||pi,Ra=t.mustUseProp||pi,Fa=t.isPreTag||pi,Ha=An(t.modules,"preTransformNode"),Ua=An(t.modules,"transformNode"),Ba=An(t.modules,"postTransformNode"),za=t.delimiters;var n,r,i=[],o=t.preserveWhitespace!==!1,a=!1,s=!1;return $n(e,{expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,shouldDecodeNewlines:t.shouldDecodeNewlines,start:function(e,o,c){function u(e){}var l=r&&r.ns||Pa(e);_i&&"svg"===l&&(o=rr(o));var f={type:1,tag:e,attrsList:o,attrsMap:tr(o),parent:r,children:[]};l&&(f.ns=l),nr(f)&&!xi()&&(f.forbidden=!0);for(var p=0;p-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),En(e,"click","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+t+"=$$a.concat($$v))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+t+"=$$c}",null,!0)}function Jr(e,t,n){var r=n&&n.number,i=In(e,"value")||"null";i=r?"_n("+i+")":i,On(e,"checked","_q("+t+","+i+")"),En(e,"click",Wr(t,i),null,!0)}function Kr(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=o||_i&&"range"===r?"change":"input",u=!o&&"range"!==r,l="input"===e.tag||"textarea"===e.tag,f=l?"$event.target.value"+(s?".trim()":""):s?"(typeof $event === 'string' ? $event.trim() : $event)":"$event";f=a||"number"===r?"_n("+f+")":f;var p=Wr(t,f);l&&u&&(p="if($event.target.composing)return;"+p),On(e,"value",l?"_s("+t+")":"("+t+")"),En(e,c,p,null,!0),(s||a||"number"===r)&&En(e,"blur","$forceUpdate()")}function qr(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})"+(null==e.attrsMap.multiple?"[0]":""),o=Wr(t,i);En(e,"change",o,null,!0)}function Wr(e,t){var n=Nn(e);return null===n.idx?e+"="+t:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+e+"="+t+"}else{$$exp.splice($$idx, 1, "+t+")}"}function Zr(e,t){t.value&&On(e,"textContent","_s("+t.value+")")}function Gr(e,t){t.value&&On(e,"innerHTML","_s("+t.value+")")}function Yr(e,t){return t=t?u(u({},js),t):js,Rr(e,t)}function Qr(e,t,n){var r=(t&&t.warn||Si,t&&t.delimiters?String(t.delimiters)+e:e);if(Is[r])return Is[r];var i={},o=Yr(e,t);i.render=Xr(o.render);var a=o.staticRenderFns.length;i.staticRenderFns=new Array(a);for(var s=0;s0,$i=yi&&yi.indexOf("edge/")>0,wi=yi&&yi.indexOf("android")>0,Ci=yi&&/iphone|ipad|ipod|ios/.test(yi),xi=function(){return void 0===ti&&(ti=!gi&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),ti},ki=gi&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Ai=function(){function e(){r=!1;var e=n.slice(0);n.length=0;for(var t=0;t1&&(t[n[0].trim()]=n[1].trim())}}),t}),Ro=/^--/,Fo=/\s*!important$/,Ho=function(e,t,n){Ro.test(t)?e.style.setProperty(t,n):Fo.test(n)?e.style.setProperty(t,n.replace(Fo,""),"important"):e.style[Bo(t)]=n},Uo=["Webkit","Moz","ms"],Bo=a(function(e){if(lo=lo||document.createElement("div"),e=ai(e),"filter"!==e&&e in lo.style)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n\/=]+)/,ya=/(?:=)/,_a=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],ba=new RegExp("^\\s*"+ga.source+"(?:\\s*("+ya.source+")\\s*(?:"+_a.join("|")+"))?"),$a="[a-zA-Z_][\\w\\-\\.]*",wa="((?:"+$a+"\\:)?"+$a+")",Ca=new RegExp("^<"+wa),xa=/^\s*(\/?)>/,ka=new RegExp("^<\\/"+wa+"[^>]*>"),Aa=/^]+>/i,Oa=/^