// Generated by Haxe 3.4.2
(function ($global) { "use strict";
var $estr = function() { return js_Boot.__string_rec(this,''); };
function $extend(from, fields) {
function Inherit() {} Inherit.prototype = from; var proto = new Inherit();
for (var name in fields) proto[name] = fields[name];
if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString;
return proto;
}
var StringTools = function() { };
StringTools.__name__ = ["StringTools"];
StringTools.htmlEscape = function(s,quotes) {
s = s.split("&").join("&").split("<").join("<").split(">").join(">");
if(quotes) {
return s.split("\"").join(""").split("'").join("'");
} else {
return s;
}
};
StringTools.htmlUnescape = function(s) {
return s.split(">").join(">").split("<").join("<").split(""").join("\"").split("'").join("'").split("&").join("&");
};
StringTools.startsWith = function(s,start) {
if(s.length >= start.length) {
return HxOverrides.substr(s,0,start.length) == start;
} else {
return false;
}
};
StringTools.isSpace = function(s,pos) {
var c = HxOverrides.cca(s,pos);
if(!(c > 8 && c < 14)) {
return c == 32;
} else {
return true;
}
};
StringTools.ltrim = function(s) {
var l = s.length;
var r = 0;
while(r < l && StringTools.isSpace(s,r)) ++r;
if(r > 0) {
return HxOverrides.substr(s,r,l - r);
} else {
return s;
}
};
StringTools.rtrim = function(s) {
var l = s.length;
var r = 0;
while(r < l && StringTools.isSpace(s,l - r - 1)) ++r;
if(r > 0) {
return HxOverrides.substr(s,0,l - r);
} else {
return s;
}
};
StringTools.trim = function(s) {
return StringTools.ltrim(StringTools.rtrim(s));
};
StringTools.replace = function(s,sub,by) {
return s.split(sub).join(by);
};
StringTools.hex = function(n,digits) {
var s = "";
var hexChars = "0123456789ABCDEF";
while(true) {
s = hexChars.charAt(n & 15) + s;
n >>>= 4;
if(!(n > 0)) {
break;
}
}
if(digits != null) {
while(s.length < digits) s = "0" + s;
}
return s;
};
var HxOverrides = function() { };
HxOverrides.__name__ = ["HxOverrides"];
HxOverrides.cca = function(s,index) {
var x = s.charCodeAt(index);
if(x != x) {
return undefined;
}
return x;
};
HxOverrides.substr = function(s,pos,len) {
if(len == null) {
len = s.length;
} else if(len < 0) {
if(pos == 0) {
len = s.length + len;
} else {
return "";
}
}
return s.substr(pos,len);
};
HxOverrides.remove = function(a,obj) {
var i = a.indexOf(obj);
if(i == -1) {
return false;
}
a.splice(i,1);
return true;
};
HxOverrides.iter = function(a) {
return { cur : 0, arr : a, hasNext : function() {
return this.cur < this.arr.length;
}, next : function() {
return this.arr[this.cur++];
}};
};
var Dom = function() { };
Dom.__name__ = ["Dom"];
Dom["is"] = function(e,property) {
var _g = property.split(".");
switch(_g.length) {
case 1:
var name = _g[0];
return e.hasAttribute("data-" + name);
case 2:
if(_g[0] == "") {
var name1 = _g[1];
return e.classList.contains(name1);
} else {
throw new js__$Boot_HaxeError("invalid usage");
}
break;
default:
throw new js__$Boot_HaxeError("invalid usage");
}
};
Dom.toggle = function(e,property,on) {
var add = function() {
var _g = property.split(".");
switch(_g.length) {
case 1:
var name = _g[0];
e.setAttribute("data-" + name,"");
break;
case 2:
if(_g[0] == "") {
var name1 = _g[1];
e.classList.add(name1);
} else {
throw new js__$Boot_HaxeError("invalid usage");
}
break;
default:
throw new js__$Boot_HaxeError("invalid usage");
}
return true;
};
var rem = function() {
var _g1 = property.split(".");
switch(_g1.length) {
case 1:
var name2 = _g1[0];
e.removeAttribute("data-" + name2);
break;
case 2:
if(_g1[0] == "") {
var name3 = _g1[1];
e.classList.remove(name3);
} else {
throw new js__$Boot_HaxeError("invalid usage");
}
break;
default:
throw new js__$Boot_HaxeError("invalid usage");
}
return false;
};
var _g2 = Dom["is"](e,property);
if(on == null) {
switch(_g2) {
case false:
return add();
case true:
return rem();
}
} else {
switch(on) {
case false:
if(_g2 == false) {
return on;
} else {
return rem();
}
break;
case true:
if(_g2 == true) {
return on;
} else {
return add();
}
break;
}
}
};
Dom.toggleAria = function(e,attribute,on) {
var set = function(value) {
e.removeAttribute("" + attribute);
e.setAttribute("" + attribute,"" + value);
return false;
};
switch(on) {
case false:
return set("false");
case true:
return set("true");
}
};
Dom.tag = function(name,attr,children) {
var parts = name.split(".");
var ret = window.document.createElement(parts.shift());
var _g = 0;
while(_g < parts.length) {
var cls = parts[_g];
++_g;
ret.classList.add(cls);
}
if(attr != null) {
var _g1 = 0;
var _g11 = Reflect.fields(attr);
while(_g1 < _g11.length) {
var f = _g11[_g1];
++_g1;
var _g2 = Reflect.field(attr,f);
if(_g2 != null) {
var v = _g2;
ret.setAttribute(f,v);
}
}
}
if(children != null) {
var _g3 = 0;
while(_g3 < children.length) {
var c = children[_g3];
++_g3;
ret.appendChild(c);
}
}
return ret;
};
Dom.gets = function(target,event) {
var a1 = target;
var a2 = event;
var a11 = target;
var a21 = event;
return tink_core__$Signal_Signal_$Impl_$.ofClassical(function(a3) {
return Dom.on(a1,a2,a3);
},function(a31) {
return Dom.on(a11,a21,a31);
});
};
Dom.getElement = function(html,__tink_tmp142) {
if(__tink_tmp142 == null) {
__tink_tmp142 = { };
}
var cached = __tink_tmp142.cached == null ? false : __tink_tmp142.cached;
var init = __tink_tmp142.init == null ? null : __tink_tmp142.init;
var get = function() {
var helper = window.document.createElement("div");
helper.innerHTML = html;
var ret = helper.firstElementChild;
if(init != null) {
init(ret);
}
return ret;
};
if(cached) {
var _g = Dom.cache.get(html);
if(_g == null) {
var this1 = Dom.cache;
var v = get();
this1.set(html,v);
return v;
} else {
var v1 = _g;
return v1;
}
} else {
return get();
}
};
Dom.nearest = function(at,selector) {
return Dom.parents(at,selector)[0];
};
Dom.parents = function(at,selector) {
var ret = [];
while(at != null) {
if($bind(at,at.matches) != null && at.matches(selector)) {
ret.push(at);
}
at = at.parentElement != null ? at.parentElement : at.parentNode;
}
return ret;
};
Dom.transform = function(e,transform) {
e.style.transform = transform;
};
Dom.unsafe = function(f) {
try {
f();
} catch( e ) {
}
};
Dom.abruptly = function(e,f) {
var isDry = e.classList.contains("dry");
if(!isDry) {
e.classList.add("dry");
}
f();
var x = e.clientHeight;
if(!isDry) {
e.classList.remove("dry");
}
};
Dom.toggleFullScreen = function(target,fullscreen) {
Dom.unsafe(function() {
if(fullscreen) {
target.requestFullscreen();
} else {
window.document.exitFullscreen();
}
});
};
Dom.query = function(s,ctx) {
if(ctx == null) {
return window.document.querySelectorAll(s);
}
var prefix;
if(Dom.hasScope) {
prefix = ":scope";
} else {
var _g = ctx.id;
if(_g == null) {
if(!window.document.documentElement.contains(ctx)) {
prefix = "#" + (ctx.id = "_hx_" + Dom.counter++);
} else {
var cur = ctx;
var _g1 = [];
while(cur != window.document.documentElement) {
var name = cur.tagName.toLowerCase();
cur = cur.parentElement;
_g1.push(name);
}
var path = _g1;
path.reverse();
prefix = path.join(">");
}
} else if(_g == "") {
if(!window.document.documentElement.contains(ctx)) {
prefix = "#" + (ctx.id = "_hx_" + Dom.counter++);
} else {
var cur1 = ctx;
var _g2 = [];
while(cur1 != window.document.documentElement) {
var name1 = cur1.tagName.toLowerCase();
cur1 = cur1.parentElement;
_g2.push(name1);
}
var path1 = _g2;
path1.reverse();
prefix = path1.join(">");
}
} else {
var v = _g;
prefix = "#" + v;
}
}
var ret = ctx.querySelectorAll("" + prefix + " " + s);
return ret;
};
Dom.once = function(target,type,handler) {
var ret = null;
ret = Dom.on(target,type,function(x) {
tink_core__$Callback_Callback_$Impl_$.invoke(handler,x);
if(ret != null) {
ret.dissolve();
}
});
return ret;
};
Dom.on = function(target,type,handler) {
if(target == null) {
var this1 = new tink_core__$Callback_SimpleLink(function() {
});
return this1;
}
var f = function(e) {
tink_core__$Callback_Callback_$Impl_$.invoke(handler,e);
};
var remove = function() {
var _g = 0;
var _g1 = type.split(" ");
while(_g < _g1.length) {
var type1 = _g1[_g];
++_g;
if(type1 != "") {
target.removeEventListener(type1,f);
}
}
};
var _g2 = 0;
var _g11 = type.split(" ");
while(_g2 < _g11.length) {
var type2 = _g11[_g2];
++_g2;
if(type2 != "") {
target.addEventListener(type2,f);
}
}
var this2 = new tink_core__$Callback_SimpleLink(remove);
return this2;
};
var _$Dom_QueryResult_$Impl_$ = {};
_$Dom_QueryResult_$Impl_$.__name__ = ["_Dom","QueryResult_Impl_"];
_$Dom_QueryResult_$Impl_$.toArray = function(this1) {
var _g = [];
var _g1 = 0;
while(_g1 < this1.length) {
var x = this1[_g1];
++_g1;
_g.push(x);
}
return _g;
};
_$Dom_QueryResult_$Impl_$.query = function(scope,query) {
return Dom.query(query,scope);
};
_$Dom_QueryResult_$Impl_$.on = function(selector,eventType,scope,handler) {
if(scope == null) {
return _$Dom_QueryResult_$Impl_$.on(selector,eventType,window.document,handler);
} else {
return Dom.on(scope,eventType,function(e) {
var _g = 0;
var _g1 = Dom.parents(e.target,selector);
while(_g < _g1.length) {
var at = _g1[_g];
++_g;
tink_core__$Callback_Callback_$Impl_$.invoke(handler,{ at : at, event : e});
if(e.defaultPrevented) {
return;
}
}
});
}
};
var EReg = function(r,opt) {
this.r = new RegExp(r,opt.split("u").join(""));
};
EReg.__name__ = ["EReg"];
EReg.prototype = {
match: function(s) {
if(this.r.global) {
this.r.lastIndex = 0;
}
this.r.m = this.r.exec(s);
this.r.s = s;
return this.r.m != null;
}
,__class__: EReg
};
var Lambda = function() { };
Lambda.__name__ = ["Lambda"];
Lambda.map = function(it,f) {
var l = new List();
var x = $iterator(it)();
while(x.hasNext()) {
var x1 = x.next();
l.add(f(x1));
}
return l;
};
Lambda.has = function(it,elt) {
var x = $iterator(it)();
while(x.hasNext()) {
var x1 = x.next();
if(x1 == elt) {
return true;
}
}
return false;
};
Lambda.filter = function(it,f) {
var l = new List();
var x = $iterator(it)();
while(x.hasNext()) {
var x1 = x.next();
if(f(x1)) {
l.add(x1);
}
}
return l;
};
Lambda.count = function(it,pred) {
var n = 0;
if(pred == null) {
var _ = $iterator(it)();
while(_.hasNext()) {
var _1 = _.next();
++n;
}
} else {
var x = $iterator(it)();
while(x.hasNext()) {
var x1 = x.next();
if(pred(x1)) {
++n;
}
}
}
return n;
};
var List = function() {
this.length = 0;
};
List.__name__ = ["List"];
List.prototype = {
add: function(item) {
var x = new _$List_ListNode(item,null);
if(this.h == null) {
this.h = x;
} else {
this.q.next = x;
}
this.q = x;
this.length++;
}
,push: function(item) {
var x = new _$List_ListNode(item,this.h);
this.h = x;
if(this.q == null) {
this.q = x;
}
this.length++;
}
,first: function() {
if(this.h == null) {
return null;
} else {
return this.h.item;
}
}
,pop: function() {
if(this.h == null) {
return null;
}
var x = this.h.item;
this.h = this.h.next;
if(this.h == null) {
this.q = null;
}
this.length--;
return x;
}
,iterator: function() {
return new _$List_ListIterator(this.h);
}
,join: function(sep) {
var s_b = "";
var first = true;
var l = this.h;
while(l != null) {
if(first) {
first = false;
} else {
s_b += sep == null ? "null" : "" + sep;
}
s_b += Std.string(l.item);
l = l.next;
}
return s_b;
}
,__class__: List
};
var _$List_ListNode = function(item,next) {
this.item = item;
this.next = next;
};
_$List_ListNode.__name__ = ["_List","ListNode"];
_$List_ListNode.prototype = {
__class__: _$List_ListNode
};
var _$List_ListIterator = function(head) {
this.head = head;
};
_$List_ListIterator.__name__ = ["_List","ListIterator"];
_$List_ListIterator.prototype = {
hasNext: function() {
return this.head != null;
}
,next: function() {
var val = this.head.item;
this.head = this.head.next;
return val;
}
,__class__: _$List_ListIterator
};
Math.__name__ = ["Math"];
var Reflect = function() { };
Reflect.__name__ = ["Reflect"];
Reflect.field = function(o,field) {
try {
return o[field];
} catch( e ) {
return null;
}
};
Reflect.fields = function(o) {
var a = [];
if(o != null) {
var hasOwnProperty = Object.prototype.hasOwnProperty;
for( var f in o ) {
if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) {
a.push(f);
}
}
}
return a;
};
Reflect.compare = function(a,b) {
if(a == b) {
return 0;
} else if(a > b) {
return 1;
} else {
return -1;
}
};
Reflect.copy = function(o) {
var o2 = { };
var _g = 0;
var _g1 = Reflect.fields(o);
while(_g < _g1.length) {
var f = _g1[_g];
++_g;
o2[f] = Reflect.field(o,f);
}
return o2;
};
var Std = function() { };
Std.__name__ = ["Std"];
Std.string = function(s) {
return js_Boot.__string_rec(s,"");
};
Std.parseInt = function(x) {
var v = parseInt(x,10);
if(v == 0 && (HxOverrides.cca(x,1) == 120 || HxOverrides.cca(x,1) == 88)) {
v = parseInt(x);
}
if(isNaN(v)) {
return null;
}
return v;
};
Std.parseFloat = function(x) {
return parseFloat(x);
};
var StringBuf = function() {
this.b = "";
};
StringBuf.__name__ = ["StringBuf"];
StringBuf.prototype = {
__class__: StringBuf
};
var Type = function() { };
Type.__name__ = ["Type"];
Type.getClassName = function(c) {
var a = c.__name__;
if(a == null) {
return null;
}
return a.join(".");
};
var _$UInt_UInt_$Impl_$ = {};
_$UInt_UInt_$Impl_$.__name__ = ["_UInt","UInt_Impl_"];
_$UInt_UInt_$Impl_$.toFloat = function(this1) {
var $int = this1;
if($int < 0) {
return 4294967296.0 + $int;
} else {
return $int + 0.0;
}
};
var Xml = function(nodeType) {
this.nodeType = nodeType;
this.children = [];
this.attributeMap = new haxe_ds_StringMap();
};
Xml.__name__ = ["Xml"];
Xml.parse = function(str) {
return haxe_xml_Parser.parse(str);
};
Xml.createElement = function(name) {
var xml = new Xml(Xml.Element);
if(xml.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + xml.nodeType);
}
xml.nodeName = name;
return xml;
};
Xml.createPCData = function(data) {
var xml = new Xml(Xml.PCData);
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType);
}
xml.nodeValue = data;
return xml;
};
Xml.createCData = function(data) {
var xml = new Xml(Xml.CData);
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType);
}
xml.nodeValue = data;
return xml;
};
Xml.createComment = function(data) {
var xml = new Xml(Xml.Comment);
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType);
}
xml.nodeValue = data;
return xml;
};
Xml.createDocType = function(data) {
var xml = new Xml(Xml.DocType);
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType);
}
xml.nodeValue = data;
return xml;
};
Xml.createProcessingInstruction = function(data) {
var xml = new Xml(Xml.ProcessingInstruction);
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType);
}
xml.nodeValue = data;
return xml;
};
Xml.createDocument = function() {
return new Xml(Xml.Document);
};
Xml.prototype = {
get: function(att) {
if(this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType);
}
var _this = this.attributeMap;
if(__map_reserved[att] != null) {
return _this.getReserved(att);
} else {
return _this.h[att];
}
}
,set: function(att,value) {
if(this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType);
}
var _this = this.attributeMap;
if(__map_reserved[att] != null) {
_this.setReserved(att,value);
} else {
_this.h[att] = value;
}
}
,exists: function(att) {
if(this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType);
}
var _this = this.attributeMap;
if(__map_reserved[att] != null) {
return _this.existsReserved(att);
} else {
return _this.h.hasOwnProperty(att);
}
}
,attributes: function() {
if(this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType);
}
return this.attributeMap.keys();
}
,elements: function() {
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType);
}
var _g = [];
var _g1 = 0;
var _g2 = this.children;
while(_g1 < _g2.length) {
var child = _g2[_g1];
++_g1;
if(child.nodeType == Xml.Element) {
_g.push(child);
}
}
var ret = _g;
return HxOverrides.iter(ret);
}
,firstElement: function() {
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType);
}
var _g = 0;
var _g1 = this.children;
while(_g < _g1.length) {
var child = _g1[_g];
++_g;
if(child.nodeType == Xml.Element) {
return child;
}
}
return null;
}
,addChild: function(x) {
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType);
}
if(x.parent != null) {
x.parent.removeChild(x);
}
this.children.push(x);
x.parent = this;
}
,removeChild: function(x) {
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType);
}
if(HxOverrides.remove(this.children,x)) {
x.parent = null;
return true;
}
return false;
}
,__class__: Xml
};
var coconut_data_Model = function() { };
coconut_data_Model.__name__ = ["coconut","data","Model"];
var vdom_Widget = function() {
this.type = "Widget";
};
vdom_Widget.__name__ = ["vdom","Widget"];
vdom_Widget.prototype = {
init: function() {
throw new js__$Boot_HaxeError("abstract");
}
,update: function(prev,elt) {
throw new js__$Boot_HaxeError("abstract");
}
,destroy: function() {
}
,__class__: vdom_Widget
};
var coconut_vdom_Renderable = function(rendered,key) {
vdom_Widget.call(this);
this.__rendered = rendered;
if(key == null) {
key = vdom__$Attr_Key_$Impl_$.ofObj(this.__rendered);
}
this.key = key;
};
coconut_vdom_Renderable.__name__ = ["coconut","vdom","Renderable"];
coconut_vdom_Renderable.__super__ = vdom_Widget;
coconut_vdom_Renderable.prototype = $extend(vdom_Widget.prototype,{
init: function() {
this.__lastRender = tink_state__$Observable_Observable_$Impl_$.get_value(this.__rendered);
this.beforeInit();
this.__dom = vdom_VDom.create(this.__lastRender);
this.afterInit(this.__dom);
this.__setupBinding();
return this.__dom;
}
,__setupBinding: function() {
var _gthis = this;
this.__binding = tink_state__$Observable_Observable_$Impl_$.bind(this.__rendered,null,function(next) {
if(next != _gthis.__lastRender) {
_gthis.__apply(next);
}
});
}
,__apply: function(next) {
var changes = vdom_VDom.diff(this.__lastRender,next);
this.beforePatching(this.__dom);
this.__dom = vdom_VDom.patch(this.__dom,changes);
this.__lastRender = next;
this.afterPatching(this.__dom);
}
,toElement: function() {
var _g = this.__dom;
if(_g == null) {
return this.init();
} else {
var v = _g;
return v;
}
}
,beforeInit: function() {
}
,afterInit: function(element) {
}
,beforePatching: function(element) {
}
,afterPatching: function(element) {
}
,update: function(x,y) {
var _g = (x instanceof coconut_vdom_Renderable) ? x : null;
if(_g != null) {
var v = _g;
this.__reuseRender(v);
}
return this.toElement();
}
,__reuseRender: function(that) {
this.__dom = that.__dom;
this.__lastRender = that.__lastRender;
this.__apply(tink_state__$Observable_Observable_$Impl_$.get_value(this.__rendered));
this.__setupBinding();
that.destroy();
}
,destroy: function() {
var this1 = this.__binding;
if(this1 != null) {
this1.dissolve();
}
vdom_Widget.prototype.destroy.call(this);
}
,__class__: coconut_vdom_Renderable
});
var coconut_ui_BaseView = function(data,render) {
this.__coco__cache = new coconut_ui_tools_ViewCache();
var _gthis = this;
var this1 = { f : function() {
var f = render;
var a1 = data;
var this2 = function() {
return f(a1);
};
return _gthis.__coco__cache.cached(this2);
}};
coconut_vdom_Renderable.call(this,tink_state__$Observable_Observable_$Impl_$.auto(this1));
};
coconut_ui_BaseView.__name__ = ["coconut","ui","BaseView"];
coconut_ui_BaseView.__super__ = coconut_vdom_Renderable;
coconut_ui_BaseView.prototype = $extend(coconut_vdom_Renderable.prototype,{
__class__: coconut_ui_BaseView
});
var coconut_ui_View = function(data,render) {
coconut_ui_BaseView.call(this,data,render);
};
coconut_ui_View.__name__ = ["coconut","ui","View"];
coconut_ui_View.__super__ = coconut_ui_BaseView;
coconut_ui_View.prototype = $extend(coconut_ui_BaseView.prototype,{
__class__: coconut_ui_View
});
var coconut_ui_tools__$ViewCache_Stack = function(create) {
this.stored = [];
this.counter = 0;
this.create = create;
};
coconut_ui_tools__$ViewCache_Stack.__name__ = ["coconut","ui","tools","_ViewCache","Stack"];
coconut_ui_tools__$ViewCache_Stack.prototype = {
purge: function() {
this.stored.splice(this.counter,this.stored.length);
this.counter = 0;
}
,poll: function() {
var _g = this.stored[this.counter++];
if(_g == null) {
var ret = this.create();
this.stored.push(ret);
return ret;
} else {
var v = _g;
return v;
}
}
,__class__: coconut_ui_tools__$ViewCache_Stack
};
var coconut_ui_tools__$ViewCache_Factory = function(render) {
this.stackByData = new haxe_ds_ObjectMap();
this.render = render;
};
coconut_ui_tools__$ViewCache_Factory.__name__ = ["coconut","ui","tools","_ViewCache","Factory"];
coconut_ui_tools__$ViewCache_Factory.prototype = {
purge: function() {
var s = this.stackByData.iterator();
while(s.hasNext()) {
var s1 = s.next();
s1.purge();
}
}
,make: function(data) {
var stack;
var _g = this.stackByData.get(data);
if(_g == null) {
var this1 = this.stackByData;
var f = this.render;
var a1 = data;
var v = new coconut_ui_tools__$ViewCache_Stack(function() {
return f(a1);
});
this1.set(data,v);
stack = v;
} else {
var v1 = _g;
stack = v1;
}
return stack.poll();
}
,__class__: coconut_ui_tools__$ViewCache_Factory
};
var coconut_ui_tools_ViewCache = function() {
this.__cache = new haxe_ds_StringMap();
};
coconut_ui_tools_ViewCache.__name__ = ["coconut","ui","tools","ViewCache"];
coconut_ui_tools_ViewCache.prototype = {
cached: function(f) {
var o = { cache : this};
coconut_ui_tools_ViewCache.stack.push(o);
var ret = f();
HxOverrides.remove(coconut_ui_tools_ViewCache.stack,o);
this.purge();
return ret;
}
,purge: function() {
var _this = this.__cache;
var f = new haxe_ds__$StringMap_StringMapIterator(_this,_this.arrayKeys());
while(f.hasNext()) {
var f1 = f.next();
f1.purge();
}
}
,getFactory: function(cls,make) {
var _g = this.__cache.get(cls);
var tmp;
if(_g == null) {
var this1 = this.__cache;
var v = new coconut_ui_tools__$ViewCache_Factory(make);
this1.set(cls,v);
tmp = v;
} else {
var v1 = _g;
tmp = v1;
}
return tmp;
}
,__class__: coconut_ui_tools_ViewCache
};
var contraptions_TransitionResult = { __ename__ : true, __constructs__ : ["Completed","Aborted","Exchanged"] };
contraptions_TransitionResult.Completed = ["Completed",0];
contraptions_TransitionResult.Completed.toString = $estr;
contraptions_TransitionResult.Completed.__enum__ = contraptions_TransitionResult;
contraptions_TransitionResult.Aborted = function(instead) { var $x = ["Aborted",1,instead]; $x.__enum__ = contraptions_TransitionResult; $x.toString = $estr; return $x; };
contraptions_TransitionResult.Exchanged = function(instead,completion) { var $x = ["Exchanged",2,instead,completion]; $x.__enum__ = contraptions_TransitionResult; $x.toString = $estr; return $x; };
var epaper_debug_DebugUi = function() { };
epaper_debug_DebugUi.__name__ = ["epaper","debug","DebugUi"];
epaper_debug_DebugUi.init = function(root,visible,config) {
if(visible == null) {
visible = false;
}
if(root == null) {
root = window.document.body.querySelector(".epaper-root");
}
if(!epaper_debug_DebugUi.initialized) {
epaper_debug_DebugUi.changeSignal = tink_core__$Signal_Signal_$Impl_$.trigger();
} else {
return tink_core__$Signal_Signal_$Impl_$.filter(epaper_debug_DebugUi.changeSignal,function(_) {
return epaper_debug_DebugUi.active;
});
}
var ui = Dom.getElement(epaper_debug_DebugUi.render(visible,"/* debug.sass */\n/* globaltools.sass */\n.nodisplay {\n display: none !important;\n}\n\n.scroll-container {\n overflow-x: hidden;\n overflow-y: hidden;\n position: relative;\n}\n\n.scroll-container .virtual-scollbar {\n z-index: 1;\n pointer-events: none;\n position: absolute;\n height: 100%;\n -moz-transition: opacity, right, width, background;\n transition: opacity, right, width, background;\n -moz-transition-duration: .15s;\n transition-duration: .15s;\n visibility: hidden;\n opacity: 0;\n right: 1px;\n width: 3px;\n background: #f0f;\n -moz-transform-origin: 50% 0%;\n transform-origin: 50% 0%;\n}\n\n.scroll-container[data-scrollable] .virtual-scollbar {\n visibility: visible;\n opacity: .25;\n}\n\n.scroll-container:hover .virtual-scollbar {\n opacity: .55;\n}\n\n.scroll-container .scroll-box {\n position: relative;\n height: 100%;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n.scroll-container .scroll-box::-webkit-scrollbar {\n display: none;\n}\n\n[data-show-overflow=\"no\"].epaper-root {\n overflow: hidden;\n}\n\n:not([data-debug-device=\"dynamic\"])[data-show-overflow=\"yes\"].epaper-root::after {\n border: 1px solid red;\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n content: ' ';\n pointer-events: none;\n}\n\n[data-input=\"touch\"].epaper-root * {\n cursor: crosshair !important;\n cursor: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjNJREFUeNrEl8kvBEEUxqvLOrETEmLfb4ib5YKDg6ODv86JC4lws0SEg2RCHCwRCRfEkkFCLLOZ9j35WjqT0Ro93S/5TSadTr+v3lL1ylhY21W/sBrQBlr4vxTkgFfwAK7ACTgHcTcfzHXxjgHaQQ9oBiVAA9P2ThFpBH0gAo7AAXj8j4B6MAo6QB5Igvc053aT5wUU2goGwDYIg8RvBMiqB8EIVybhjLlMk2lzVg4mQCdYAvduBMizcTDE1cbU3y3JxXSDCjDP+vgynWHl4nzYFu7/mkQkCqrBFKh1EjDAlUvIU8pbk29WgklQnEmAVXBOReaFiAYwli5A03mRR2H/SUQ/95MvAa1stbjKvqXY0pJuQ7PwevnQVP5YkptbrQio4saRVP6ZRKEQdGmGvsSH3GcS0aR5sGjlv4mACs0NwgxAgPgMiYAyFYxJBPK1yyM5W6ZFwEtAzqX9E5qTTFACYppjlBFE+MGz5gwXDaAVPxcvPxfgjsOl3214pjnxHPkcgVwOrqeW033Oa361pER7D7xZAp44vfqRhjwW/k76RBRmQRZmufDk0Fu19h+7gARH51vZIrPkXFK8Do6/G0qlDua4ORV4nHNxvgU2naZixbacAZdMh/Yg59JyK2A5fdr+7uNSJNMsTJMpMf7QahLFGzALNjKN+k5tJ0WyCA45QLYxIikbpm1fN7gg6+IaYavtOB14bvr+lNTJDCdjFK9ZIUZG2+6Oz+Ca75/x2u5oHwIMAKGvgmea61TDAAAAAElFTkSuQmCC\") 16 16, crosshair !important;\n}\n\nbody::-webkit-scrollbar {\n width: 10px !important;\n height: 10px !important;\n}\n\nbody::-webkit-scrollbar-track {\n background: grey !important;\n}\n\nbody::-webkit-scrollbar-thumb {\n background: red !important;\n}\n\n.debug-ui {\n position: fixed;\n z-index: 10;\n top: 20px;\n left: 50%;\n -moz-transform: translateX(-50%);\n transform: translateX(-50%);\n max-width: -moz-calc(100vw - 10px);\n max-width: calc(100vw - 10px);\n max-height: -moz-calc(100vh - 10px);\n max-height: calc(100vh - 10px);\n overflow-y: auto;\n padding: 10px;\n opacity: 0.5;\n background: #ccc;\n display: -moz-box;\n display: flex;\n -moz-box-orient: vertical;\n -moz-box-direction: normal;\n flex-direction: column;\n}\n\n.debug-ui .row {\n display: -moz-box;\n display: flex;\n -moz-box-orient: horizontal;\n -moz-box-direction: normal;\n flex-direction: row;\n -moz-box-pack: justify;\n justify-content: space-between;\n}\n\n.debug-ui .col {\n display: -moz-box;\n display: flex;\n -moz-box-orient: vertical;\n -moz-box-direction: normal;\n flex-direction: column;\n}\n\n.debug-ui:hover {\n opacity: 0.8;\n}\n\n.debug-ui h1 {\n font-size: 15px;\n}\n\n.debug-ui .devices {\n display: -moz-box;\n display: flex;\n -moz-box-orient: horizontal;\n -moz-box-direction: normal;\n flex-direction: row;\n -moz-box-align: start;\n align-items: flex-start;\n}\n\n.debug-ui .switches {\n display: -moz-box;\n display: flex;\n}\n\n.debug-ui .switches.passive {\n -moz-box-orient: horizontal;\n -moz-box-direction: normal;\n flex-direction: row;\n -moz-box-align: start;\n align-items: flex-start;\n}\n\n.debug-ui .switches.active {\n -moz-box-align: end;\n align-items: flex-end;\n -moz-box-orient: horizontal;\n -moz-box-direction: normal;\n flex-direction: row;\n border-bottom: 1px solid #333;\n width: 595px;\n position: relative;\n}\n\n.debug-ui .switches .switch {\n display: -moz-box;\n display: flex;\n -moz-box-orient: vertical;\n -moz-box-direction: normal;\n flex-direction: column;\n margin-bottom: 10px;\n}\n\n.debug-ui .properties {\n display: -moz-box;\n display: flex;\n flex-wrap: wrap;\n}\n\n.debug-ui .properties > li {\n list-style: none;\n margin: 0 5px;\n font-size: 10px;\n}\n\n.debug-ui .properties > li select {\n font-size: 12px;\n}\n\n.debug-ui .properties > li select option {\n font-size: 15px;\n}\n\n.debug-ui .options {\n display: -moz-box;\n display: flex;\n flex-wrap: no-wrap;\n}\n\n.debug-ui .debug-infos {\n font-size: 10px;\n}\n\n.debug-ui:not(:hover) {\n background: #333;\n}\n\n.debug-ui:not(:hover) .device-input:checked + label {\n background: #111;\n}\n\n.debug-ui:not(:hover) .switch[data-highlight]:before {\n color: white;\n}\n\n.debug-ui:not(:hover) h1,\n.debug-ui:not(:hover) .device-input:not(:checked) + label,\n.debug-ui:not(:hover) .switches.active,\n.debug-ui:not(:hover) .switch:not([data-highlight]),\n.debug-ui:not(:hover) .debug-option-label {\n display: none;\n}\n\n.debug-ui:not(:hover) .properties {\n display: none;\n}\n\n.debug-ui:not(:hover) .debug-infos {\n display: none;\n}\n\n.debug-ui .device-input,\n.debug-ui .switch input,\n.debug-ui .debug-option-input {\n display: none;\n}\n\n.debug-ui .device-input:checked + label,\n.debug-ui .switch input:checked + label,\n.debug-ui .debug-option-input:checked + label {\n background: #333;\n color: white;\n}\n\n.debug-ui .device-label,\n.debug-ui .switch label,\n.debug-ui .debug-option-label {\n background: #eee;\n margin: 0 5px;\n padding: 5px;\n cursor: pointer;\n display: -moz-box;\n display: flex;\n -moz-box-orient: vertical;\n -moz-box-direction: normal;\n flex-direction: column;\n min-width: 75px;\n max-width: 75px;\n word-wrap: break-word;\n font-size: 12px;\n}\n\n.debug-ui .device-label .head,\n.debug-ui .switch label .head,\n.debug-ui .debug-option-label .head {\n font-size: 12px;\n}\n\n.debug-ui .device-label .desc,\n.debug-ui .switch label .desc,\n.debug-ui .debug-option-label .desc {\n font-size: 9px;\n}\n\n.debug-ui .switch::before {\n content: attr(data-prop);\n font-size: 10px;\n text-align: center;\n}\n\n.debug-ui .switch[data-highlight] input:checked + label {\n -moz-animation: flash-red 3s;\n animation: flash-red 3s;\n}\n\n@-moz-keyframes flash-red {\n 0%, 30% {\n background: red;\n }\n 100% {\n background: #333;\n }\n}\n\n@keyframes flash-red {\n 0%, 30% {\n background: red;\n }\n 100% {\n background: #333;\n }\n}\n\nbody {\n background: #333;\n overflow-x: auto !important;\n overflow-y: auto !important;\n position: static !important;\n}\n\n.device-mock {\n pointer-events: none;\n position: absolute;\n background-repeat: no-repeat;\n display: none;\n}\n\n[data-debug-device=\"dynamic\"].epaper-root {\n width: 100%;\n height: 100%;\n}\n\n[data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 3840px;\n height: 2160px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 3840px;\n height: 2160px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 2160px;\n height: 3840px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-uhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 2160px;\n height: 3840px;\n}\n\n[data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 2560px;\n height: 1440px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 2560px;\n height: 1440px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1440px;\n height: 2560px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-wqhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1440px;\n height: 2560px;\n}\n\n[data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1920px;\n height: 1080px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1920px;\n height: 1080px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1080px;\n height: 1920px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-fhd\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1080px;\n height: 1920px;\n}\n\n[data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1280px;\n height: 800px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1280px;\n height: 800px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 800px;\n height: 1280px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"desktop-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 800px;\n height: 1280px;\n}\n\n[data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n}\n\n[data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 640px;\n height: 800px;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 640px;\n height: 800px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 800px;\n height: 640px;\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"splitscreen-wxga\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 800px;\n height: 640px;\n}\n\n[data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 800px;\n height: 600px;\n margin-left: -moz-calc(-800px/2);\n margin-left: calc(-800px/2);\n margin-top: -moz-calc(-600px/2);\n margin-top: calc(-600px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 800px;\n height: 600px;\n margin-left: -moz-calc(-800px/2);\n margin-left: calc(-800px/2);\n margin-top: -moz-calc(-600px/2);\n margin-top: calc(-600px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 600px;\n height: 800px;\n margin-left: -moz-calc(-600px/2);\n margin-left: calc(-600px/2);\n margin-top: -moz-calc(-800px/2);\n margin-top: calc(-800px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"big-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 600px;\n height: 800px;\n margin-left: -moz-calc(-600px/2);\n margin-left: calc(-600px/2);\n margin-top: -moz-calc(-800px/2);\n margin-top: calc(-800px/2);\n}\n\n[data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 475px;\n height: 275px;\n margin-left: -moz-calc(-475px/2);\n margin-left: calc(-475px/2);\n margin-top: -moz-calc(-275px/2);\n margin-top: calc(-275px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 475px;\n height: 275px;\n margin-left: -moz-calc(-475px/2);\n margin-left: calc(-475px/2);\n margin-top: -moz-calc(-275px/2);\n margin-top: calc(-275px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 275px;\n height: 475px;\n margin-left: -moz-calc(-275px/2);\n margin-left: calc(-275px/2);\n margin-top: -moz-calc(-475px/2);\n margin-top: calc(-475px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"small-embed\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 275px;\n height: 475px;\n margin-left: -moz-calc(-275px/2);\n margin-left: calc(-275px/2);\n margin-top: -moz-calc(-475px/2);\n margin-top: calc(-475px/2);\n}\n\n[data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 475px;\n height: 275px;\n margin-left: -moz-calc(-475px/2);\n margin-left: calc(-475px/2);\n margin-top: -moz-calc(-275px/2);\n margin-top: calc(-275px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 475px;\n height: 275px;\n margin-left: -moz-calc(-475px/2);\n margin-left: calc(-475px/2);\n margin-top: -moz-calc(-275px/2);\n margin-top: calc(-275px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 275px;\n height: 475px;\n margin-left: -moz-calc(-275px/2);\n margin-left: calc(-275px/2);\n margin-top: -moz-calc(-475px/2);\n margin-top: calc(-475px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"small-embed-touch\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 275px;\n height: 475px;\n margin-left: -moz-calc(-275px/2);\n margin-left: calc(-275px/2);\n margin-top: -moz-calc(-475px/2);\n margin-top: calc(-475px/2);\n}\n\n[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 360px;\n height: 640px;\n margin-left: -moz-calc(-360px/2);\n margin-left: calc(-360px/2);\n margin-top: -moz-calc(-640px/2);\n margin-top: calc(-640px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 360px;\n height: 640px;\n margin-left: -moz-calc(-360px/2);\n margin-left: calc(-360px/2);\n margin-top: -moz-calc(-640px/2);\n margin-top: calc(-640px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 640px;\n height: 360px;\n margin-left: -moz-calc(-640px/2);\n margin-left: calc(-640px/2);\n margin-top: -moz-calc(-360px/2);\n margin-top: calc(-360px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 640px;\n height: 360px;\n margin-left: -moz-calc(-640px/2);\n margin-left: calc(-640px/2);\n margin-top: -moz-calc(-360px/2);\n margin-top: calc(-360px/2);\n}\n\n[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/galaxyS7.png);\n width: 397px;\n height: 753px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-397px/2);\n margin-left: calc(-397px/2);\n margin-top: -moz-calc(-753px/2);\n margin-top: calc(-753px/2);\n}\n\n[data-debug-device=\"galaxy-s3-s7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/galaxyS7.png);\n width: 397px;\n height: 753px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-397px/2);\n margin-left: calc(-397px/2);\n margin-top: -moz-calc(-753px/2);\n margin-top: calc(-753px/2);\n}\n\n[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 600px;\n height: 960px;\n margin-left: -moz-calc(-600px/2);\n margin-left: calc(-600px/2);\n margin-top: -moz-calc(-960px/2);\n margin-top: calc(-960px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 600px;\n height: 960px;\n margin-left: -moz-calc(-600px/2);\n margin-left: calc(-600px/2);\n margin-top: -moz-calc(-960px/2);\n margin-top: calc(-960px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 960px;\n height: 600px;\n margin-left: -moz-calc(-960px/2);\n margin-left: calc(-960px/2);\n margin-top: -moz-calc(-600px/2);\n margin-top: calc(-600px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 960px;\n height: 600px;\n margin-left: -moz-calc(-960px/2);\n margin-left: calc(-960px/2);\n margin-top: -moz-calc(-600px/2);\n margin-top: calc(-600px/2);\n}\n\n[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/nexus7.png);\n width: 674px;\n height: 1204px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-674px/2);\n margin-left: calc(-674px/2);\n margin-top: -moz-calc(-1204px/2);\n margin-top: calc(-1204px/2);\n}\n\n[data-debug-device=\"asus-nexus-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/nexus7.png);\n width: 674px;\n height: 1204px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-674px/2);\n margin-left: calc(-674px/2);\n margin-top: -moz-calc(-1204px/2);\n margin-top: calc(-1204px/2);\n}\n\n[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 320px;\n height: 568px;\n margin-left: -moz-calc(-320px/2);\n margin-left: calc(-320px/2);\n margin-top: -moz-calc(-568px/2);\n margin-top: calc(-568px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 320px;\n height: 568px;\n margin-left: -moz-calc(-320px/2);\n margin-left: calc(-320px/2);\n margin-top: -moz-calc(-568px/2);\n margin-top: calc(-568px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 568px;\n height: 320px;\n margin-left: -moz-calc(-568px/2);\n margin-left: calc(-568px/2);\n margin-top: -moz-calc(-320px/2);\n margin-top: calc(-320px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 568px;\n height: 320px;\n margin-left: -moz-calc(-568px/2);\n margin-left: calc(-568px/2);\n margin-top: -moz-calc(-320px/2);\n margin-top: calc(-320px/2);\n}\n\n[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone5.png);\n width: 379px;\n height: 803px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-379px/2);\n margin-left: calc(-379px/2);\n margin-top: -moz-calc(-803px/2);\n margin-top: calc(-803px/2);\n}\n\n[data-debug-device=\"iPhone-5-se\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone5.png);\n width: 379px;\n height: 803px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-379px/2);\n margin-left: calc(-379px/2);\n margin-top: -moz-calc(-803px/2);\n margin-top: calc(-803px/2);\n}\n\n[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 375px;\n height: 667px;\n margin-left: -moz-calc(-375px/2);\n margin-left: calc(-375px/2);\n margin-top: -moz-calc(-667px/2);\n margin-top: calc(-667px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 375px;\n height: 667px;\n margin-left: -moz-calc(-375px/2);\n margin-left: calc(-375px/2);\n margin-top: -moz-calc(-667px/2);\n margin-top: calc(-667px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 667px;\n height: 375px;\n margin-left: -moz-calc(-667px/2);\n margin-left: calc(-667px/2);\n margin-top: -moz-calc(-375px/2);\n margin-top: calc(-375px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 667px;\n height: 375px;\n margin-left: -moz-calc(-667px/2);\n margin-left: calc(-667px/2);\n margin-top: -moz-calc(-375px/2);\n margin-top: calc(-375px/2);\n}\n\n[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone6.png);\n width: 436px;\n height: 884px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-436px/2);\n margin-left: calc(-436px/2);\n margin-top: -moz-calc(-884px/2);\n margin-top: calc(-884px/2);\n}\n\n[data-debug-device=\"iPhone-6-7\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone6.png);\n width: 436px;\n height: 884px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-436px/2);\n margin-left: calc(-436px/2);\n margin-top: -moz-calc(-884px/2);\n margin-top: calc(-884px/2);\n}\n\n[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 414px;\n height: 736px;\n margin-left: -moz-calc(-414px/2);\n margin-left: calc(-414px/2);\n margin-top: -moz-calc(-736px/2);\n margin-top: calc(-736px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 414px;\n height: 736px;\n margin-left: -moz-calc(-414px/2);\n margin-left: calc(-414px/2);\n margin-top: -moz-calc(-736px/2);\n margin-top: calc(-736px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 736px;\n height: 414px;\n margin-left: -moz-calc(-736px/2);\n margin-left: calc(-736px/2);\n margin-top: -moz-calc(-414px/2);\n margin-top: calc(-414px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 736px;\n height: 414px;\n margin-left: -moz-calc(-736px/2);\n margin-left: calc(-736px/2);\n margin-top: -moz-calc(-414px/2);\n margin-top: calc(-414px/2);\n}\n\n[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone6plus.png);\n width: 481px;\n height: 975px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-481px/2);\n margin-left: calc(-481px/2);\n margin-top: -moz-calc(-975px/2);\n margin-top: calc(-975px/2);\n}\n\n[data-debug-device=\"iPhone-6plus-7plus\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/iphone6plus.png);\n width: 481px;\n height: 975px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-481px/2);\n margin-left: calc(-481px/2);\n margin-top: -moz-calc(-975px/2);\n margin-top: calc(-975px/2);\n}\n\n[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 768px;\n height: 1024px;\n margin-left: -moz-calc(-768px/2);\n margin-left: calc(-768px/2);\n margin-top: -moz-calc(-1024px/2);\n margin-top: calc(-1024px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 768px;\n height: 1024px;\n margin-left: -moz-calc(-768px/2);\n margin-left: calc(-768px/2);\n margin-top: -moz-calc(-1024px/2);\n margin-top: calc(-1024px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1024px;\n height: 768px;\n margin-left: -moz-calc(-1024px/2);\n margin-left: calc(-1024px/2);\n margin-top: -moz-calc(-768px/2);\n margin-top: calc(-768px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1024px;\n height: 768px;\n margin-left: -moz-calc(-1024px/2);\n margin-left: calc(-1024px/2);\n margin-top: -moz-calc(-768px/2);\n margin-top: calc(-768px/2);\n}\n\n[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) ~ .device-mock {\n display: block;\n background-image: url(debug/ipadAir.png);\n width: 876px;\n height: 1242px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-876px/2);\n margin-left: calc(-876px/2);\n margin-top: -moz-calc(-1242px/2);\n margin-top: calc(-1242px/2);\n}\n\n[data-debug-device=\"ipad-mini-air\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) ~ .device-mock {\n display: block;\n background-image: url(debug/ipadAir.png);\n width: 876px;\n height: 1242px;\n top: 50%;\n left: 50%;\n margin-left: -moz-calc(-876px/2);\n margin-left: calc(-876px/2);\n margin-top: -moz-calc(-1242px/2);\n margin-top: calc(-1242px/2);\n}\n\n[data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n[data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n position: relative;\n top: 50%;\n left: 50%;\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1024px;\n height: 1366px;\n margin-left: -moz-calc(-1024px/2);\n margin-left: calc(-1024px/2);\n margin-top: -moz-calc(-1366px/2);\n margin-top: calc(-1366px/2);\n}\n\n:not([data-orientation=\"landscape\"])[data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1024px;\n height: 1366px;\n margin-left: -moz-calc(-1024px/2);\n margin-left: calc(-1024px/2);\n margin-top: -moz-calc(-1366px/2);\n margin-top: calc(-1366px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:-moz-full-screen) {\n width: 1366px;\n height: 1024px;\n margin-left: -moz-calc(-1366px/2);\n margin-left: calc(-1366px/2);\n margin-top: -moz-calc(-1024px/2);\n margin-top: calc(-1024px/2);\n}\n\n[data-orientation=\"landscape\"][data-debug-device=\"ipad-pro\"]:not([data-debug-device=\"dynamic\"]).epaper-root:not(:fullscreen) {\n width: 1366px;\n height: 1024px;\n margin-left: -moz-calc(-1366px/2);\n margin-left: calc(-1366px/2);\n margin-top: -moz-calc(-1024px/2);\n margin-top: calc(-1024px/2);\n}\n"));
epaper_debug_DebugUi.active = true;
window.document.body.appendChild(Dom.getElement(epaper_debug_DebugUi.renderMock()));
window.document.body.appendChild(ui);
if(config != null) {
var tmp = Dom.getElement(epaper_debug_DebugUi.debugInfos(config));
ui.appendChild(tmp);
}
var apply = function(e) {
var apply1 = "data-" + e.getAttribute("name");
var apply2 = e.getAttribute("value");
root.setAttribute(apply1,apply2);
tink_core__$Callback_CallbackList_$Impl_$.invoke(epaper_debug_DebugUi.changeSignal.handlers,tink_core_Noise.Noise);
};
var updateScreenRes = function() {
var screenResEl = ui.querySelector("input.device-input:checked+label .screen-res");
if(screenResEl == null) {
root.removeAttribute("data-debug-screen-width");
root.removeAttribute("data-debug-screen-height");
} else {
var a = screenResEl.textContent.split("x");
if(a.length == 2) {
var width = a[0];
var height = a[1];
root.setAttribute("data-debug-screen-width",width);
root.setAttribute("data-debug-screen-height",height);
}
}
};
var triggerWindowResize = function() {
var evt = window.document.createEvent("UIEvents");
evt.initUIEvent("resize",true,false,window,0);
window.dispatchEvent(evt);
};
var switches = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(ui,".switches.passive .switch[data-prop]"));
var switchInputs = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(ui,".switches .switch input"));
var __tmp = new haxe_ds_StringMap();
var _g = 0;
while(_g < switches.length) {
var s = switches[_g];
++_g;
var key = s.getAttribute("data-prop");
if(__map_reserved[key] != null) {
__tmp.setReserved(key,s);
} else {
__tmp.h[key] = s;
}
}
var switchesByName = __tmp;
var changeDevice = function(e1) {
var device = e1.getAttribute("id");
root.setAttribute("data-debug-device",device);
var p = new tink_url__$Query_QueryStringParser(e1.value,"&","=",0);
while(p.hasNext()) {
var p1 = p.next();
var key1 = p1.name;
var ie2 = _$Dom_QueryResult_$Impl_$.query(__map_reserved[key1] != null ? switchesByName.getReserved(key1) : switchesByName.h[key1],"input[value=\"" + tink_url__$Portion_Portion_$Impl_$.toString(p1.value) + "\"]")[0];
ie2.checked = true;
}
epaper_debug_DebugUi.active = false;
var _g1 = 0;
while(_g1 < switchInputs.length) {
var ie3 = switchInputs[_g1];
++_g1;
if(ie3.checked) {
apply(ie3);
}
}
updateScreenRes();
triggerWindowResize();
epaper_debug_DebugUi.active = true;
tink_core__$Callback_CallbackList_$Impl_$.invoke(epaper_debug_DebugUi.changeSignal.handlers,tink_core_Noise.Noise);
};
var timers = new haxe_ds_ObjectMap();
var updateSwitch = function(name,value) {
var t;
var el;
var ie;
el = __map_reserved[name] != null ? switchesByName.getReserved(name) : switchesByName.h[name];
if(el != null) {
ie = _$Dom_QueryResult_$Impl_$.query(el,"input[name=\"" + name + "\"][value=\"" + value + "\"]")[0];
if(ie != null) {
if(ie.checked != true) {
ie.checked = true;
el.setAttribute("data-highlight","");
if(timers.h[el.__id__] != null) {
timers.h[el.__id__].stop();
timers.set(el,null);
}
t = haxe_Timer.delay(function() {
el.removeAttribute("data-highlight");
},3000);
timers.set(el,t);
}
}
}
};
var allSwitches = _$Dom_QueryResult_$Impl_$.toArray(_$Dom_QueryResult_$Impl_$.query(ui,".switches .switch[data-prop]"));
var attrName;
var attrVal;
var _g2 = 0;
while(_g2 < allSwitches.length) {
var sw = allSwitches[_g2];
++_g2;
attrName = sw.getAttribute("data-prop");
attrVal = root.getAttribute("data-" + attrName);
if(attrVal != null) {
updateSwitch(attrName,attrVal);
}
}
_$Dom_QueryResult_$Impl_$.on(".device-input","change",ui,function(e2) {
changeDevice(e2.at);
});
var tmp1 = _$Dom_QueryResult_$Impl_$.query(window.document.body,".device-input[id=\"dynamic\"]")[0];
changeDevice(tmp1);
var changeOption = function(e3) {
var changeOption1 = "data-" + e3.getAttribute("id");
root.setAttribute(changeOption1,e3.checked ? "yes" : "no");
};
_$Dom_QueryResult_$Impl_$.on(".debug-option-input","change",ui,function(e4) {
changeOption(e4.at);
});
var _g3 = 0;
var _g11 = _$Dom_QueryResult_$Impl_$.query(window.document.body,".debug-option-input");
while(_g3 < _g11.length) {
var e5 = _g11[_g3];
++_g3;
changeOption(e5);
}
var changeSwitch = function(e6) {
var changeSwitch1 = "data-" + e6.getAttribute("name");
var changeSwitch2 = e6.getAttribute("value");
root.setAttribute(changeSwitch1,changeSwitch2);
};
_$Dom_QueryResult_$Impl_$.on(".switch input","change",ui,function(e7) {
changeSwitch(e7.at);
});
_$Dom_QueryResult_$Impl_$.on(".switch input[name=\"orientation\"]","change",ui,function(e8) {
updateScreenRes();
triggerWindowResize();
});
var observer = new MutationObserver(function(changes,obs) {
var _g4 = 0;
while(_g4 < changes.length) {
var i = changes[_g4];
++_g4;
var name1;
var value1;
name1 = HxOverrides.substr(i.attributeName,5,null);
value1 = root.getAttribute(i.attributeName);
updateSwitch(name1,value1);
}
});
observer.observe(root,{ attributes : true});
epaper_debug_DebugUi.initialized = true;
return tink_core__$Signal_Signal_$Impl_$.filter(epaper_debug_DebugUi.changeSignal,function(_1) {
return epaper_debug_DebugUi.active;
});
};
epaper_debug_DebugUi.render = function(visible,css) {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\n
\r\n ";
ret.s += this1;
if(this.config.bg.url.length > 0) {
var this2 = "
";
ret.s += this3;
}
var this4 = "
\r\n";
ret.s += this4;
var this5 = ret.s;
return this5;
}
,mainControls: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n";
ret.s += this9;
var this10 = ret.s;
return this10;
}
,moreButton: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n \r\n \r\n";
ret.s += this5;
var this6 = ret.s;
return this6;
}
,appBackButton: function(url,icon,label) {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n \r\n\r\n";
ret.s += this11;
var this12 = ret.s;
return this12;
}
,overviewButton: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n \r\n \r\n";
ret.s += this4;
var this5 = ret.s;
return this5;
}
,customLinkButton: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n \r\n \r\n";
ret.s += this6;
var this7 = ret.s;
return this7;
}
,customerImprintButton: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n \r\n \r\n";
ret.s += this4;
var this5 = ret.s;
return this5;
}
,customerGDPRButton: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n \r\n \r\n";
ret.s += this4;
var this5 = ret.s;
return this5;
}
,spacerButton: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n";
ret.s += this1;
var this2 = ret.s;
return this2;
}
,zoomButton: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n \r\n \r\n \r\n";
ret.s += this7;
var this8 = ret.s;
return this8;
}
,fullscreenButton: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n \r\n \r\n";
ret.s += this4;
var this5 = ret.s;
return this5;
}
,logo: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n ";
ret.s += this1;
if(this.config.logo != null) {
var this2 = "\r\n
0) {
var this3 = " href=\"";
ret.s += this3;
var b = tink_template__$Html_Html_$Impl_$.escape(this.config.logo.targetLink);
ret.s += b;
var this4 = "\" target=\"_blank\"";
ret.s += this4;
}
var this5 = ">\r\n
0) {
var b2 = tink_template__$Html_Html_$Impl_$.escape(this.config.logo.targetLink);
ret.s += b2;
} else {
var this7 = "Logo";
ret.s += this7;
}
var this8 = "\" />\r\n \r\n ";
ret.s += this8;
}
var this9 = ret.s;
return this9;
}
,flashcard: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n
\r\n";
ret.s += this1;
var this2 = ret.s;
return this2;
}
,cookieBanner: function() {
var ret = tink_template__$Html_Html_$Impl_$.buffer();
var this1 = "\r\n ";
ret.s += this1;
if(this.config.cookieBanner.content.length > 0) {
var this2 = "\r\n
\r\n
";
ret.s += this2;
var b = StringTools.htmlUnescape(this.config.cookieBanner.content);
ret.s += b;
var this3 = "
\r\n
\r\n
\r\n ";
ret.s += this4;
}
var this5 = ret.s;
return this5;
}
,__class__: epaper_viewer_Core
};
var flipbook_PageMode = { __ename__ : true, __constructs__ : ["Auto","Single","Double"] };
flipbook_PageMode.Auto = ["Auto",0];
flipbook_PageMode.Auto.toString = $estr;
flipbook_PageMode.Auto.__enum__ = flipbook_PageMode;
flipbook_PageMode.Single = ["Single",1];
flipbook_PageMode.Single.toString = $estr;
flipbook_PageMode.Single.__enum__ = flipbook_PageMode;
flipbook_PageMode.Double = ["Double",2];
flipbook_PageMode.Double.toString = $estr;
flipbook_PageMode.Double.__enum__ = flipbook_PageMode;
var flipbook_BookView = function(root,options) {
var _gthis = this;
if(options == null) {
options = { };
}
if(options.firstPage == null) {
options.firstPage = 0;
}
if(options.pageMode == null) {
options.pageMode = flipbook_PageMode.Auto;
}
if(options.autoSize == null) {
options.autoSize = true;
}
this._viewportChanged = new tink_core_SignalTrigger();
this._modeChanged = new tink_core_SignalTrigger();
this.modeChanged = this._modeChanged;
this.viewportChanged = this._viewportChanged;
this.modes = new haxe_ds_StringMap();
this.root = root;
this.viewport = _$Dom_QueryResult_$Impl_$.query(root,".viewport")[0];
this.pagination = new flipbook_Pagination();
this.zoom = new flipbook_Zoom(_$Dom_QueryResult_$Impl_$.query(root,".zoomable")[0],$bind(this,this.getStep));
this.grid = new flipbook_pagegrid_Grid(this);
this.set_os(flipbook_BookView.OS);
this.pageMode = options.pageMode;
var tmp = this.get_isMobile() ? "slide" : "flip";
root.setAttribute("data-page-transition",tmp);
var lastDoubleSided = null;
this.pagination.get_pageChanged().handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
root.setAttribute("data-page",Std.string(_gthis.pagination.page));
var _this = root.classList;
var force = _gthis.pagination.get_doubleSided() && _gthis.getStep() == 1;
if(force == null) {
force = !_this.contains("center-page");
}
if(force) {
_this.add("center-page");
} else {
_this.remove("center-page");
}
var tmp1 = _gthis.pagination.get_doubleSided();
if(lastDoubleSided != tmp1) {
lastDoubleSided = _gthis.pagination.get_doubleSided();
var _this1 = root.classList;
var force1 = _gthis.pagination.get_doubleSided();
if(force1 == null) {
force1 = !_this1.contains("double-sided");
}
if(force1) {
_this1.add("double-sided");
} else {
_this1.remove("double-sided");
}
var _this2 = root.classList;
var force2 = !_gthis.pagination.get_doubleSided();
if(force2 == null) {
force2 = !_this2.contains("single-sided");
}
if(force2) {
_this2.add("single-sided");
} else {
_this2.remove("single-sided");
}
}
_gthis.zoom.enforceBounds(true);
}));
var tmp2 = this.pagination;
var options1 = options.firstPage;
var __tmp = [];
var _g = 0;
var _g1 = _$Dom_QueryResult_$Impl_$.query(root,".book .page");
while(_g < _g1.length) {
var page = _g1[_g];
++_g;
__tmp.push(new flipbook_PageView(page));
}
tmp2.setPages(options1,__tmp);
Dom.on(root.ownerDocument,"webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
var fsElement = window.document.fullscreenElement || window.document.fullScreenElement;
var _this3 = root.classList;
var force3 = root.contains(fsElement);
if(force3 == null) {
force3 = !_this3.contains("fullscreen");
}
if(force3) {
_this3.add("fullscreen");
} else {
_this3.remove("fullscreen");
}
}));
this.zoom.get_changed().handle(function(factor) {
var _this4 = root.classList;
var force4 = factor > 1;
if(force4 == null) {
force4 = !_this4.contains("zoomed");
}
if(force4) {
_this4.add("zoomed");
} else {
_this4.remove("zoomed");
}
});
if(options.autoSize) {
this.updateViewport();
Dom.on(window,"resize",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
_gthis.updateViewport({ boundsCheck : true, animated : true});
}));
}
};
flipbook_BookView.__name__ = ["flipbook","BookView"];
flipbook_BookView.prototype = {
getStep: function() {
var _g = this.pagination.get_step();
switch(_g) {
case 1:
return 1;
case 2:
var sum = 0;
var _g1 = 0;
var _g11 = this.pagination.activePages();
while(_g1 < _g11.length) {
var a = _g11[_g1];
++_g1;
if(!a.get_isEmpty()) {
++sum;
}
}
return sum;
default:
var v = _g;
throw new js__$Boot_HaxeError("assert");
}
}
,updateViewport: function(args) {
var _gthis = this;
if(args == null) {
args = { };
}
if(args.animated == null) {
args.animated = false;
}
if(args.boundsCheck == null) {
args.boundsCheck = false;
}
var obj = this.viewport.getBoundingClientRect();
var rect = new flipbook_data__$Rect_RectData(obj.top,obj.right,obj.bottom,obj.left);
var tmp;
if((rect.right - rect.left) * (rect.bottom - rect.top) != 0) {
var b = this.zoom.viewportRect;
if(rect.right == b.right && rect.bottom == b.bottom && rect.left == b.left) {
tmp = rect.top == b.top;
} else {
tmp = false;
}
} else {
tmp = true;
}
if(tmp) {
return;
}
var scale1 = Math.min((rect.right - rect.left) / this.get_bookSize().a,(rect.bottom - rect.top) / this.get_bookSize().b);
var scale2 = Math.min((rect.right - rect.left) / (2 * this.get_bookSize().a),(rect.bottom - rect.top) / this.get_bookSize().b);
var doubleSided;
var _g = this.pageMode;
switch(_g[1]) {
case 0:
doubleSided = scale2 * scale2 * 2 > scale1 * scale1;
break;
case 1:
doubleSided = false;
break;
case 2:
doubleSided = true;
break;
}
var tmp1 = this.pagination.get_doubleSided();
if(doubleSided != tmp1) {
Dom.abruptly(this.root,function() {
_gthis.pagination.set_doubleSided(doubleSided);
_gthis.pagination.jumpTo(_gthis.pagination.page,true);
});
}
this.zoom.setViewport(rect,args);
this.grid.setState(tink_state__$Observable_Observable_$Impl_$.get_value(this.grid.get_state()));
tink_core__$Callback_CallbackList_$Impl_$.invoke(this._viewportChanged.handlers,tink_core_Noise.Noise);
}
,set_os: function(param) {
this.root.setAttribute("data-os",param);
var isMobile;
var _g = flipbook_BookView.OS;
switch(_g) {
case "linux":case "mac":case "win":
isMobile = false;
break;
default:
isMobile = true;
}
if(isMobile) {
this.root.setAttribute("data-mobile","");
} else {
this.root.removeAttribute("data-mobile");
}
return param;
}
,get_isMobile: function() {
return this.root.hasAttribute("data-mobile");
}
,get_viewportChanged: function() {
return this.viewportChanged;
}
,get_bookSize: function() {
return this.zoom.bookSize;
}
,get_viewportRect: function() {
return this.zoom.viewportRect;
}
,__class__: flipbook_BookView
};
var flipbook_Mode = function() { };
flipbook_Mode.__name__ = ["flipbook","Mode"];
var flipbook_AnimationOf = function(target) {
var _gthis = this;
this._ended = new tink_core_SignalTrigger();
this._started = new tink_core_SignalTrigger();
this.target = target;
this.started = this._started;
this.ended = this._ended;
Dom.on(target,"animationstart webkitAnimationStart msAnimationStart",function(a) {
_gthis.name = a.animationName;
tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._started.handlers,a.animationName);
});
Dom.on(target,"animationend webkitAnimationEnd msAnimationEnd",function(a1) {
_gthis.name = null;
tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._ended.handlers,a1.animationName);
});
};
flipbook_AnimationOf.__name__ = ["flipbook","AnimationOf"];
flipbook_AnimationOf.prototype = {
get_started: function() {
return this.started;
}
,get_ended: function() {
return this.ended;
}
,__class__: flipbook_AnimationOf
};
var flipbook_PageView = function(target) {
this.lazy_originalSize = new tink_core__$Lazy_LazyFunc(function() {
var style = window.getComputedStyle(target);
var o_width;
var o_height;
o_width = parseFloat(style.width);
o_height = parseFloat(style.height);
var this1;
var this2 = new tink_core_MPair(o_width,o_height);
this1 = this2;
return this1;
});
this._stateChanged = new tink_core_SignalTrigger();
this.target = target;
this.stateChanged = this._stateChanged;
this.parent = target.parentElement;
this.animation = new flipbook_AnimationOf(target);
target.__view = this;
};
flipbook_PageView.__name__ = ["flipbook","PageView"];
flipbook_PageView.prototype = {
startAnimation: function(name,classes) {
var _gthis = this;
var applyClasses = function() {
if(classes != null) {
var __tink_tmp66 = classes;
var iterator_name = HxOverrides.iter(Reflect.fields(__tink_tmp66));
while(iterator_name.hasNext()) {
var name1 = iterator_name.next();
var flag = __tink_tmp66[name1];
var _this = _gthis.target.classList;
var force = flag;
if(force == null) {
force = !_this.contains(name1);
}
if(force) {
_this.add(name1);
} else {
_this.remove(name1);
}
}
}
};
if(name == null) {
Dom.toggle(this.target,"data-animation",false);
applyClasses();
return { done : new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_Noise.Noise)), cancel : function() {
}};
} else {
this.target.setAttribute("data-animation",name);
var canceled = false;
var done = this.target.childNodes.length == 0 ? new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_Noise.Noise)) : tink_core__$Future_Future_$Impl_$.async(function(cb) {
var end = function() {
var ended = function() {
return _gthis.target.getAttribute("data-animation") == name;
};
if(ended()) {
cb(tink_core_Noise.Noise);
}
var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
if(ended()) {
_gthis.target.removeAttribute("data-animation");
}
},50),$bind($_,$_.stop)));
};
var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(end,800),$bind($_,$_.stop)));
var abort = this2;
var this3 = abort;
var done1 = function(_) {
this3.dissolve();
};
tink_core__$Signal_Signal_$Impl_$.nextTime(_gthis.animation.get_started(),null).handle(done1);
tink_core__$Signal_Signal_$Impl_$.nextTime(_gthis.animation.get_ended(),null).handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
if(!canceled) {
var this4 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
end();
canceled = true;
},25),$bind($_,$_.stop)));
}
}));
});
done.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(applyClasses));
return { done : done, cancel : function() {
canceled = true;
}};
}
}
,wakeup: function() {
if(this.target.parentNode == null) {
var _g = 0;
var _g1 = this.parent.children;
while(_g < _g1.length) {
var e = _g1[_g];
++_g;
if(this.get_index() < e.__view.get_index()) {
this.parent.insertBefore(this.target,e);
break;
}
}
if(this.target.parentNode == null) {
this.parent.appendChild(this.target);
}
tink_core__$Callback_CallbackList_$Impl_$.invoke(this._stateChanged.handlers,tink_core_Noise.Noise);
}
}
,show: function(direction) {
this.wakeup();
this.target.classList.remove("hidden");
return this.startAnimation("show-" + direction);
}
,hide: function(direction) {
this.wakeup();
this.target.classList.remove("hidden");
return this.startAnimation("hide-" + direction,{ hidden : true});
}
,getThumb: function() {
var this1 = this.target.querySelector(".meta .page-thumb");
return this1;
}
,dispose: function() {
if(this.target.parentNode != null) {
this.target.parentNode.removeChild(this.target);
tink_core__$Callback_CallbackList_$Impl_$.invoke(this._stateChanged.handlers,tink_core_Noise.Noise);
}
}
,justShow: function() {
this.wakeup();
this.startAnimation(null,{ hidden : false});
}
,justHide: function() {
this.startAnimation(null,{ hidden : true});
this.dispose();
}
,get_isEmpty: function() {
return this.target.classList.contains("empty");
}
,get_index: function() {
return Std.parseInt(this.target.getAttribute("data-pos"));
}
,get_title: function() {
var _g = this.target.querySelector(".meta .page-thumb .page-title");
if(_g == null) {
return Std.string(this.get_index());
} else {
var v = _g;
return v.innerHTML;
}
}
,__class__: flipbook_PageView
};
var flipbook__$PageView_PageThumb_$Impl_$ = {};
flipbook__$PageView_PageThumb_$Impl_$.__name__ = ["flipbook","_PageView","PageThumb_Impl_"];
flipbook__$PageView_PageThumb_$Impl_$.getUrl = function(this1) {
return this1.getAttribute("data-img");
};
flipbook__$PageView_PageThumb_$Impl_$.makeElement = function(this1) {
return this1.cloneNode(true);
};
var flipbook_Pagination = function() {
this.doubleSided = false;
this._flipDone = new tink_core_SignalTrigger();
this._pageChanged = new tink_core_SignalTrigger();
this.pageChanged = this._pageChanged;
this.flipDone = this._flipDone;
this.pages = [];
};
flipbook_Pagination.__name__ = ["flipbook","Pagination"];
flipbook_Pagination.prototype = {
firstPage: function() {
return this.validatePage(0);
}
,lastPage: function() {
return this.validatePage(this.pages.length);
}
,cleanupPages: function() {
var parent = this.pages[0].target.parentElement;
var _g = 0;
var _g1 = _$Dom_QueryResult_$Impl_$.query(parent,".page.hidden");
while(_g < _g1.length) {
var p = _g1[_g];
++_g;
this.getView(p).dispose();
}
}
,set_doubleSided: function(param) {
this.doubleSided = param;
this.jumpTo(this.page);
return param;
}
,getView: function(e) {
var _g = Dom.nearest(e,".book .page");
if(_g == null) {
return null;
} else {
var v = _g;
return v.__view;
}
}
,setPages: function(start,pages) {
if(start == null) {
start = 0;
}
var _g = 0;
var _g1 = this.pages;
while(_g < _g1.length) {
var p = _g1[_g];
++_g;
p.dispose();
}
this.pages = pages;
start = this.validatePage(start);
this.jumpTo(start);
}
,setPage: function(to,force,changed) {
if(force == null) {
force = false;
}
var from = this.page;
to = this.validatePage(to);
if(from == to && !force) {
return false;
}
this.page = to;
if(changed != null) {
tink_core__$Callback_Callback_$Impl_$.invoke(changed,{ from : from, to : to});
}
tink_core__$Callback_CallbackList_$Impl_$.invoke(this._pageChanged.handlers,tink_core_Noise.Noise);
return true;
}
,animatePages: function(__tink_tmp157) {
if(__tink_tmp157 == null) {
__tink_tmp157 = { };
}
var from = __tink_tmp157.from == null ? 0 : __tink_tmp157.from;
var to = __tink_tmp157.to == null ? 0 : __tink_tmp157.to;
var oldPages = this.getPages(from);
var newPages = this.getPages(to);
var direction = to > from ? "forwards" : "backwards";
var _g = 0;
while(_g < newPages.length) {
var p = newPages[_g];
++_g;
p.wakeup();
}
var __tmp = [];
var _g1 = 0;
while(_g1 < newPages.length) {
var p1 = newPages[_g1];
++_g1;
__tmp.push(p1.target.clientTop);
}
var xs = __tmp;
var __tmp1 = [];
var _g2 = 0;
while(_g2 < oldPages.length) {
var p2 = oldPages[_g2];
++_g2;
__tmp1.push(p2.hide(direction));
}
var animations = [].concat(__tmp1);
var __tmp2 = [];
var _g3 = 0;
while(_g3 < newPages.length) {
var p3 = newPages[_g3];
++_g3;
__tmp2.push(p3.show(direction));
}
var animations1 = animations.concat(__tmp2);
var __tmp3 = [];
var _g4 = 0;
while(_g4 < animations1.length) {
var a = animations1[_g4];
++_g4;
__tmp3.push(a.done);
}
var ret = tink_core__$Future_Future_$Impl_$.ofMany(__tmp3).map(function(_) {
return tink_core_Noise.Noise;
});
return ret.gather();
}
,animateTo: function(values) {
var _gthis = this;
var this1 = this.reflow;
if(this1 != null) {
this1.dissolve();
}
this.currentFlip = tink_core__$Future_Future_$Impl_$.or(this.animatePages(values),tink_core__$Future_Future_$Impl_$.async(function(cb) {
var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
cb(tink_core_Noise.Noise);
},1000),$bind($_,$_.stop)));
}));
this.currentFlip.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
if(_gthis.page != values.to) {
var this3 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
_gthis.animateTo({ from : values.to, to : _gthis.page});
},250),$bind($_,$_.stop)));
} else {
_gthis.currentFlip = null;
if(flipbook_Pagination.isMac) {
var this4 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
if(_gthis.currentFlip == null) {
var parent = _gthis.pages[0].target.parentElement;
var _g = 0;
var _g1 = _$Dom_QueryResult_$Impl_$.query(parent,"[data-cleanup]");
while(_g < _g1.length) {
var dirty = _g1[_g];
++_g;
dirty.style.display = "none";
_gthis.fake = dirty.offsetHeight;
dirty.style.removeProperty("display");
}
}
},0),$bind($_,$_.stop)));
_gthis.reflow = this4;
}
var this5 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay($bind(_gthis,_gthis.cleanupPages),200),$bind($_,$_.stop)));
var this6 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._flipDone.handlers,tink_core_Noise.Noise);
},10),$bind($_,$_.stop)));
}
}));
}
,flipTo: function(page) {
var _gthis = this;
if(this.currentFlip == null) {
this.setPage(page,null,function(values) {
_gthis.animateTo(values);
});
var ___val = this.currentFlip;
if(___val == null) {
return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(tink_core_Noise.Noise));
} else {
return ___val;
}
} else {
this.setPage(page);
return this.currentFlip;
}
}
,validatePage: function(number) {
if(number < 2 - this.get_step()) {
number = 2 - this.get_step();
} else if(number > this.pages.length - 1) {
number = this.pages.length - 1;
}
if(this.get_doubleSided()) {
number -= number & 1;
}
return number;
}
,jumpTo: function(page,force) {
if(force == null) {
force = false;
}
var _gthis = this;
this.setPage(page,force,tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
var _g = 0;
var _g1 = _gthis.pages;
while(_g < _g1.length) {
var p = _g1[_g];
++_g;
p.justHide();
}
var _g2 = 0;
var _g11 = _gthis.getPages(_gthis.actualPage = _gthis.page);
while(_g2 < _g11.length) {
var p1 = _g11[_g2];
++_g2;
p1.justShow();
}
}));
}
,getPages: function(base) {
base = this.validatePage(base);
var ret = [];
if(this.pages.length > 0) {
ret.push(this.pages[base]);
var _g = this.pages[base + 1];
var _g1 = this.get_doubleSided();
if(_g1 != false) {
if(_g != null) {
var v = _g;
ret.push(v);
}
}
}
return ret;
}
,activePages: function() {
return this.getPages(this.page);
}
,prev: function() {
if(this.currentFlip == null) {
return this.flipTo(this.page - this.get_step());
} else {
return flipbook_Pagination.never;
}
}
,next: function() {
if(this.currentFlip == null) {
return this.flipTo(this.page + this.get_step());
} else {
return flipbook_Pagination.never;
}
}
,get_step: function() {
if(this.get_doubleSided()) {
return 2;
} else {
return 1;
}
}
,get_doubleSided: function() {
return this.doubleSided;
}
,get_pageChanged: function() {
return this.pageChanged;
}
,get_length: function() {
return this.pages.length;
}
,iterator: function() {
return HxOverrides.iter(this.pages);
}
,__class__: flipbook_Pagination
};
var flipbook_Zoom = function(zoomable,getStep) {
this.scheduledRefresh = null;
this.delayLOD = null;
this.lastLOD = .0;
this._ready = new tink_core_SignalTrigger();
this._viewportChanged = new tink_core_SignalTrigger();
this._changed = new tink_core_SignalTrigger();
this.changed = this._changed;
this.viewportChanged = this._viewportChanged;
this.ready = this._ready;
this.zoomable = zoomable;
this.book = _$Dom_QueryResult_$Impl_$.query(zoomable,".book")[0];
this.transform = tink_geom2__$Matrix_Matrix_$Impl_$.IDENTITY;
this.bookResolutions = this.book.getAttribute("data-resolutions").split(",").map(Std.parseFloat);
this.getStep = getStep;
var this1;
var this2 = new tink_core_MPair(parseFloat(this.book.style.width),parseFloat(this.book.style.height));
this1 = this2;
this.bookSize = this1;
this.viewportRect = { };
this.lastSaved = tink_geom2__$Matrix_Matrix_$Impl_$.IDENTITY;
};
flipbook_Zoom.__name__ = ["flipbook","Zoom"];
flipbook_Zoom.prototype = {
updateLevelOfDetail: function() {
var _gthis = this;
var setLOD = function() {
var requiredWidth = tink_geom2__$Matrix_Matrix_$Impl_$.scale(_gthis.transform,_gthis.get_correctionFactor()).a * _gthis.bookSize.a * flipbook_Zoom.DEVICE_PIXEL_RATIO;
var i = 0;
while(_gthis.bookResolutions[i] < requiredWidth && i < _gthis.bookResolutions.length - 1) ++i;
var _g = _gthis.book.getAttribute("data-lod");
var _g1 = Std.string(i + 1);
var b = _g;
var a = _g1;
if(a != b) {
var nu = _g1;
_gthis.book.setAttribute("data-lod",nu);
}
};
var update = function() {
_gthis.delayLOD = null;
_gthis.lastLOD = new Date().getTime();
Dom.transform(_gthis.book,"none");
setLOD();
tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._ready.handlers,tink_core_Noise.Noise);
};
var this1 = this.delayLOD;
if(this1 != null) {
this1.dissolve();
}
var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
update();
},500),$bind($_,$_.stop)));
this.delayLOD = this2;
}
,checkBounds: function(m) {
var correctionX = 0.0;
var correctionY = 0.0;
var factor = this.get_correctionFactor() * m.a;
var widthPages = this.bookSize.a * this.get_step() * factor;
var heightPages = this.bookSize.b * factor;
var this1 = this.viewportRect;
var xCorrection = Math.max((widthPages - (this1.right - this1.left)) / 2,0);
var this2 = this.viewportRect;
var yCorrection = Math.max((heightPages - (this2.bottom - this2.top)) / 2,0);
if(Math.abs(m.tx) > xCorrection) {
if(m.tx > 0) {
correctionX = xCorrection - m.tx;
} else {
correctionX = Math.abs(m.tx) - xCorrection;
}
}
if(Math.abs(m.ty) > yCorrection) {
if(m.ty > 0) {
correctionY = yCorrection - m.ty;
} else {
correctionY = Math.abs(m.ty) - yCorrection;
}
}
if(correctionX != 0 || correctionY != 0) {
var this3;
var this4 = new tink_core_MPair(correctionX,correctionY);
this3 = this4;
return tink_geom2__$Matrix_Matrix_$Impl_$.move(m,this3);
} else {
return m;
}
}
,applyTransform: function(m,__tink_tmp140,momentumScroll) {
if(momentumScroll == null) {
momentumScroll = false;
}
var _gthis = this;
if(__tink_tmp140 == null) {
__tink_tmp140 = { };
}
var animated = __tink_tmp140.animated == null ? false : __tink_tmp140.animated;
var boundsCheck = __tink_tmp140.boundsCheck == null ? true : __tink_tmp140.boundsCheck;
if(boundsCheck) {
m = this.checkBounds(m);
} else {
m = m;
}
var last = this.transform.a;
if(m.a * m.d == 0) {
m = tink_geom2__$Matrix_Matrix_$Impl_$.IDENTITY;
}
this.transform = m;
var update = function() {
_gthis.scheduledRefresh = null;
var effective = tink_geom2__$Matrix_Matrix_$Impl_$.rscale(_gthis.get_correctionFactor(),_gthis.transform);
var this1;
var this2 = new tink_core_MPair(0,0);
this1 = this2;
var topLeft = tink_geom2__$Matrix_Matrix_$Impl_$.transformPoint(effective,this1);
var this3;
var this4 = new tink_core_MPair(_gthis.bookSize.a,_gthis.bookSize.b);
this3 = this4;
var bottomRight = tink_geom2__$Matrix_Matrix_$Impl_$.transformPoint(effective,this3);
var this5;
var this6 = new tink_core_MPair(bottomRight.a - topLeft.a,bottomRight.b - topLeft.b);
this5 = this6;
var size = this5;
effective = tink_geom2__$Matrix_Matrix_$Impl_$.scale(effective,Math.floor(size.a) / size.a);
var this7 = _gthis.viewportRect;
var this8 = _gthis.viewportRect;
var this9;
var this10 = new tink_core_MPair(-(this7.right - this7.left) / 2,-(this8.bottom - this8.top) / 2);
this9 = this10;
var zero = tink_geom2__$Matrix_Matrix_$Impl_$.transformPoint(effective,this9);
var this11;
var this12 = new tink_core_MPair(Math.round(zero.a) - zero.a,Math.round(zero.b) - zero.b);
this11 = this12;
var fractions = this11;
effective = tink_geom2__$Matrix_Matrix_$Impl_$.move(effective,fractions);
var this13 = _gthis.viewportRect;
var f = (this13.right - this13.left) / 2;
var this14 = _gthis.viewportRect;
var f1 = (this14.bottom - this14.top) / 2;
var this15;
var this16 = new tink_core_MPair(f - Math.floor(f),f1 - Math.floor(f1));
this15 = this16;
var p = this15;
var this17;
var this18 = new tink_core_MPair(-p.a,-p.b);
this17 = this18;
effective = tink_geom2__$Matrix_Matrix_$Impl_$.move(effective,this17);
var this19 = _gthis.viewportRect;
var this20 = _gthis.viewportRect;
var this21;
var this22 = new tink_core_MPair(Math.round((this19.right - this19.left) / 2 * effective.a),Math.round((this20.bottom - this20.top) / 2));
this21 = this22;
effective = tink_geom2__$Matrix_Matrix_$Impl_$.move(effective,this21);
Dom.transform(_gthis.zoomable,tink_geom2__$Matrix_Matrix_$Impl_$.toString(effective));
if(last != _gthis.transform.a) {
tink_core__$Callback_CallbackList_$Impl_$.invoke(_gthis._changed.handlers,_gthis.transform.a);
}
_gthis.updateLevelOfDetail();
};
if(momentumScroll) {
if(!this.zoomable.classList.contains("momentum-scroll")) {
this.zoomable.classList.add("momentum-scroll");
Dom.once(this.zoomable,"transitionend",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
_gthis.zoomable.classList.remove("momentum-scroll");
}));
}
} else if(animated) {
if(!this.zoomable.classList.contains("animated")) {
this.zoomable.classList.add("animated");
Dom.once(this.zoomable,"transitionend",tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
_gthis.zoomable.classList.remove("animated");
}));
}
} else {
this.zoomable.classList.remove("animated");
this.zoomable.classList.remove("momentum-scroll");
}
var _g = this.zoomable.style.transform;
if(_g == null) {
update();
} else if(_g == "") {
update();
} else if(this.scheduledRefresh == null) {
Dom.transform(this.book,"scaleZ(.01)");
var this23 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
update();
},25),$bind($_,$_.stop)));
this.scheduledRefresh = this23;
}
}
,setViewport: function(nu,args) {
var b = this.viewportRect;
if(nu.right == b.right && nu.bottom == b.bottom && nu.left == b.left && nu.top == b.top) {
return;
}
var oldCorrention = this.get_correctionFactor();
var oldRect = this.viewportRect;
if(isNaN(oldCorrention) || this.get_factor() < 1.01) {
this.viewportRect = nu;
this.applyTransform(this.transform,args);
return;
}
this.viewportRect = nu;
var scale = oldCorrention / this.get_correctionFactor();
this.transform = tink_geom2__$Matrix_Matrix_$Impl_$.rscale(scale,this.transform);
this.enforceBounds();
tink_core__$Callback_CallbackList_$Impl_$.invoke(this._viewportChanged.handlers,tink_core_Noise.Noise);
}
,enforceBounds: function(animated) {
if(animated == null) {
animated = false;
}
this.applyTransform(this.transform,{ animated : animated});
}
,panTo: function(__tink_tmp141) {
if(__tink_tmp141 == null) {
__tink_tmp141 = { };
}
var x = __tink_tmp141.x == null ? flipbook_ZoomPosition.Center : __tink_tmp141.x;
var y = __tink_tmp141.y == null ? flipbook_ZoomPosition.Center : __tink_tmp141.y;
var animated = __tink_tmp141.animated == null ? true : __tink_tmp141.animated;
var toCoord = function(pos) {
switch(pos[1]) {
case 0:
return 10000000;
case 1:
return 0;
case 2:
return -10000000;
}
};
var this1 = { a : this.get_factor(), b : 0, c : 0, d : this.get_factor(), tx : toCoord(x), ty : toCoord(y)};
this.applyTransform(this1,{ animated : animated});
}
,scaleBy: function(factor,options) {
if(options == null) {
options = { };
}
if(options.animated == null) {
options.animated = false;
}
if(options.boundsCheck == null) {
options.boundsCheck = true;
}
if(options.center == null) {
var this1;
var this2 = new tink_core_MPair(0,0);
this1 = this2;
options.center = this1;
}
var oldZoom = this.transform.a;
var newZoom = oldZoom * factor;
if(newZoom > this.get_maxFactor()) {
factor = this.get_maxFactor() / oldZoom;
} else if(newZoom < 1) {
factor = 1 / oldZoom;
}
if(factor == 1) {
return;
}
var tmp = this.transform;
var p = options.center;
var this3;
var this4 = new tink_core_MPair(-p.a,-p.b);
this3 = this4;
this.applyTransform(tink_geom2__$Matrix_Matrix_$Impl_$.move(tink_geom2__$Matrix_Matrix_$Impl_$.scale(tink_geom2__$Matrix_Matrix_$Impl_$.move(tmp,this3),factor),options.center),options);
}
,scaleTo: function(factor,options) {
this.scaleBy(factor / this.get_factor(),options);
}
,calcDefaultFactor: function() {
return Math.max(2,1 / this.get_correctionFactor());
}
,toggle: function(center) {
if(this.get_factor() < 1.01) {
if(center == null) {
if(this.lastSaved.a < 1.01) {
var factor = this.calcDefaultFactor();
var this1 = { a : factor, b : 0, c : 0, d : factor, tx : 0, ty : 0};
this.lastSaved = this1;
}
this.applyTransform(this.lastSaved,{ animated : true});
} else if(!(this.lastSaved.a < 1.01)) {
this.scaleTo(this.lastSaved.a,{ animated : true, center : center});
} else {
this.scaleTo(this.calcDefaultFactor(),{ animated : true, center : center});
}
} else {
this.lastSaved = this.transform;
this.scaleTo(1,{ animated : true});
}
}
,get_changed: function() {
return this.changed;
}
,get_viewportChanged: function() {
return this.viewportChanged;
}
,get_step: function() {
return this.getStep();
}
,get_correctionFactor: function() {
var this1 = this.viewportRect;
var this2 = this.viewportRect;
return Math.min((this1.bottom - this1.top) / this.bookSize.b,(this2.right - this2.left) / (this.get_step() * this.bookSize.a));
}
,get_factor: function() {
return this.transform.a;
}
,get_maxFactor: function() {
return this.bookResolutions[this.bookResolutions.length - 1] / this.bookSize.a / this.get_correctionFactor();
}
,__class__: flipbook_Zoom
};
var flipbook_ZoomPosition = { __ename__ : true, __constructs__ : ["Start","Center","End"] };
flipbook_ZoomPosition.Start = ["Start",0];
flipbook_ZoomPosition.Start.toString = $estr;
flipbook_ZoomPosition.Start.__enum__ = flipbook_ZoomPosition;
flipbook_ZoomPosition.Center = ["Center",1];
flipbook_ZoomPosition.Center.toString = $estr;
flipbook_ZoomPosition.Center.__enum__ = flipbook_ZoomPosition;
flipbook_ZoomPosition.End = ["End",2];
flipbook_ZoomPosition.End.toString = $estr;
flipbook_ZoomPosition.End.__enum__ = flipbook_ZoomPosition;
var flipbook_data__$Rect_RectData = function(top,right,bottom,left) {
this.top = top;
this.bottom = bottom;
this.left = left;
this.right = right;
};
flipbook_data__$Rect_RectData.__name__ = ["flipbook","data","_Rect","RectData"];
flipbook_data__$Rect_RectData.prototype = {
__class__: flipbook_data__$Rect_RectData
};
var flipbook_pagegrid_GridState = { __ename__ : true, __constructs__ : ["SinglePage","All","Empty","Subset"] };
flipbook_pagegrid_GridState.SinglePage = ["SinglePage",0];
flipbook_pagegrid_GridState.SinglePage.toString = $estr;
flipbook_pagegrid_GridState.SinglePage.__enum__ = flipbook_pagegrid_GridState;
flipbook_pagegrid_GridState.All = ["All",1];
flipbook_pagegrid_GridState.All.toString = $estr;
flipbook_pagegrid_GridState.All.__enum__ = flipbook_pagegrid_GridState;
flipbook_pagegrid_GridState.Empty = ["Empty",2];
flipbook_pagegrid_GridState.Empty.toString = $estr;
flipbook_pagegrid_GridState.Empty.__enum__ = flipbook_pagegrid_GridState;
flipbook_pagegrid_GridState.Subset = function(subset) { var $x = ["Subset",3,subset]; $x.__enum__ = flipbook_pagegrid_GridState; $x.toString = $estr; return $x; };
var flipbook_pagegrid_Grid = function(book) {
this.totalHeight = 600.0;
this.totalWidth = 800.0;
this.paddingBottom = 100;
this.paddingTop = 100;
this.hSpacing = 50;
this.vSpacing = 50;
this.h = 200;
this.w = 150;
var _gthis = this;
this._clicked = new tink_core_SignalTrigger();
this.book = book;
this.view = _$Dom_QueryResult_$Impl_$.query(book.root,".page-grid")[0];
this.list = window.document.createElement("ol");
var this1 = new tink_state__$State_StateObject(flipbook_pagegrid_GridState.SinglePage,null);
this._state = this1;
this.clicked = this._clicked;
this.view.style.transformOrigin = "0 0";
this.view.classList.add("hidden");
var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
var __tmp = [];
var p = book.pagination.iterator();
while(p.hasNext()) {
var p1 = p.next();
var _g = p1.target.querySelector(".page-thumb");
if(_g != null) {
var v = _g;
__tmp.push(new flipbook_pagegrid_Item(v.cloneNode(true)));
}
}
_gthis.pages = __tmp;
var _g1 = 0;
var _g11 = _gthis.pages;
while(_g1 < _g11.length) {
var p2 = _g11[_g1];
++_g1;
_gthis.list.appendChild(p2.view);
}
_gthis.view.appendChild(_gthis.list);
_$Dom_QueryResult_$Impl_$.on(".grid-item>button","click",_gthis.view,$bind(_gthis,_gthis.handleItemClick));
var style = window.getComputedStyle(_gthis.pages[0].view);
_gthis.w = Std.parseInt(style.width);
_gthis.h = Std.parseInt(style.height);
book.zoom.get_viewportChanged().handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
var f = _gthis.get_state();
_gthis.setState(tink_state__$Observable_Observable_$Impl_$.get_value(f));
}));
},500),$bind($_,$_.stop)));
};
flipbook_pagegrid_Grid.__name__ = ["flipbook","pagegrid","Grid"];
flipbook_pagegrid_Grid.prototype = {
handleItemClick: function(e) {
var _this = this._clicked;
var event = Std.parseInt(_$Dom_QueryResult_$Impl_$.query(e.at,".page-thumb")[0].getAttribute("data-pos"));
tink_core__$Callback_CallbackList_$Impl_$.invoke(_this.handlers,event);
}
,setState: function(next) {
var _gthis = this;
this.updateTotal();
var targetPage;
var _g = this.book.pagination.page - 1;
if(_g == -1) {
targetPage = 0;
} else {
var v = _g;
targetPage = v;
}
var showNext = function(f) {
var showNext1;
switch(next[1]) {
case 1:
showNext1 = _gthis.all();
break;
case 3:
var subset = next[2];
showNext1 = _gthis.only(subset);
break;
default:
throw new js__$Boot_HaxeError("unreachable");
}
f(targetPage,showNext1);
};
var last = tink_state__$Observable_Observable_$Impl_$.get_value(this.get_state());
this._state.set(next);
switch(last[1]) {
case 0:
switch(next[1]) {
case 0:
break;
case 2:
showNext($bind(this,this.enter));
break;
default:
showNext($bind(this,this.enter));
}
break;
case 2:
switch(next[1]) {
case 0:
this.leave(targetPage);
break;
case 2:
break;
default:
showNext($bind(this,this.fromEmpty));
}
break;
default:
switch(next[1]) {
case 0:
this.leave(targetPage);
break;
case 2:
this.empty();
break;
default:
showNext($bind(this,this.switchTo));
}
}
var _this = this.view.classList;
var force = next == flipbook_pagegrid_GridState.Empty;
if(force == null) {
force = !_this.contains("empty");
}
if(force) {
_this.add("empty");
} else {
_this.remove("empty");
}
}
,empty: function() {
}
,fromEmpty: function(currentPage,transforms) {
this.changeTransforms(currentPage,transforms,function(_) {
return false;
});
}
,showAll: function() {
this.setState(flipbook_pagegrid_GridState.All);
}
,openPage: function(page) {
this.book.pagination.jumpTo(page);
this.setState(flipbook_pagegrid_GridState.SinglePage);
}
,updateHeight: function(transforms) {
this.list.style.height = transforms[transforms.length - 1].pos.b + this.h + this.paddingBottom + "px";
}
,changeTransforms: function(currentPage,transforms,inRange) {
var _gthis = this;
this.updateHeight(transforms);
var pos = transforms[currentPage].pos;
var offset = pos.b - 0.5 * (this.totalHeight - this.h);
var old = this.view.scrollTop;
this.view.scrollTop = offset | 0;
var this1;
var this2 = new tink_core_MPair(0,this.view.scrollTop - old);
this1 = this2;
var delta = this1;
var left = [];
Dom.abruptly(this.view,function() {
var iterator_p = HxOverrides.iter(_gthis.pages);
var iterator_t = HxOverrides.iter(transforms);
while(iterator_t.hasNext() && iterator_p.hasNext()) {
var p = iterator_p.next();
var t = iterator_t.next();
var a = p.pos;
var this3;
var this4 = new tink_core_MPair(a.a + delta.a,a.b + delta.b);
this3 = this4;
var shifted = this3;
if(inRange(shifted) || inRange(t.pos)) {
var p1 = p.pos = shifted;
var this5 = { a : 1, b : 0, c : 0, d : 1, tx : p1.a, ty : p1.b};
Dom.transform(p.view,tink_geom2__$Matrix_Matrix_$Impl_$.toString(this5));
left.push(t);
} else {
t.apply();
}
}
});
var _g = 0;
while(_g < left.length) {
var t1 = left[_g];
++_g;
t1.apply();
}
}
,switchTo: function(currentPage,transforms) {
var min = this.view.scrollTop - this.h;
var max = this.view.scrollTop + this.totalHeight;
this.changeTransforms(currentPage,transforms,function(p) {
if(p.b >= min) {
return p.b <= max;
} else {
return false;
}
});
}
,leave: function(currentPage) {
var _gthis = this;
this.view.classList.remove("active");
var pos = this.pages[currentPage].pos;
var offset = pos.b - 0.5 * (this.totalHeight - this.h);
var positions = [pos];
if(this.get_doubleSided() && currentPage > 0) {
if(currentPage % 2 == 0) {
var a = positions[0];
var this1;
var this2 = new tink_core_MPair(-this.w,0);
this1 = this2;
var b = this1;
var this3;
var this4 = new tink_core_MPair(a.a + b.a,a.b + b.b);
this3 = this4;
positions.push(this3);
} else {
var a1 = positions[0];
var this5;
var this6 = new tink_core_MPair(this.w,0);
this5 = this6;
var b1 = this5;
var this7;
var this8 = new tink_core_MPair(a1.a + b1.a,a1.b + b1.b);
this7 = this8;
positions.unshift(this7);
}
}
var this9;
var this10 = new tink_core_MPair(0,0);
this9 = this10;
var center = this9;
var _g = 0;
while(_g < positions.length) {
var p = positions[_g];
++_g;
var this11;
var this12 = new tink_core_MPair(center.a + p.a,center.b + p.b);
this11 = this12;
center = this11;
}
var f = 1 / positions.length;
var this13;
var this14 = new tink_core_MPair(center.a * f,center.b * f);
this13 = this14;
center = this13;
if(currentPage > 0 || !this.get_doubleSided()) {
var this15;
var this16 = new tink_core_MPair(this.w / 2,this.h / 2);
this15 = this16;
var b2 = this15;
var this17;
var this18 = new tink_core_MPair(center.a + b2.a,center.b + b2.b);
this17 = this18;
center = this17;
} else {
var this19;
var this20 = new tink_core_MPair(0,this.h / 2);
this19 = this20;
var b3 = this19;
var this21;
var this22 = new tink_core_MPair(center.a + b3.a,center.b + b3.b);
this21 = this22;
center = this21;
}
var transform = this.calcTransform(center);
var current = [];
var tohide = [];
var iterator_p = HxOverrides.iter(this.pages);
var iterator_i_step;
var iterator_i_offset;
var iterator_i_max;
var iterator_i_cur;
iterator_i_step = 1;
iterator_i_offset = 0;
iterator_i_cur = 0;
iterator_i_max = Math.ceil(this.pages.length / 1);
while(iterator_i_cur < iterator_i_max && iterator_p.hasNext()) {
var p1 = [iterator_p.next()];
var i = [iterator_i_offset + iterator_i_cur++ * iterator_i_step];
var isCurrent = i[0] == currentPage || this.get_doubleSided() && i[0] == currentPage - 1 + 2 * (currentPage % 2);
if(isCurrent) {
current.push(p1[0]);
var this23 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay((function(i1,p2) {
return function() {
p2[0].update({ opacity : 1, pos : null});
var tmp1 = tink_geom2__$Matrix_Matrix_$Impl_$.rmove(positions[i1[0] % positions.length],transform);
if(tmp1.tx < 0.001) {
var this24 = { a : tmp1.a, b : tmp1.b, c : tmp1.c, d : tmp1.d, tx : 0, ty : tmp1.ty};
tmp1 = this24;
}
if(tmp1.ty < 0.001) {
var this25 = { a : tmp1.a, b : tmp1.b, c : tmp1.c, d : tmp1.d, tx : tmp1.tx, ty : 0};
tmp1 = this25;
}
var tmp2 = tink_geom2__$Matrix_Matrix_$Impl_$.toString(tmp1) + " scaleZ(0.01)";
Dom.transform(p2[0].view,tmp2);
};
})(i,p1),1),$bind($_,$_.stop)));
} else {
tohide.push(p1[0]);
}
}
Dom.abruptly(this.view,function() {
var _g1 = 0;
while(_g1 < tohide.length) {
var p3 = tohide[_g1];
++_g1;
p3.update({ opacity : 0, pos : null});
}
});
var this26 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
Dom.abruptly(_gthis.book.viewport,function() {
_gthis.book.viewport.classList.remove("nodisplay");
});
var _g2 = 0;
while(_g2 < current.length) {
var p4 = current[_g2];
++_g2;
p4.update({ opacity : 0, pos : null});
}
var this27 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
if(!_gthis.view.classList.contains("active")) {
_gthis.view.classList.add("hidden");
}
},300),$bind($_,$_.stop)));
},350),$bind($_,$_.stop)));
}
,currentCenter: function() {
var this1;
var this2 = new tink_core_MPair(this.totalWidth / 2,this.view.scrollTop + this.totalHeight / 2);
this1 = this2;
return this1;
}
,calcTransform: function(center) {
var this1 = this.book.get_viewportRect();
var scale = (this1.bottom - this1.top) / this.h;
var this2 = this.book.get_viewportRect();
var scale1 = Math.min(scale,(this2.right - this2.left) / this.w / (this.get_doubleSided() ? 2 : 1));
var this3;
var this4 = new tink_core_MPair(-center.a,-center.b);
this3 = this4;
var ret = tink_geom2__$Matrix_Matrix_$Impl_$.invert(this.book.zoom.transform);
var factor = 1 / scale1;
var this5 = { a : factor, b : 0, c : 0, d : factor, tx : 0, ty : 0};
var ret1 = tink_geom2__$Matrix_Matrix_$Impl_$.move(tink_geom2__$Matrix_Matrix_$Impl_$.rmove(this3,tink_geom2__$Matrix_Matrix_$Impl_$.concat(ret,this5)),center);
ret1 = tink_geom2__$Matrix_Matrix_$Impl_$.invert(ret1);
var a = this.currentCenter();
var this6;
var this7 = new tink_core_MPair(a.a - center.a,a.b - center.b);
this6 = this7;
return tink_geom2__$Matrix_Matrix_$Impl_$.move(ret1,this6);
}
,enter: function(currentPage,transforms) {
var _gthis = this;
this.updateHeight(transforms);
if(currentPage >= transforms.length) {
currentPage = transforms.length - 1;
}
var pos = transforms[currentPage].pos;
var offset = pos.b - 0.5 * (this.totalHeight - this.h);
this.view.scrollTop = offset | 0;
var positions = [pos];
if(this.get_doubleSided() && currentPage > 0) {
if(currentPage % 2 == 0) {
var a = positions[0];
var this1;
var this2 = new tink_core_MPair(-this.w,0);
this1 = this2;
var b = this1;
var this3;
var this4 = new tink_core_MPair(a.a + b.a,a.b + b.b);
this3 = this4;
positions.push(this3);
} else {
var a1 = positions[0];
var this5;
var this6 = new tink_core_MPair(this.w,0);
this5 = this6;
var b1 = this5;
var this7;
var this8 = new tink_core_MPair(a1.a + b1.a,a1.b + b1.b);
this7 = this8;
positions.unshift(this7);
}
}
var this9;
var this10 = new tink_core_MPair(0,0);
this9 = this10;
var center = this9;
var _g = 0;
while(_g < positions.length) {
var p = positions[_g];
++_g;
var this11;
var this12 = new tink_core_MPair(center.a + p.a,center.b + p.b);
this11 = this12;
center = this11;
}
var f = 1 / positions.length;
var this13;
var this14 = new tink_core_MPair(center.a * f,center.b * f);
this13 = this14;
center = this13;
if(currentPage > 0 || !this.get_doubleSided()) {
var this15;
var this16 = new tink_core_MPair(this.w / 2,this.h / 2);
this15 = this16;
var b2 = this15;
var this17;
var this18 = new tink_core_MPair(center.a + b2.a,center.b + b2.b);
this17 = this18;
center = this17;
} else {
var this19;
var this20 = new tink_core_MPair(0,this.h / 2);
this19 = this20;
var b3 = this19;
var this21;
var this22 = new tink_core_MPair(center.a + b3.a,center.b + b3.b);
this21 = this22;
center = this21;
}
var transform = this.calcTransform(center);
var min = this.view.scrollTop - this.h;
var max = this.view.scrollTop + this.totalHeight;
var current = [];
var voisinage = [];
Dom.abruptly(this.view,function() {
_gthis.view.classList.remove("hidden");
var iterator_p = HxOverrides.iter(_gthis.pages);
var iterator_i_step;
var iterator_i_offset;
var iterator_i_max;
var iterator_i_cur;
iterator_i_step = 1;
iterator_i_offset = 0;
iterator_i_cur = 0;
iterator_i_max = Math.ceil(_gthis.pages.length / 1);
var iterator_t = HxOverrides.iter(transforms);
while(iterator_t.hasNext() && (iterator_i_cur < iterator_i_max && iterator_p.hasNext())) {
var p1 = iterator_p.next();
var i = iterator_i_offset + iterator_i_cur++ * iterator_i_step;
var t = iterator_t.next();
if(t.pos.b < min || t.pos.b > max) {
t.apply();
} else {
Dom.transform(p1.view,tink_geom2__$Matrix_Matrix_$Impl_$.toString(tink_geom2__$Matrix_Matrix_$Impl_$.rmove(positions[i % positions.length],transform)) + " scaleZ(0.01)");
var isCurrent = i == currentPage || _gthis.get_doubleSided() && i == currentPage - 1 + 2 * (currentPage % 2);
p1.view.style.opacity = isCurrent ? "1.0" : "0.0";
(isCurrent ? current : voisinage).push(t);
}
}
});
this.view.classList.add("active");
Dom.abruptly(this.book.viewport,function() {
_gthis.book.viewport.classList.add("nodisplay");
});
var _g1 = 0;
while(_g1 < current.length) {
var t1 = current[_g1];
++_g1;
t1.apply();
}
if(current.length == 0) {
var _g11 = 0;
var _g2 = this.book.pagination.get_step();
while(_g11 < _g2) {
var i1 = _g11++;
var tmp = voisinage.pop();
current.push(tmp);
}
}
var iterator_t1 = HxOverrides.iter(voisinage);
var iterator_i_step1;
var iterator_i_offset1;
var iterator_i_max1;
var iterator_i_cur1;
iterator_i_step1 = 1;
iterator_i_offset1 = 0;
iterator_i_cur1 = 0;
iterator_i_max1 = Math.ceil(voisinage.length / 1);
while(iterator_i_cur1 < iterator_i_max1 && iterator_t1.hasNext()) {
var t2 = [iterator_t1.next()];
var i2 = iterator_i_offset1 + iterator_i_cur1++ * iterator_i_step1;
t2[0].target.update({ opacity : 0.0, pos : current[i2 % current.length].pos});
var this23 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay((function(t3) {
return function() {
t3[0].apply();
};
})(t2),(.15 + .25 * i2 / voisinage.length) * 1000 | 0),$bind($_,$_.stop)));
}
}
,only: function(subset) {
var _gthis = this;
var y = this.paddingTop;
var x = this.get_doubleSided() ? this.totalWidth / 2 : this.totalWidth / 4;
var __tmp = [];
var iterator_p = HxOverrides.iter(this.pages);
var iterator_i_step;
var iterator_i_offset;
var iterator_i_max;
var iterator_i_cur;
iterator_i_step = 1;
iterator_i_offset = 0;
iterator_i_cur = 0;
iterator_i_max = Math.ceil(this.pages.length / 1);
while(iterator_i_cur < iterator_i_max && iterator_p.hasNext()) {
var p = iterator_p.next();
var i = iterator_i_offset + iterator_i_cur++ * iterator_i_step;
var _g = subset.h[i];
if(_g == null) {
var this1;
var this2 = new tink_core_MPair(x,y - (this.h + this.vSpacing));
this1 = this2;
__tmp.push(new flipbook_pagegrid_Transform(p,this1,.0));
} else {
var v = _g;
if(this.get_doubleSided()) {
var this3;
var this4 = new tink_core_MPair(x - i % 2 * this.w,y);
this3 = this4;
var t = new flipbook_pagegrid_Transform(p,this3,null,v);
if(i % 2 == 0 || !subset.h.hasOwnProperty(i + 1)) {
y += _gthis.h + _gthis.vSpacing;
}
__tmp.push(t);
} else {
var this5;
var this6 = new tink_core_MPair(x,y);
this5 = this6;
var t1 = new flipbook_pagegrid_Transform(p,this5,null,v);
y += _gthis.h + _gthis.vSpacing;
__tmp.push(t1);
}
}
}
return __tmp;
}
,updateTotal: function() {
var rect = this.view.getBoundingClientRect();
this.totalWidth = rect.width;
this.totalHeight = rect.height;
}
,all: function() {
var _gthis = this;
var chunkWidth = this.hSpacing + (this.get_doubleSided() ? 2 * this.w : this.w);
var offset = (this.totalWidth % chunkWidth + this.hSpacing) / 2;
var x = offset;
var y = this.paddingTop;
if(this.get_doubleSided()) {
var __tmp = [];
var iterator_p = HxOverrides.iter(this.pages);
var iterator_i_step;
var iterator_i_offset;
var iterator_i_max;
var iterator_i_cur;
iterator_i_step = 1;
iterator_i_offset = 0;
iterator_i_cur = 0;
iterator_i_max = Math.ceil(this.pages.length / 1);
while(iterator_i_cur < iterator_i_max && iterator_p.hasNext()) {
var p = iterator_p.next();
var i = iterator_i_offset + iterator_i_cur++ * iterator_i_step;
if(i % 2 == 1) {
var this1;
var this2 = new tink_core_MPair(x,y);
this1 = this2;
__tmp.push(new flipbook_pagegrid_Transform(p,this1));
} else {
var this3;
var this4 = new tink_core_MPair(x + this.w,y);
this3 = this4;
var t = new flipbook_pagegrid_Transform(p,this3);
x += chunkWidth;
if(x + chunkWidth > _gthis.totalWidth + _gthis.hSpacing) {
x = offset;
y += _gthis.h + _gthis.vSpacing;
}
__tmp.push(t);
}
}
return __tmp;
} else {
var __tmp1 = [];
var _g = 0;
var _g1 = this.pages;
while(_g < _g1.length) {
var p1 = _g1[_g];
++_g;
var this5;
var this6 = new tink_core_MPair(x,y);
this5 = this6;
var t1 = new flipbook_pagegrid_Transform(p1,this5);
x += chunkWidth;
if(x + chunkWidth > _gthis.totalWidth + _gthis.hSpacing) {
x = offset;
y += _gthis.h + _gthis.vSpacing;
}
__tmp1.push(t1);
}
return __tmp1;
}
}
,get_state: function() {
return this._state;
}
,get_clicked: function() {
return this.clicked;
}
,get_doubleSided: function() {
return this.book.pagination.get_doubleSided();
}
,__class__: flipbook_pagegrid_Grid
};
var flipbook_pagegrid_Item = function(thumb) {
this.view = window.document.createElement("li");
var this1;
var this2 = new tink_core_MPair(0,0);
this1 = this2;
this.pos = this1;
var div = window.document.createElement("div");
div.className = "details";
this.detailsView = div;
this.view.className = "grid-item";
var button = window.document.createElement("button");
button.className = "grid-item__button button-resetted";
button.appendChild(thumb);
this.view.appendChild(button);
};
flipbook_pagegrid_Item.__name__ = ["flipbook","pagegrid","Item"];
flipbook_pagegrid_Item.prototype = {
update: function(__tink_tmp145) {
var pos = __tink_tmp145.pos;
var details = __tink_tmp145.details == null ? tink_template__$Html_Html_$Impl_$.escape("") : __tink_tmp145.details;
var opacity = __tink_tmp145.opacity == null ? 1.0 : __tink_tmp145.opacity;
if(pos != null) {
var p = this.pos = pos;
var this1 = { a : 1, b : 0, c : 0, d : 1, tx : p.a, ty : p.b};
this.view.style.transform = tink_geom2__$Matrix_Matrix_$Impl_$.toString(this1);
}
if(this.view.style.opacity != (opacity == null ? "null" : "" + opacity)) {
this.view.style.opacity = opacity == null ? "null" : "" + opacity;
}
var zIndex = opacity == 0 ? "0" : "1";
if(zIndex != this.view.style.zIndex) {
if(zIndex == null) {
this.view.style.removeProperty("z-index");
} else {
this.view.style.setProperty("z-index",zIndex);
}
}
var _g = this.details = details;
if(_g == "") {
this.detailsView.classList.remove("active");
} else {
this.detailsView.innerHTML = details;
this.detailsView.classList.add("active");
}
}
,__class__: flipbook_pagegrid_Item
};
var flipbook_pagegrid_Transform = function(target,pos,opacity,details) {
if(opacity == null) {
opacity = 1.0;
}
this.target = target;
this.pos = pos;
this.opacity = opacity;
this.details = details;
};
flipbook_pagegrid_Transform.__name__ = ["flipbook","pagegrid","Transform"];
flipbook_pagegrid_Transform.prototype = {
apply: function(target) {
if(target == null) {
target = this.target;
}
target.update(this);
}
,__class__: flipbook_pagegrid_Transform
};
var haxe_StackItem = { __ename__ : true, __constructs__ : ["CFunction","Module","FilePos","Method","LocalFunction"] };
haxe_StackItem.CFunction = ["CFunction",0];
haxe_StackItem.CFunction.toString = $estr;
haxe_StackItem.CFunction.__enum__ = haxe_StackItem;
haxe_StackItem.Module = function(m) { var $x = ["Module",1,m]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; };
haxe_StackItem.FilePos = function(s,file,line) { var $x = ["FilePos",2,s,file,line]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; };
haxe_StackItem.Method = function(classname,method) { var $x = ["Method",3,classname,method]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; };
haxe_StackItem.LocalFunction = function(v) { var $x = ["LocalFunction",4,v]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; };
var haxe_IMap = function() { };
haxe_IMap.__name__ = ["haxe","IMap"];
haxe_IMap.prototype = {
__class__: haxe_IMap
};
var haxe_Timer = function(time_ms) {
var me = this;
this.id = setInterval(function() {
me.run();
},time_ms);
};
haxe_Timer.__name__ = ["haxe","Timer"];
haxe_Timer.delay = function(f,time_ms) {
var t = new haxe_Timer(time_ms);
t.run = function() {
t.stop();
f();
};
return t;
};
haxe_Timer.prototype = {
stop: function() {
if(this.id == null) {
return;
}
clearInterval(this.id);
this.id = null;
}
,run: function() {
}
,__class__: haxe_Timer
};
var haxe_ds_IntMap = function() {
this.h = { };
};
haxe_ds_IntMap.__name__ = ["haxe","ds","IntMap"];
haxe_ds_IntMap.__interfaces__ = [haxe_IMap];
haxe_ds_IntMap.prototype = {
set: function(key,value) {
this.h[key] = value;
}
,get: function(key) {
return this.h[key];
}
,remove: function(key) {
if(!this.h.hasOwnProperty(key)) {
return false;
}
delete(this.h[key]);
return true;
}
,keys: function() {
var a = [];
for( var key in this.h ) if(this.h.hasOwnProperty(key)) {
a.push(key | 0);
}
return HxOverrides.iter(a);
}
,iterator: function() {
return { ref : this.h, it : this.keys(), hasNext : function() {
return this.it.hasNext();
}, next : function() {
var i = this.it.next();
return this.ref[i];
}};
}
,__class__: haxe_ds_IntMap
};
var haxe_ds_ObjectMap = function() {
this.h = { __keys__ : { }};
};
haxe_ds_ObjectMap.__name__ = ["haxe","ds","ObjectMap"];
haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap];
haxe_ds_ObjectMap.prototype = {
set: function(key,value) {
var id = key.__id__ || (key.__id__ = ++haxe_ds_ObjectMap.count);
this.h[id] = value;
this.h.__keys__[id] = key;
}
,get: function(key) {
return this.h[key.__id__];
}
,keys: function() {
var a = [];
for( var key in this.h.__keys__ ) {
if(this.h.hasOwnProperty(key)) {
a.push(this.h.__keys__[key]);
}
}
return HxOverrides.iter(a);
}
,iterator: function() {
return { ref : this.h, it : this.keys(), hasNext : function() {
return this.it.hasNext();
}, next : function() {
var i = this.it.next();
return this.ref[i.__id__];
}};
}
,__class__: haxe_ds_ObjectMap
};
var haxe_ds__$StringMap_StringMapIterator = function(map,keys) {
this.map = map;
this.keys = keys;
this.index = 0;
this.count = keys.length;
};
haxe_ds__$StringMap_StringMapIterator.__name__ = ["haxe","ds","_StringMap","StringMapIterator"];
haxe_ds__$StringMap_StringMapIterator.prototype = {
hasNext: function() {
return this.index < this.count;
}
,next: function() {
var _this = this.map;
var key = this.keys[this.index++];
if(__map_reserved[key] != null) {
return _this.getReserved(key);
} else {
return _this.h[key];
}
}
,__class__: haxe_ds__$StringMap_StringMapIterator
};
var haxe_ds_StringMap = function() {
this.h = { };
};
haxe_ds_StringMap.__name__ = ["haxe","ds","StringMap"];
haxe_ds_StringMap.__interfaces__ = [haxe_IMap];
haxe_ds_StringMap.prototype = {
set: function(key,value) {
if(__map_reserved[key] != null) {
this.setReserved(key,value);
} else {
this.h[key] = value;
}
}
,get: function(key) {
if(__map_reserved[key] != null) {
return this.getReserved(key);
}
return this.h[key];
}
,setReserved: function(key,value) {
if(this.rh == null) {
this.rh = { };
}
this.rh["$" + key] = value;
}
,getReserved: function(key) {
if(this.rh == null) {
return null;
} else {
return this.rh["$" + key];
}
}
,existsReserved: function(key) {
if(this.rh == null) {
return false;
}
return this.rh.hasOwnProperty("$" + key);
}
,remove: function(key) {
if(__map_reserved[key] != null) {
key = "$" + key;
if(this.rh == null || !this.rh.hasOwnProperty(key)) {
return false;
}
delete(this.rh[key]);
return true;
} else {
if(!this.h.hasOwnProperty(key)) {
return false;
}
delete(this.h[key]);
return true;
}
}
,keys: function() {
return HxOverrides.iter(this.arrayKeys());
}
,arrayKeys: function() {
var out = [];
for( var key in this.h ) {
if(this.h.hasOwnProperty(key)) {
out.push(key);
}
}
if(this.rh != null) {
for( var key in this.rh ) {
if(key.charCodeAt(0) == 36) {
out.push(key.substr(1));
}
}
}
return out;
}
,__class__: haxe_ds_StringMap
};
var haxe_io_Eof = function() { };
haxe_io_Eof.__name__ = ["haxe","io","Eof"];
haxe_io_Eof.prototype = {
toString: function() {
return "Eof";
}
,__class__: haxe_io_Eof
};
var haxe_xml_XmlParserException = function(message,xml,position) {
this.xml = xml;
this.message = message;
this.position = position;
this.lineNumber = 1;
this.positionAtLine = 0;
var _g1 = 0;
var _g = position;
while(_g1 < _g) {
var i = _g1++;
var c = xml.charCodeAt(i);
if(c == 10) {
this.lineNumber++;
this.positionAtLine = 0;
} else if(c != 13) {
this.positionAtLine++;
}
}
};
haxe_xml_XmlParserException.__name__ = ["haxe","xml","XmlParserException"];
haxe_xml_XmlParserException.prototype = {
toString: function() {
return Type.getClassName(js_Boot.getClass(this)) + ": " + this.message + " at line " + this.lineNumber + " char " + this.positionAtLine;
}
,__class__: haxe_xml_XmlParserException
};
var haxe_xml_Parser = function() { };
haxe_xml_Parser.__name__ = ["haxe","xml","Parser"];
haxe_xml_Parser.parse = function(str,strict) {
if(strict == null) {
strict = false;
}
var doc = Xml.createDocument();
haxe_xml_Parser.doParse(str,strict,0,doc);
return doc;
};
haxe_xml_Parser.doParse = function(str,strict,p,parent) {
if(p == null) {
p = 0;
}
var xml = null;
var state = 1;
var next = 1;
var aname = null;
var start = 0;
var nsubs = 0;
var nbrackets = 0;
var c = str.charCodeAt(p);
var buf = new StringBuf();
var escapeNext = 1;
var attrValQuote = -1;
while(c == c) {
switch(state) {
case 0:
switch(c) {
case 9:case 10:case 13:case 32:
break;
default:
state = next;
continue;
}
break;
case 1:
if(c == 60) {
state = 0;
next = 2;
} else {
start = p;
state = 13;
continue;
}
break;
case 2:
switch(c) {
case 33:
if(str.charCodeAt(p + 1) == 91) {
p += 2;
if(HxOverrides.substr(str,p,6).toUpperCase() != "CDATA[") {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected = 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
if(p == start) {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected node name",str,p));
}
xml = Xml.createElement(HxOverrides.substr(str,start,p - start));
parent.addChild(xml);
++nsubs;
state = 0;
next = 4;
continue;
}
break;
case 4:
switch(c) {
case 47:
state = 11;
break;
case 62:
state = 9;
break;
default:
state = 5;
start = p;
continue;
}
break;
case 5:
if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
var tmp;
if(start == p) {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected attribute name",str,p));
}
tmp = HxOverrides.substr(str,start,p - start);
aname = tmp;
if(xml.exists(aname)) {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Duplicate attribute [" + aname + "]",str,p));
}
state = 0;
next = 6;
continue;
}
break;
case 6:
if(c == 61) {
state = 0;
next = 7;
} else {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected =",str,p));
}
break;
case 7:
switch(c) {
case 34:case 39:
buf = new StringBuf();
state = 8;
start = p + 1;
attrValQuote = c;
break;
default:
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected \"",str,p));
}
break;
case 8:
switch(c) {
case 38:
var len = p - start;
buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len);
state = 18;
escapeNext = 8;
start = p + 1;
break;
case 60:case 62:
if(strict) {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Invalid unescaped " + String.fromCharCode(c) + " in attribute value",str,p));
} else if(c == attrValQuote) {
var len1 = p - start;
buf.b += len1 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len1);
var val = buf.b;
buf = new StringBuf();
xml.set(aname,val);
state = 0;
next = 4;
}
break;
default:
if(c == attrValQuote) {
var len2 = p - start;
buf.b += len2 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len2);
var val1 = buf.b;
buf = new StringBuf();
xml.set(aname,val1);
state = 0;
next = 4;
}
}
break;
case 9:
p = haxe_xml_Parser.doParse(str,strict,p,xml);
start = p;
state = 1;
break;
case 10:
if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
if(start == p) {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected node name",str,p));
}
var v = HxOverrides.substr(str,start,p - start);
if(parent.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + parent.nodeType);
}
if(v != parent.nodeName) {
if(parent.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + parent.nodeType);
}
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected " + parent.nodeName + ">",str,p));
}
state = 0;
next = 12;
continue;
}
break;
case 11:
if(c == 62) {
state = 1;
} else {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected >",str,p));
}
break;
case 12:
if(c == 62) {
if(nsubs == 0) {
parent.addChild(Xml.createPCData(""));
}
return p;
} else {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Expected >",str,p));
}
break;
case 13:
if(c == 60) {
var len3 = p - start;
buf.b += len3 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len3);
var child = Xml.createPCData(buf.b);
buf = new StringBuf();
parent.addChild(child);
++nsubs;
state = 0;
next = 2;
} else if(c == 38) {
var len4 = p - start;
buf.b += len4 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len4);
state = 18;
escapeNext = 13;
start = p + 1;
}
break;
case 14:
if(c == 63 && str.charCodeAt(p + 1) == 62) {
++p;
var str1 = HxOverrides.substr(str,start + 1,p - start - 2);
parent.addChild(Xml.createProcessingInstruction(str1));
++nsubs;
state = 1;
}
break;
case 15:
if(c == 45 && str.charCodeAt(p + 1) == 45 && str.charCodeAt(p + 2) == 62) {
parent.addChild(Xml.createComment(HxOverrides.substr(str,start,p - start)));
++nsubs;
p += 2;
state = 1;
}
break;
case 16:
if(c == 91) {
++nbrackets;
} else if(c == 93) {
--nbrackets;
} else if(c == 62 && nbrackets == 0) {
parent.addChild(Xml.createDocType(HxOverrides.substr(str,start,p - start)));
++nsubs;
state = 1;
}
break;
case 17:
if(c == 93 && str.charCodeAt(p + 1) == 93 && str.charCodeAt(p + 2) == 62) {
var child1 = Xml.createCData(HxOverrides.substr(str,start,p - start));
parent.addChild(child1);
++nsubs;
p += 2;
state = 1;
}
break;
case 18:
if(c == 59) {
var s = HxOverrides.substr(str,start,p - start);
if(s.charCodeAt(0) == 35) {
var c1 = s.charCodeAt(1) == 120 ? Std.parseInt("0" + HxOverrides.substr(s,1,s.length - 1)) : Std.parseInt(HxOverrides.substr(s,1,s.length - 1));
buf.b += String.fromCharCode(c1);
} else {
var _this = haxe_xml_Parser.escapes;
if(!(__map_reserved[s] != null ? _this.existsReserved(s) : _this.h.hasOwnProperty(s))) {
if(strict) {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Undefined entity: " + s,str,p));
}
buf.b += Std.string("&" + s + ";");
} else {
var _this1 = haxe_xml_Parser.escapes;
var x = __map_reserved[s] != null ? _this1.getReserved(s) : _this1.h[s];
buf.b += Std.string(x);
}
}
start = p + 1;
state = escapeNext;
} else if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45) && c != 35) {
if(strict) {
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Invalid character in entity: " + String.fromCharCode(c),str,p));
}
buf.b += "&";
var len5 = p - start;
buf.b += len5 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len5);
start = p--;
state = escapeNext;
}
break;
}
c = str.charCodeAt(++p);
}
if(state == 1) {
start = p;
state = 13;
}
if(state == 13) {
if(p != start || nsubs == 0) {
var len6 = p - start;
buf.b += len6 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len6);
parent.addChild(Xml.createPCData(buf.b));
++nsubs;
}
return p;
}
if(!strict && state == 18 && escapeNext == 13) {
buf.b += "&";
var len7 = p - start;
buf.b += len7 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len7);
parent.addChild(Xml.createPCData(buf.b));
++nsubs;
return p;
}
throw new js__$Boot_HaxeError(new haxe_xml_XmlParserException("Unexpected end",str,p));
};
var haxe_xml_Printer = function(pretty) {
this.output = new StringBuf();
this.pretty = pretty;
};
haxe_xml_Printer.__name__ = ["haxe","xml","Printer"];
haxe_xml_Printer.print = function(xml,pretty) {
if(pretty == null) {
pretty = false;
}
var printer = new haxe_xml_Printer(pretty);
printer.writeNode(xml,"");
return printer.output.b;
};
haxe_xml_Printer.prototype = {
writeNode: function(value,tabs) {
var _g = value.nodeType;
switch(_g) {
case 0:
this.output.b += Std.string(tabs + "<");
if(value.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + value.nodeType);
}
this.output.b += Std.string(value.nodeName);
var attribute = value.attributes();
while(attribute.hasNext()) {
var attribute1 = attribute.next();
this.output.b += Std.string(" " + attribute1 + "=\"");
var input = StringTools.htmlEscape(value.get(attribute1),true);
this.output.b += Std.string(input);
this.output.b += "\"";
}
if(this.hasChildren(value)) {
this.output.b += ">";
if(this.pretty) {
this.output.b += "\n";
}
if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + value.nodeType);
}
var child = HxOverrides.iter(value.children);
while(child.hasNext()) {
var child1 = child.next();
this.writeNode(child1,this.pretty ? tabs + "\t" : tabs);
}
this.output.b += Std.string(tabs + "");
if(value.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + value.nodeType);
}
this.output.b += Std.string(value.nodeName);
this.output.b += ">";
if(this.pretty) {
this.output.b += "\n";
}
} else {
this.output.b += "/>";
if(this.pretty) {
this.output.b += "\n";
}
}
break;
case 1:
if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + value.nodeType);
}
var nodeValue = value.nodeValue;
if(nodeValue.length != 0) {
var input1 = tabs + StringTools.htmlEscape(nodeValue);
this.output.b += Std.string(input1);
if(this.pretty) {
this.output.b += "\n";
}
}
break;
case 2:
this.output.b += Std.string(tabs + "";
if(this.pretty) {
this.output.b += "\n";
}
break;
case 3:
if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + value.nodeType);
}
var commentContent = value.nodeValue;
var _this_r = new RegExp("[\n\r\t]+","g".split("u").join(""));
commentContent = commentContent.replace(_this_r,"");
commentContent = "";
this.output.b += tabs == null ? "null" : "" + tabs;
var input3 = StringTools.trim(commentContent);
this.output.b += Std.string(input3);
if(this.pretty) {
this.output.b += "\n";
}
break;
case 4:
if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + value.nodeType);
}
this.output.b += Std.string("");
if(this.pretty) {
this.output.b += "\n";
}
break;
case 5:
if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + value.nodeType);
}
this.output.b += Std.string("" + value.nodeValue + "?>");
if(this.pretty) {
this.output.b += "\n";
}
break;
case 6:
if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + value.nodeType);
}
var child2 = HxOverrides.iter(value.children);
while(child2.hasNext()) {
var child3 = child2.next();
this.writeNode(child3,tabs);
}
break;
}
}
,hasChildren: function(value) {
if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + value.nodeType);
}
var child = HxOverrides.iter(value.children);
while(child.hasNext()) {
var child1 = child.next();
var _g = child1.nodeType;
switch(_g) {
case 0:case 1:
return true;
case 2:case 3:
if(child1.nodeType == Xml.Document || child1.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + child1.nodeType);
}
if(StringTools.ltrim(child1.nodeValue).length != 0) {
return true;
}
break;
default:
}
}
return false;
}
,__class__: haxe_xml_Printer
};
var js__$Boot_HaxeError = function(val) {
Error.call(this);
this.val = val;
this.message = String(val);
if(Error.captureStackTrace) {
Error.captureStackTrace(this,js__$Boot_HaxeError);
}
};
js__$Boot_HaxeError.__name__ = ["js","_Boot","HaxeError"];
js__$Boot_HaxeError.wrap = function(val) {
if((val instanceof Error)) {
return val;
} else {
return new js__$Boot_HaxeError(val);
}
};
js__$Boot_HaxeError.__super__ = Error;
js__$Boot_HaxeError.prototype = $extend(Error.prototype,{
__class__: js__$Boot_HaxeError
});
var js_Boot = function() { };
js_Boot.__name__ = ["js","Boot"];
js_Boot.getClass = function(o) {
if((o instanceof Array) && o.__enum__ == null) {
return Array;
} else {
var cl = o.__class__;
if(cl != null) {
return cl;
}
var name = js_Boot.__nativeClassName(o);
if(name != null) {
return js_Boot.__resolveNativeClass(name);
}
return null;
}
};
js_Boot.__string_rec = function(o,s) {
if(o == null) {
return "null";
}
if(s.length >= 5) {
return "<...>";
}
var t = typeof(o);
if(t == "function" && (o.__name__ || o.__ename__)) {
t = "object";
}
switch(t) {
case "function":
return "
";
case "object":
if(o instanceof Array) {
if(o.__enum__) {
if(o.length == 2) {
return o[0];
}
var str = o[0] + "(";
s += "\t";
var _g1 = 2;
var _g = o.length;
while(_g1 < _g) {
var i = _g1++;
if(i != 2) {
str += "," + js_Boot.__string_rec(o[i],s);
} else {
str += js_Boot.__string_rec(o[i],s);
}
}
return str + ")";
}
var l = o.length;
var i1;
var str1 = "[";
s += "\t";
var _g11 = 0;
var _g2 = l;
while(_g11 < _g2) {
var i2 = _g11++;
str1 += (i2 > 0 ? "," : "") + js_Boot.__string_rec(o[i2],s);
}
str1 += "]";
return str1;
}
var tostr;
try {
tostr = o.toString;
} catch( e ) {
return "???";
}
if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
var s2 = o.toString();
if(s2 != "[object Object]") {
return s2;
}
}
var k = null;
var str2 = "{\n";
s += "\t";
var hasp = o.hasOwnProperty != null;
for( var k in o ) {
if(hasp && !o.hasOwnProperty(k)) {
continue;
}
if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
continue;
}
if(str2.length != 2) {
str2 += ", \n";
}
str2 += s + k + " : " + js_Boot.__string_rec(o[k],s);
}
s = s.substring(1);
str2 += "\n" + s + "}";
return str2;
case "string":
return o;
default:
return String(o);
}
};
js_Boot.__interfLoop = function(cc,cl) {
if(cc == null) {
return false;
}
if(cc == cl) {
return true;
}
var intf = cc.__interfaces__;
if(intf != null) {
var _g1 = 0;
var _g = intf.length;
while(_g1 < _g) {
var i = _g1++;
var i1 = intf[i];
if(i1 == cl || js_Boot.__interfLoop(i1,cl)) {
return true;
}
}
}
return js_Boot.__interfLoop(cc.__super__,cl);
};
js_Boot.__instanceof = function(o,cl) {
if(cl == null) {
return false;
}
switch(cl) {
case Array:
if((o instanceof Array)) {
return o.__enum__ == null;
} else {
return false;
}
break;
case Bool:
return typeof(o) == "boolean";
case Dynamic:
return true;
case Float:
return typeof(o) == "number";
case Int:
if(typeof(o) == "number") {
return (o|0) === o;
} else {
return false;
}
break;
case String:
return typeof(o) == "string";
default:
if(o != null) {
if(typeof(cl) == "function") {
if(o instanceof cl) {
return true;
}
if(js_Boot.__interfLoop(js_Boot.getClass(o),cl)) {
return true;
}
} else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) {
if(o instanceof cl) {
return true;
}
}
} else {
return false;
}
if(cl == Class ? o.__name__ != null : false) {
return true;
}
if(cl == Enum ? o.__ename__ != null : false) {
return true;
}
return o.__enum__ == cl;
}
};
js_Boot.__cast = function(o,t) {
if(js_Boot.__instanceof(o,t)) {
return o;
} else {
throw new js__$Boot_HaxeError("Cannot cast " + Std.string(o) + " to " + Std.string(t));
}
};
js_Boot.__nativeClassName = function(o) {
var name = js_Boot.__toStr.call(o).slice(8,-1);
if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") {
return null;
}
return name;
};
js_Boot.__isNativeObj = function(o) {
return js_Boot.__nativeClassName(o) != null;
};
js_Boot.__resolveNativeClass = function(name) {
return $global[name];
};
var js_Cookie = function() { };
js_Cookie.__name__ = ["js","Cookie"];
js_Cookie.set = function(name,value,expireDelay,path,domain) {
var s = name + "=" + encodeURIComponent(value);
if(expireDelay != null) {
var t = new Date().getTime() + expireDelay * 1000;
var d = new Date(t);
s += ";expires=" + d.toGMTString();
}
if(path != null) {
s += ";path=" + path;
}
if(domain != null) {
s += ";domain=" + domain;
}
window.document.cookie = s;
};
var scroller_Scroller = function(target) {
this.target = target;
this.scrollContainer = target.querySelector(".scroll-container");
this.scrollBox = target.querySelector(".scroll-box");
this.scrollContent = target.querySelector(".scroll-content");
this.virtualScrollBar = target.querySelector(".virtual-scollbar");
window.requestAnimationFrame($bind(this,this.evaluateScrolling));
};
scroller_Scroller.__name__ = ["scroller","Scroller"];
scroller_Scroller.prototype = {
evaluateScrolling: function(timestamp) {
var _gthis = this;
if(!window.document.body.contains(this.scrollContainer)) {
return;
}
this.containerStyle = window.getComputedStyle(this.scrollContainer);
this.containerInvisible = this.scrollContainer.offsetParent == null || this.containerStyle.opacity == "0" || this.containerStyle.visibility == "hidden";
if(this.containerInvisible) {
var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
window.requestAnimationFrame($bind(_gthis,_gthis.evaluateScrolling));
return;
},200),$bind($_,$_.stop)));
} else {
var this2 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
window.requestAnimationFrame($bind(_gthis,_gthis.evaluateScrolling));
},10),$bind($_,$_.stop)));
}
this.scrollBoxWidth = this.scrollBox.getBoundingClientRect().width;
this.scrollContentWidth = this.scrollContent.getBoundingClientRect().width;
this.scrollContainerWidth = this.scrollContainer.getBoundingClientRect().width;
this.scrollContainerHeight = this.scrollContainer.getBoundingClientRect().height;
this.scrollContentHeight = this.scrollContent.getBoundingClientRect().height;
this.scrollBarWidth = this.scrollBoxWidth - this.scrollContentWidth;
if(this.scrollBarWidth > 0) {
if(this.scrollContentWidth < this.scrollContainerWidth) {
this.scrollBox.setAttribute("style","width: calc(100% + " + this.scrollBarWidth + "px);");
}
} else if(this.scrollBox.hasAttribute("style")) {
this.scrollBox.removeAttribute("style");
}
this.handleRatio = this.scrollContainerHeight / this.scrollContentHeight;
if(this.handleRatio > 1) {
this.handleRatio = 1;
}
if(this.handleRatio < 1) {
if(!this.scrollContainer.hasAttribute("data-scrollable")) {
this.scrollContainer.setAttribute("data-scrollable","");
}
} else if(this.scrollContainer.hasAttribute("data-scrollable")) {
this.scrollContainer.removeAttribute("data-scrollable");
}
this.handleOffsetY = this.scrollBox.scrollTop / this.scrollBox.scrollHeight * this.scrollContainerHeight / this.handleRatio;
this.virtualScrollBar.style.transform = "scaleY(" + this.handleRatio + ") translateY(" + this.handleOffsetY + "px)";
}
,__class__: scroller_Scroller
};
var slider_Slider = function(target,thumb,past,future,track,data,edit) {
var _gthis = this;
if(thumb == null) {
thumb = slider_Slider.grab(target,"thumb");
}
if(past == null) {
past = slider_Slider.grab(target,"past");
}
if(future == null) {
future = slider_Slider.grab(target,"future");
}
if(track == null) {
track = slider_Slider.grab(target,"track");
}
this.target = target;
this.thumb = thumb;
this.past = past;
this.future = future;
this.track = track;
this.data = data;
this.edit = edit;
this.lastValue = NaN;
tink_state__$Observable_Observable_$Impl_$.bind(data,null,$bind(this,this.updateView));
this.setUpInput({ start : "mousedown", change : "mousemove", end : "mouseup", getPos : function(e) {
if(_gthis.get_vertical()) {
return e.clientY;
} else {
return e.clientX;
}
}});
this.setUpInput({ start : "touchstart", change : "touchmove", end : "touchend", getPos : function(e1) {
if(_gthis.get_vertical()) {
return e1.touches[0].clientY;
} else {
return e1.touches[0].clientX;
}
}});
};
slider_Slider.__name__ = ["slider","Slider"];
slider_Slider.grab = function(within,className,tag) {
if(tag == null) {
tag = "div";
}
var _g = within.getElementsByClassName(className)[0];
var tmp;
if(_g == null) {
var ret = window.document.createElement(tag);
ret.className = className;
within.appendChild(ret);
tmp = ret;
} else {
var v = _g;
tmp = v;
}
return tmp;
};
slider_Slider.prototype = {
setUpInput: function(input) {
var _gthis = this;
Dom.on(this.target,input.start,function(event) {
_gthis.target.classList.add("active");
var bounds = _gthis.track.getBoundingClientRect();
var min = _gthis.get_vertical() ? bounds.top : bounds.left;
var max = _gthis.get_vertical() ? bounds.bottom : bounds.right;
var update = function(event1) {
var _gthis1 = _gthis.edit;
var update1 = input.getPos(event1) - min;
_gthis1(_gthis.clamp(update1 / (max - min)));
};
var cancel = Dom.on(_gthis.target.ownerDocument,input.change,update);
update(event);
Dom.on(_gthis.target.ownerDocument,input.end,tink_core__$Callback_Callback_$Impl_$.fromNiladic(function() {
if(cancel != null) {
cancel.dissolve();
}
var this1 = new tink_core__$Callback_SimpleLink(($_=haxe_Timer.delay(function() {
_gthis.target.classList.remove("active");
},250),$bind($_,$_.stop)));
_gthis.target.blur();
}));
});
}
,clamp: function(value) {
if(value > 1) {
return 1;
} else if(value < 0) {
return 0;
} else {
return value;
}
}
,updateView: function(val) {
var nextValue = this.clamp(val);
if(this.lastValue == nextValue) {
return;
}
this.lastValue = nextValue;
var percent = nextValue * 100 + "%";
if(this.get_vertical()) {
this.thumb.style.top = percent;
} else {
this.thumb.style.left = percent;
}
this.past.style.flexGrow = Std.string(this.lastValue);
this.future.style.flexGrow = Std.string(1 - this.lastValue);
}
,get_vertical: function() {
return this.target.classList.contains("vertical");
}
,__class__: slider_Slider
};
var tink_core_Annex = function(target) {
this.target = target;
this.registry = new haxe_ds_ObjectMap();
};
tink_core_Annex.__name__ = ["tink","core","Annex"];
tink_core_Annex.prototype = {
__class__: tink_core_Annex
};
var tink_core__$Callback_Callback_$Impl_$ = {};
tink_core__$Callback_Callback_$Impl_$.__name__ = ["tink","core","_Callback","Callback_Impl_"];
tink_core__$Callback_Callback_$Impl_$.invoke = function(this1,data) {
if(tink_core__$Callback_Callback_$Impl_$.depth < 1000) {
tink_core__$Callback_Callback_$Impl_$.depth++;
this1(data);
tink_core__$Callback_Callback_$Impl_$.depth--;
} else {
var _e = this1;
var f = function(data1) {
tink_core__$Callback_Callback_$Impl_$.invoke(_e,data1);
};
var a1 = data;
tink_core__$Callback_Callback_$Impl_$.defer(function() {
f(a1);
});
}
};
tink_core__$Callback_Callback_$Impl_$.fromNiladic = function(f) {
var this1 = function(r) {
f();
};
return this1;
};
tink_core__$Callback_Callback_$Impl_$.defer = function(f) {
haxe_Timer.delay(f,0);
};
var tink_core__$Callback_LinkObject = function() { };
tink_core__$Callback_LinkObject.__name__ = ["tink","core","_Callback","LinkObject"];
tink_core__$Callback_LinkObject.prototype = {
__class__: tink_core__$Callback_LinkObject
};
var tink_core__$Callback_SimpleLink = function(f) {
this.f = f;
};
tink_core__$Callback_SimpleLink.__name__ = ["tink","core","_Callback","SimpleLink"];
tink_core__$Callback_SimpleLink.__interfaces__ = [tink_core__$Callback_LinkObject];
tink_core__$Callback_SimpleLink.prototype = {
dissolve: function() {
if(this.f != null) {
this.f();
}
}
,__class__: tink_core__$Callback_SimpleLink
};
var tink_core__$Callback_LinkPair = function(a,b) {
this.dissolved = false;
this.a = a;
this.b = b;
};
tink_core__$Callback_LinkPair.__name__ = ["tink","core","_Callback","LinkPair"];
tink_core__$Callback_LinkPair.__interfaces__ = [tink_core__$Callback_LinkObject];
tink_core__$Callback_LinkPair.prototype = {
dissolve: function() {
if(!this.dissolved) {
this.dissolved = true;
var this1 = this.a;
if(this1 != null) {
this1.dissolve();
}
var this2 = this.b;
if(this2 != null) {
this2.dissolve();
}
}
}
,__class__: tink_core__$Callback_LinkPair
};
var tink_core__$Callback_ListCell = function(cb,list) {
if(cb == null) {
throw new js__$Boot_HaxeError("callback expected but null received");
}
this.cb = cb;
this.list = list;
};
tink_core__$Callback_ListCell.__name__ = ["tink","core","_Callback","ListCell"];
tink_core__$Callback_ListCell.__interfaces__ = [tink_core__$Callback_LinkObject];
tink_core__$Callback_ListCell.prototype = {
clear: function() {
this.list = null;
this.cb = null;
}
,dissolve: function() {
var _g = this.list;
if(_g != null) {
var v = _g;
this.clear();
HxOverrides.remove(v,this);
}
}
,__class__: tink_core__$Callback_ListCell
};
var tink_core__$Callback_CallbackList_$Impl_$ = {};
tink_core__$Callback_CallbackList_$Impl_$.__name__ = ["tink","core","_Callback","CallbackList_Impl_"];
tink_core__$Callback_CallbackList_$Impl_$.add = function(this1,cb) {
var node = new tink_core__$Callback_ListCell(cb,this1);
this1.push(node);
return node;
};
tink_core__$Callback_CallbackList_$Impl_$.invoke = function(this1,data) {
var _g = 0;
var _g1 = this1.slice();
while(_g < _g1.length) {
var cell = _g1[_g];
++_g;
if(cell.cb != null) {
tink_core__$Callback_Callback_$Impl_$.invoke(cell.cb,data);
}
}
};
tink_core__$Callback_CallbackList_$Impl_$.clear = function(this1) {
var _g = 0;
var _g1 = this1.splice(0,this1.length);
while(_g < _g1.length) {
var cell = _g1[_g];
++_g;
cell.clear();
}
};
var tink_core_TypedError = function(code,message,pos) {
if(code == null) {
code = 500;
}
this.isTinkError = true;
this.code = code;
this.message = message;
this.pos = pos;
this.exceptionStack = [];
this.callStack = [];
};
tink_core_TypedError.__name__ = ["tink","core","TypedError"];
tink_core_TypedError.withData = function(code,message,data,pos) {
return tink_core_TypedError.typed(code,message,data,pos);
};
tink_core_TypedError.typed = function(code,message,data,pos) {
var ret = new tink_core_TypedError(code,message,pos);
ret.data = data;
return ret;
};
tink_core_TypedError.asError = function(v) {
if(v != null && v.isTinkError) {
return v;
} else {
return null;
}
};
tink_core_TypedError.prototype = {
printPos: function() {
return this.pos.className + "." + this.pos.methodName + ":" + this.pos.lineNumber;
}
,toString: function() {
var ret = "Error#" + this.code + ": " + this.message;
if(this.pos != null) {
ret += " @ " + this.printPos();
}
return ret;
}
,throwSelf: function() {
throw new js__$Boot_HaxeError(this);
}
,__class__: tink_core_TypedError
};
var tink_core_Noise = { __ename__ : true, __constructs__ : ["Noise"] };
tink_core_Noise.Noise = ["Noise",0];
tink_core_Noise.Noise.toString = $estr;
tink_core_Noise.Noise.__enum__ = tink_core_Noise;
var tink_core__$Lazy_LazyObject = function() { };
tink_core__$Lazy_LazyObject.__name__ = ["tink","core","_Lazy","LazyObject"];
tink_core__$Lazy_LazyObject.prototype = {
__class__: tink_core__$Lazy_LazyObject
};
var tink_core__$Lazy_LazyConst = function(value) {
this.value = value;
};
tink_core__$Lazy_LazyConst.__name__ = ["tink","core","_Lazy","LazyConst"];
tink_core__$Lazy_LazyConst.__interfaces__ = [tink_core__$Lazy_LazyObject];
tink_core__$Lazy_LazyConst.prototype = {
get: function() {
return this.value;
}
,map: function(f) {
return new tink_core__$Lazy_LazyConst(f(this.value));
}
,__class__: tink_core__$Lazy_LazyConst
};
var tink_core__$Future_SyncFuture = function(value) {
this.value = value;
};
tink_core__$Future_SyncFuture.__name__ = ["tink","core","_Future","SyncFuture"];
tink_core__$Future_SyncFuture.__interfaces__ = [tink_core__$Future_FutureObject];
tink_core__$Future_SyncFuture.prototype = {
map: function(f) {
return new tink_core__$Future_SyncFuture(this.value.map(f));
}
,flatMap: function(f) {
var l = this.value.map(f);
return new tink_core__$Future_SimpleFuture(function(cb) {
return l.get().handle(cb);
});
}
,handle: function(cb) {
tink_core__$Callback_Callback_$Impl_$.invoke(cb,this.value.get());
return null;
}
,gather: function() {
return this;
}
,__class__: tink_core__$Future_SyncFuture
};
var tink_core__$Future_Future_$Impl_$ = {};
tink_core__$Future_Future_$Impl_$.__name__ = ["tink","core","_Future","Future_Impl_"];
tink_core__$Future_Future_$Impl_$.first = function(this1,other) {
var ret = new tink_core_FutureTrigger();
var l1 = this1.handle($bind(ret,ret.trigger));
var l2 = other.handle($bind(ret,ret.trigger));
var ret1 = ret;
if(l1 != null) {
var this2 = l1;
ret1.handle(function(_) {
this2.dissolve();
});
}
if(l2 != null) {
var this3 = l2;
ret1.handle(function(_1) {
this3.dissolve();
});
}
return ret1;
};
tink_core__$Future_Future_$Impl_$.flatten = function(f) {
return new tink_core__$Future_NestedFuture(f);
};
tink_core__$Future_Future_$Impl_$.ofMany = function(futures,gather) {
if(gather == null) {
gather = true;
}
var ret = new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst([]));
var _g = 0;
while(_g < futures.length) {
var f = [futures[_g]];
++_g;
var ret1 = ret.flatMap((function(f1) {
return function(results) {
var ret2 = (function() {
return function(result) {
return results.concat([result]);
};
})();
var ret3 = f1[0].map(ret2);
return ret3;
};
})(f));
ret = ret1;
}
if(gather) {
return ret.gather();
} else {
return ret;
}
};
tink_core__$Future_Future_$Impl_$.async = function(f,lazy) {
if(lazy == null) {
lazy = false;
}
if(lazy) {
return new tink_core__$Future_LazyTrigger(f);
} else {
var op = new tink_core_FutureTrigger();
var wrapped = f;
tink_core__$Callback_Callback_$Impl_$.invoke(wrapped,$bind(op,op.trigger));
return op;
}
};
tink_core__$Future_Future_$Impl_$.or = function(a,b) {
return tink_core__$Future_Future_$Impl_$.first(a,b);
};
var tink_core__$Future_NestedFuture = function(outer) {
this.outer = outer;
};
tink_core__$Future_NestedFuture.__name__ = ["tink","core","_Future","NestedFuture"];
tink_core__$Future_NestedFuture.__interfaces__ = [tink_core__$Future_FutureObject];
tink_core__$Future_NestedFuture.prototype = {
map: function(f) {
var ret = this.outer.flatMap(function(inner) {
var ret1 = inner.map(f);
return ret1.gather();
});
return ret.gather();
}
,flatMap: function(f) {
var ret = this.outer.flatMap(function(inner) {
var ret1 = inner.flatMap(f);
return ret1.gather();
});
return ret.gather();
}
,gather: function() {
return tink_core_FutureTrigger.gatherFuture(this);
}
,handle: function(cb) {
var ret = null;
ret = this.outer.handle(function(inner) {
ret = inner.handle(function(result) {
tink_core__$Callback_Callback_$Impl_$.invoke(cb,result);
});
});
return ret;
}
,__class__: tink_core__$Future_NestedFuture
};
var tink_core_FutureTrigger = function() {
var this1 = [];
this.list = this1;
};
tink_core_FutureTrigger.__name__ = ["tink","core","FutureTrigger"];
tink_core_FutureTrigger.__interfaces__ = [tink_core__$Future_FutureObject];
tink_core_FutureTrigger.gatherFuture = function(f) {
var op = null;
var this1 = new tink_core__$Future_SimpleFuture(function(cb) {
if(op == null) {
op = new tink_core_FutureTrigger();
f.handle($bind(op,op.trigger));
f = null;
}
return op.handle(cb);
});
return this1;
};
tink_core_FutureTrigger.prototype = {
handle: function(callback) {
var _g = this.list;
if(_g == null) {
tink_core__$Callback_Callback_$Impl_$.invoke(callback,this.result);
return null;
} else {
var v = _g;
return tink_core__$Callback_CallbackList_$Impl_$.add(v,callback);
}
}
,map: function(f) {
var _g = this.list;
if(_g == null) {
return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(f(this.result)));
} else {
var v = _g;
var ret = new tink_core_FutureTrigger();
tink_core__$Callback_CallbackList_$Impl_$.add(this.list,function(v1) {
var tmp = f(v1);
ret.trigger(tmp);
});
return ret;
}
}
,flatMap: function(f) {
var _g = this.list;
if(_g == null) {
return f(this.result);
} else {
var v = _g;
var ret = new tink_core_FutureTrigger();
tink_core__$Callback_CallbackList_$Impl_$.add(this.list,function(v1) {
f(v1).handle($bind(ret,ret.trigger));
});
return ret;
}
}
,gather: function() {
return this;
}
,trigger: function(result) {
if(this.list == null) {
return false;
} else {
var list = this.list;
this.list = null;
this.result = result;
tink_core__$Callback_CallbackList_$Impl_$.invoke(list,result);
tink_core__$Callback_CallbackList_$Impl_$.clear(list);
return true;
}
}
,__class__: tink_core_FutureTrigger
};
var tink_core__$Future_LazyTrigger = function(op) {
this.op = op;
tink_core_FutureTrigger.call(this);
};
tink_core__$Future_LazyTrigger.__name__ = ["tink","core","_Future","LazyTrigger"];
tink_core__$Future_LazyTrigger.__super__ = tink_core_FutureTrigger;
tink_core__$Future_LazyTrigger.prototype = $extend(tink_core_FutureTrigger.prototype,{
eager: function() {
if(this.op != null) {
var op = this.op;
this.op = null;
tink_core__$Callback_Callback_$Impl_$.invoke(op,$bind(this,this.trigger));
}
return this;
}
,map: function(f) {
var _gthis = this;
if(this.op == null) {
return tink_core_FutureTrigger.prototype.map.call(this,f);
} else {
return tink_core__$Future_Future_$Impl_$.async(function(cb) {
_gthis.handle(function(v) {
var tmp = f(v);
cb(tmp);
});
},true);
}
}
,flatMap: function(f) {
var _gthis = this;
if(this.op == null) {
return tink_core_FutureTrigger.prototype.flatMap.call(this,f);
} else {
return tink_core__$Future_Future_$Impl_$.async(function(cb) {
_gthis.handle(function(v) {
f(v).handle(cb);
});
},true);
}
}
,handle: function(cb) {
this.eager();
return tink_core_FutureTrigger.prototype.handle.call(this,cb);
}
,__class__: tink_core__$Future_LazyTrigger
});
var tink_core__$Lazy_LazyFunc = function(f) {
this.f = f;
};
tink_core__$Lazy_LazyFunc.__name__ = ["tink","core","_Lazy","LazyFunc"];
tink_core__$Lazy_LazyFunc.__interfaces__ = [tink_core__$Lazy_LazyObject];
tink_core__$Lazy_LazyFunc.prototype = {
get: function() {
if(this.f != null) {
this.result = this.f();
this.f = null;
}
return this.result;
}
,map: function(f) {
var _gthis = this;
return new tink_core__$Lazy_LazyFunc(function() {
var tmp = _gthis.get();
return f(tmp);
});
}
,__class__: tink_core__$Lazy_LazyFunc
};
var tink_core_NamedWith = function(name,value) {
this.name = name;
this.value = value;
};
tink_core_NamedWith.__name__ = ["tink","core","NamedWith"];
tink_core_NamedWith.prototype = {
__class__: tink_core_NamedWith
};
var tink_core_Outcome = { __ename__ : true, __constructs__ : ["Success","Failure"] };
tink_core_Outcome.Success = function(data) { var $x = ["Success",0,data]; $x.__enum__ = tink_core_Outcome; $x.toString = $estr; return $x; };
tink_core_Outcome.Failure = function(failure) { var $x = ["Failure",1,failure]; $x.__enum__ = tink_core_Outcome; $x.toString = $estr; return $x; };
var tink_core_OutcomeTools = function() { };
tink_core_OutcomeTools.__name__ = ["tink","core","OutcomeTools"];
tink_core_OutcomeTools.sure = function(outcome) {
switch(outcome[1]) {
case 0:
var data = outcome[2];
return data;
case 1:
var failure = outcome[2];
var _g = tink_core_TypedError.asError(failure);
if(_g == null) {
throw new js__$Boot_HaxeError(failure);
} else {
var e = _g;
return e.throwSelf();
}
break;
}
};
var tink_core__$Promise_Promise_$Impl_$ = {};
tink_core__$Promise_Promise_$Impl_$.__name__ = ["tink","core","_Promise","Promise_Impl_"];
tink_core__$Promise_Promise_$Impl_$.ofOutcome = function(o) {
return new tink_core__$Future_SyncFuture(new tink_core__$Lazy_LazyConst(o));
};
var tink_core__$Signal_Signal_$Impl_$ = {};
tink_core__$Signal_Signal_$Impl_$.__name__ = ["tink","core","_Signal","Signal_Impl_"];
tink_core__$Signal_Signal_$Impl_$.map = function(this1,f,gather) {
if(gather == null) {
gather = true;
}
var this2 = new tink_core__$Signal_SimpleSignal(function(cb) {
return this1.handle(function(result) {
var this3 = f(result);
tink_core__$Callback_Callback_$Impl_$.invoke(cb,this3);
});
});
var ret = this2;
if(gather) {
return tink_core__$Signal_Signal_$Impl_$.gather(ret);
} else {
return ret;
}
};
tink_core__$Signal_Signal_$Impl_$.filter = function(this1,f,gather) {
if(gather == null) {
gather = true;
}
var this2 = new tink_core__$Signal_SimpleSignal(function(cb) {
return this1.handle(function(result) {
if(f(result)) {
tink_core__$Callback_Callback_$Impl_$.invoke(cb,result);
}
});
});
var ret = this2;
if(gather) {
return tink_core__$Signal_Signal_$Impl_$.gather(ret);
} else {
return ret;
}
};
tink_core__$Signal_Signal_$Impl_$.join = function(this1,other,gather) {
if(gather == null) {
gather = true;
}
var this2 = new tink_core__$Signal_SimpleSignal(function(cb) {
return new tink_core__$Callback_LinkPair(this1.handle(cb),other.handle(cb));
});
var ret = this2;
if(gather) {
return tink_core__$Signal_Signal_$Impl_$.gather(ret);
} else {
return ret;
}
};
tink_core__$Signal_Signal_$Impl_$.nextTime = function(this1,condition) {
var ret = new tink_core_FutureTrigger();
var link = null;
var immediate = false;
link = this1.handle(function(v) {
if(condition == null || condition(v)) {
ret.trigger(v);
if(link == null) {
immediate = true;
} else if(link != null) {
link.dissolve();
}
}
});
if(immediate) {
if(link != null) {
link.dissolve();
}
}
return ret;
};
tink_core__$Signal_Signal_$Impl_$.noise = function(this1) {
return tink_core__$Signal_Signal_$Impl_$.map(this1,function(_) {
return tink_core_Noise.Noise;
});
};
tink_core__$Signal_Signal_$Impl_$.gather = function(this1) {
var ret = tink_core__$Signal_Signal_$Impl_$.trigger();
this1.handle(function(x) {
tink_core__$Callback_CallbackList_$Impl_$.invoke(ret.handlers,x);
});
return ret;
};
tink_core__$Signal_Signal_$Impl_$.trigger = function() {
return new tink_core_SignalTrigger();
};
tink_core__$Signal_Signal_$Impl_$.ofClassical = function(add,remove,gather) {
if(gather == null) {
gather = true;
}
var this1 = new tink_core__$Signal_SimpleSignal(function(cb) {
var f = function(a) {
tink_core__$Callback_Callback_$Impl_$.invoke(cb,a);
};
add(f);
var this2;
var f1 = remove;
var a1 = f;
this2 = new tink_core__$Callback_SimpleLink(function() {
f1(a1);
});
return this2;
});
var ret = this1;
if(gather) {
return tink_core__$Signal_Signal_$Impl_$.gather(ret);
} else {
return ret;
}
};
var tink_core_SignalObject = function() { };
tink_core_SignalObject.__name__ = ["tink","core","SignalObject"];
tink_core_SignalObject.prototype = {
__class__: tink_core_SignalObject
};
var tink_core__$Signal_SimpleSignal = function(f) {
this.f = f;
};
tink_core__$Signal_SimpleSignal.__name__ = ["tink","core","_Signal","SimpleSignal"];
tink_core__$Signal_SimpleSignal.__interfaces__ = [tink_core_SignalObject];
tink_core__$Signal_SimpleSignal.prototype = {
handle: function(cb) {
return this.f(cb);
}
,__class__: tink_core__$Signal_SimpleSignal
};
var tink_core_SignalTrigger = function() {
var this1 = [];
this.handlers = this1;
};
tink_core_SignalTrigger.__name__ = ["tink","core","SignalTrigger"];
tink_core_SignalTrigger.__interfaces__ = [tink_core_SignalObject];
tink_core_SignalTrigger.prototype = {
trigger: function(event) {
tink_core__$Callback_CallbackList_$Impl_$.invoke(this.handlers,event);
}
,handle: function(cb) {
return tink_core__$Callback_CallbackList_$Impl_$.add(this.handlers,cb);
}
,__class__: tink_core_SignalTrigger
};
var tink_geom2__$Matrix_Matrix_$Impl_$ = {};
tink_geom2__$Matrix_Matrix_$Impl_$.__name__ = ["tink","geom2","_Matrix","Matrix_Impl_"];
tink_geom2__$Matrix_Matrix_$Impl_$.invert = function(m) {
var det = m.a * m.d - m.c * m.b;
var a = m.d / det;
var b = -m.b / det;
var c = -m.c / det;
var d = m.a / det;
var this1 = { a : a, b : b, c : c, d : d, tx : -(a * m.tx + c * m.ty), ty : -(b * m.tx + d * m.ty)};
return this1;
};
tink_geom2__$Matrix_Matrix_$Impl_$.transformPoint = function(m,p) {
var this1;
var this2 = new tink_core_MPair(m.a * p.a + m.c * p.b + m.tx,m.b * p.a + m.d * p.b + m.ty);
this1 = this2;
return this1;
};
tink_geom2__$Matrix_Matrix_$Impl_$.concat = function(m,n) {
var this1 = { a : n.a * m.a + n.c * m.b, b : n.b * m.a + n.d * m.b, c : n.a * m.c + n.c * m.d, d : n.b * m.c + n.d * m.d, tx : n.a * m.tx + n.c * m.ty + n.tx, ty : n.b * m.tx + n.d * m.ty + n.ty};
return this1;
};
tink_geom2__$Matrix_Matrix_$Impl_$.scale = function(m,f) {
var this1 = { a : f, b : 0, c : 0, d : f, tx : 0, ty : 0};
return tink_geom2__$Matrix_Matrix_$Impl_$.concat(m,this1);
};
tink_geom2__$Matrix_Matrix_$Impl_$.rscale = function(f,m) {
var this1 = { a : f, b : 0, c : 0, d : f, tx : 0, ty : 0};
return tink_geom2__$Matrix_Matrix_$Impl_$.concat(this1,m);
};
tink_geom2__$Matrix_Matrix_$Impl_$.move = function(m,p) {
var this1 = { a : 1, b : 0, c : 0, d : 1, tx : p.a, ty : p.b};
return tink_geom2__$Matrix_Matrix_$Impl_$.concat(m,this1);
};
tink_geom2__$Matrix_Matrix_$Impl_$.rmove = function(p,m) {
var this1 = { a : 1, b : 0, c : 0, d : 1, tx : p.a, ty : p.b};
return tink_geom2__$Matrix_Matrix_$Impl_$.concat(this1,m);
};
tink_geom2__$Matrix_Matrix_$Impl_$.toString = function(this1) {
return "matrix(" + this1.a + ", " + this1.b + ", " + this1.c + ", " + this1.d + ", " + this1.tx + ", " + this1.ty + ")";
};
var tink_json__$Parser_SliceData = function(source,min,max) {
this.source = source;
this.min = min;
this.max = max;
};
tink_json__$Parser_SliceData.__name__ = ["tink","json","_Parser","SliceData"];
tink_json__$Parser_SliceData.prototype = {
__class__: tink_json__$Parser_SliceData
};
var tink_json__$Parser_JsonString_$Impl_$ = {};
tink_json__$Parser_JsonString_$Impl_$.__name__ = ["tink","json","_Parser","JsonString_Impl_"];
tink_json__$Parser_JsonString_$Impl_$.contains = function(this1,s) {
var _g = this1.source.indexOf(s,this1.min);
if(_g == -1) {
return false;
} else {
var outside = _g;
if(outside > this1.max) {
return false;
} else {
var v = _g;
return true;
}
}
};
tink_json__$Parser_JsonString_$Impl_$.toString = function(this1) {
if(tink_json__$Parser_JsonString_$Impl_$.contains(this1,"\\")) {
return JSON.parse(this1.source.substring(this1.min - 1,this1.max + 1));
} else {
return this1.source.substring(this1.min,this1.max);
}
};
var tink_json_BasicParser = function() {
this.plugins = new tink_core_Annex(this);
};
tink_json_BasicParser.__name__ = ["tink","json","BasicParser"];
tink_json_BasicParser.prototype = {
init: function(source) {
this.source = source;
this.pos = 0;
this.max = source.length;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
}
,parseString: function() {
var e;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var e1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 34) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
e1 = true;
} else {
e1 = false;
}
if(!e1) {
e = this.die("Expected string");
} else {
e = null;
}
return this.parseRestOfString();
}
,parseRestOfString: function() {
return this.slice(this.skipString(),this.pos - 1);
}
,skipString: function() {
var start = this.pos;
while(true) {
var _g = this.source.indexOf("\"",this.pos);
if(_g == -1) {
this.die("unterminated string",start);
} else {
var v = _g;
this.pos = v + 1;
var p = this.pos - 2;
while(this.source.charCodeAt(p) == 92) --p;
if((p - this.pos & 1) == 0) {
break;
}
}
}
return start;
}
,parseNumber: function() {
var $char = this.source.charCodeAt(this.pos);
if($char == 46 || $char < 58 && $char > 47) {
return this.doParseNumber();
} else {
return this.die("number expected");
}
}
,doParseNumber: function() {
return this.slice(this.skipNumber(this.source.charCodeAt(this.pos++)),this.pos);
}
,invalidNumber: function(start) {
return this.die("Invalid number " + this.source.substring(start,this.pos),start);
}
,skipNumber: function(c) {
var start = this.pos - 1;
var minus = c == 45;
var digit = !minus;
var zero = c == 48;
var point = false;
var e = false;
var pm = false;
var end = false;
while(true) {
c = this.source.charCodeAt(this.pos++);
switch(c) {
case 43:case 45:
if(!e || pm) {
this.invalidNumber(start);
}
digit = false;
pm = true;
break;
case 46:
if(minus || point) {
this.invalidNumber(start);
}
digit = false;
point = true;
break;
case 48:
if(zero && !point) {
this.invalidNumber(start);
}
if(minus) {
minus = false;
zero = true;
}
digit = true;
break;
case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
if(zero && !point) {
this.invalidNumber(start);
}
if(minus) {
minus = false;
}
digit = true;
zero = false;
break;
case 69:case 101:
if(minus || zero || e) {
this.invalidNumber(start);
}
digit = false;
e = true;
break;
default:
if(!digit) {
this.invalidNumber(start);
}
this.pos--;
end = true;
}
if(end) {
break;
}
}
return start;
}
,slice: function(from,to) {
return new tink_json__$Parser_SliceData(this.source,from,to);
}
,skipValue: function() {
var _gthis = this;
var _g = this.source.charCodeAt(this.pos++);
switch(_g) {
case 34:
this.skipString();
break;
case 91:
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(tmp) {
return;
}
while(true) {
this.skipValue();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) {
this.pos += 1;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected ]");
}
break;
case 102:
var tmp3;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 97 && this.source.charCodeAt(this.pos + 1) == 108 && this.source.charCodeAt(this.pos + 2) == 115 && this.source.charCodeAt(this.pos + 3) == 101) {
this.pos += 4;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
this.die("Expected alse");
}
break;
case 110:
var tmp4;
if(this.max > this.pos + 2 && this.source.charCodeAt(this.pos) == 117 && this.source.charCodeAt(this.pos + 1) == 108 && this.source.charCodeAt(this.pos + 2) == 108) {
this.pos += 3;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected ull");
}
break;
case 116:
var tmp5;
if(this.max > this.pos + 2 && this.source.charCodeAt(this.pos) == 114 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 101) {
this.pos += 3;
tmp5 = true;
} else {
tmp5 = false;
}
if(!tmp5) {
this.die("Expected rue");
}
break;
case 123:
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp6;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp6 = true;
} else {
tmp6 = false;
}
if(tmp6) {
return;
}
while(true) {
if(_gthis.source.charCodeAt(_gthis.pos++) != 34) {
_gthis.die("expected string",_gthis.pos - 1);
}
_gthis.skipString();
while(_gthis.pos < _gthis.max && _gthis.source.charCodeAt(_gthis.pos) < 33) _gthis.pos++;
var tmp7;
if(_gthis.max > _gthis.pos && _gthis.source.charCodeAt(_gthis.pos) == 58) {
_gthis.pos += 1;
while(_gthis.pos < _gthis.max && _gthis.source.charCodeAt(_gthis.pos) < 33) _gthis.pos++;
tmp7 = true;
} else {
tmp7 = false;
}
if(!tmp7) {
_gthis.die("Expected :");
}
_gthis.skipValue();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp8;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp8 = true;
} else {
tmp8 = false;
}
if(!tmp8) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp9;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
tmp9 = true;
} else {
tmp9 = false;
}
if(!tmp9) {
this.die("Expected }");
}
break;
default:
var $char = _g;
if($char == 46 || $char < 58 && $char > 47) {
this.skipNumber($char);
} else {
this.invalidChar($char);
}
}
}
,invalidChar: function(c) {
return this.die("invalid char " + StringTools.hex(c,2),this.pos - 1);
}
,die: function(s,pos,end) {
if(pos == null) {
pos = this.pos;
end = pos;
} else if(end == null) {
end = this.pos;
}
if(end <= pos) {
end = pos + 1;
}
var range = end > pos + 1 ? "characters " + pos + " - " + end : "character " + pos;
var clip = function(s1,maxLength,left) {
if(s1.length > maxLength) {
if(left) {
return "... " + HxOverrides.substr(s1,s1.length - maxLength,null);
} else {
return HxOverrides.substr(s1,0,maxLength) + " ...";
}
} else {
return s1;
}
};
var center = pos + end >> 1;
var context = clip(this.source.substring(0,pos),20,true) + " ----> " + clip(this.source.substring(pos,center),20,false) + clip(this.source.substring(center,end),20,true) + " <---- " + clip(this.source.substring(end),20,false);
return tink_core_TypedError.withData(422,s + (" at " + range + " in " + context),{ source : this.source, start : pos, end : end},{ fileName : "Parser.hx", lineNumber : 327, className : "tink.json.BasicParser", methodName : "die"}).throwSelf();
}
,parseBool: function() {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 116 && this.source.charCodeAt(this.pos + 1) == 114 && this.source.charCodeAt(this.pos + 2) == 117 && this.source.charCodeAt(this.pos + 3) == 101) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(tmp) {
return true;
} else {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos + 4 && this.source.charCodeAt(this.pos) == 102 && this.source.charCodeAt(this.pos + 1) == 97 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 115 && this.source.charCodeAt(this.pos + 4) == 101) {
this.pos += 5;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(tmp1) {
return false;
} else {
return this.die("expected boolean value");
}
}
}
,__class__: tink_json_BasicParser
};
var tink_json_Parser0 = function() {
tink_json_BasicParser.call(this);
};
tink_json_Parser0.__name__ = ["tink","json","Parser0"];
tink_json_Parser0.__super__ = tink_json_BasicParser;
tink_json_Parser0.prototype = $extend(tink_json_BasicParser.prototype,{
parse0: function() {
var _gthis = this;
var v_bubbleContains = null;
var v_bubbleUsedWith = null;
var v_displayLongTextAsTooltip = null;
var v_embedded = null;
var v_frameOnly = null;
var v_geo = null;
var v_iconId = null;
var v_iconOnGeo = null;
var v_long = null;
var v_mediabarContains = null;
var v_short = null;
var v_thumb = null;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("thumb".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "thumb") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_thumb1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_thumb1 = true;
} else {
v_thumb1 = false;
}
if(v_thumb1) {
v_thumb = null;
} else {
v_thumb = this.parse2();
}
} else if("short".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "short") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_short1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_short1 = true;
} else {
v_short1 = false;
}
if(v_short1) {
v_short = null;
} else {
v_short = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else if("mediabarContains".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "mediabarContains") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_mediabarContains1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_mediabarContains1 = true;
} else {
v_mediabarContains1 = false;
}
if(v_mediabarContains1) {
v_mediabarContains = null;
} else {
v_mediabarContains = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else if("long".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "long") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_long1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_long1 = true;
} else {
v_long1 = false;
}
if(v_long1) {
v_long = null;
} else {
v_long = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else if("iconOnGeo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "iconOnGeo") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_iconOnGeo1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_iconOnGeo1 = true;
} else {
v_iconOnGeo1 = false;
}
if(v_iconOnGeo1) {
v_iconOnGeo = null;
} else {
v_iconOnGeo = this.parseBool();
}
} else if("iconId".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "iconId") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_iconId1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_iconId1 = true;
} else {
v_iconId1 = false;
}
if(v_iconId1) {
v_iconId = null;
} else {
v_iconId = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else if("geo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "geo") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_geo1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_geo1 = true;
} else {
v_geo1 = false;
}
if(v_geo1) {
v_geo = null;
} else {
v_geo = this.parse1();
}
} else if("frameOnly".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "frameOnly") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_frameOnly1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_frameOnly1 = true;
} else {
v_frameOnly1 = false;
}
if(v_frameOnly1) {
v_frameOnly = null;
} else {
v_frameOnly = this.parseBool();
}
} else if("embedded".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "embedded") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_embedded1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_embedded1 = true;
} else {
v_embedded1 = false;
}
if(v_embedded1) {
v_embedded = null;
} else {
v_embedded = this.parseBool();
}
} else if("displayLongTextAsTooltip".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "displayLongTextAsTooltip") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_displayLongTextAsTooltip1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_displayLongTextAsTooltip1 = true;
} else {
v_displayLongTextAsTooltip1 = false;
}
if(v_displayLongTextAsTooltip1) {
v_displayLongTextAsTooltip = null;
} else {
v_displayLongTextAsTooltip = this.parseBool();
}
} else if("bubbleUsedWith".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bubbleUsedWith") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_bubbleUsedWith1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_bubbleUsedWith1 = true;
} else {
v_bubbleUsedWith1 = false;
}
if(v_bubbleUsedWith1) {
v_bubbleUsedWith = null;
} else {
v_bubbleUsedWith = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else if("bubbleContains".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bubbleContains") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_bubbleContains1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_bubbleContains1 = true;
} else {
v_bubbleContains1 = false;
}
if(v_bubbleContains1) {
v_bubbleContains = null;
} else {
v_bubbleContains = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { bubbleContains : v_bubbleContains, bubbleUsedWith : v_bubbleUsedWith, displayLongTextAsTooltip : v_displayLongTextAsTooltip, embedded : v_embedded, frameOnly : v_frameOnly, geo : v_geo, iconId : v_iconId, iconOnGeo : v_iconOnGeo, 'long' : v_long, mediabarContains : v_mediabarContains, 'short' : v_short, thumb : v_thumb};
}
,parse1: function() {
var _gthis = this;
var v_alpha = null;
var v_color = null;
var v_hoverAlpha = null;
var v_hoverColor = null;
var v_x1 = .0;
var hasv_x1 = false;
var v_x2 = .0;
var hasv_x2 = false;
var v_y1 = .0;
var hasv_y1 = false;
var v_y2 = .0;
var hasv_y2 = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("y2".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "y2") {
var this1 = this.parseNumber();
v_y2 = parseFloat(this1.source.substring(this1.min,this1.max));
hasv_y2 = true;
} else if("y1".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "y1") {
var this2 = this.parseNumber();
v_y1 = parseFloat(this2.source.substring(this2.min,this2.max));
hasv_y1 = true;
} else if("x2".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "x2") {
var this3 = this.parseNumber();
v_x2 = parseFloat(this3.source.substring(this3.min,this3.max));
hasv_x2 = true;
} else if("x1".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "x1") {
var this4 = this.parseNumber();
v_x1 = parseFloat(this4.source.substring(this4.min,this4.max));
hasv_x1 = true;
} else if("hoverColor".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "hoverColor") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_hoverColor1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_hoverColor1 = true;
} else {
v_hoverColor1 = false;
}
if(v_hoverColor1) {
v_hoverColor = null;
} else {
var this5 = this.parseNumber();
v_hoverColor = Std.parseInt(this5.source.substring(this5.min,this5.max));
}
} else if("hoverAlpha".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "hoverAlpha") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_hoverAlpha1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_hoverAlpha1 = true;
} else {
v_hoverAlpha1 = false;
}
if(v_hoverAlpha1) {
v_hoverAlpha = null;
} else {
var this6 = this.parseNumber();
v_hoverAlpha = parseFloat(this6.source.substring(this6.min,this6.max));
}
} else if("color".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "color") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_color1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_color1 = true;
} else {
v_color1 = false;
}
if(v_color1) {
v_color = null;
} else {
var this7 = this.parseNumber();
v_color = Std.parseInt(this7.source.substring(this7.min,this7.max));
}
} else if("alpha".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "alpha") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_alpha1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_alpha1 = true;
} else {
v_alpha1 = false;
}
if(v_alpha1) {
v_alpha = null;
} else {
var this8 = this.parseNumber();
v_alpha = parseFloat(this8.source.substring(this8.min,this8.max));
}
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { alpha : v_alpha, color : v_color, hoverAlpha : v_hoverAlpha, hoverColor : v_hoverColor, x1 : hasv_x1 ? v_x1 : __missing__("x1"), x2 : hasv_x2 ? v_x2 : __missing__("x2"), y1 : hasv_y1 ? v_y1 : __missing__("y1"), y2 : hasv_y2 ? v_y2 : __missing__("y2")};
}
,parse2: function() {
var _gthis = this;
var v_height = null;
var v_src = null;
var hasv_src = false;
var v_width = null;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("width".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "width") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_width1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_width1 = true;
} else {
v_width1 = false;
}
if(v_width1) {
v_width = null;
} else {
var this1 = this.parseNumber();
v_width = Std.parseInt(this1.source.substring(this1.min,this1.max));
}
} else if("src".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "src") {
v_src = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_src = true;
} else if("height".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "height") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_height1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_height1 = true;
} else {
v_height1 = false;
}
if(v_height1) {
v_height = null;
} else {
var this2 = this.parseNumber();
v_height = Std.parseInt(this2.source.substring(this2.min,this2.max));
}
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { height : v_height, src : hasv_src ? v_src : __missing__("src"), width : v_width};
}
,parse: function(source) {
this.init(source);
return this.parse0();
}
,__class__: tink_json_Parser0
});
var tink_json_Parser1 = function() {
tink_json_BasicParser.call(this);
};
tink_json_Parser1.__name__ = ["tink","json","Parser1"];
tink_json_Parser1.__super__ = tink_json_BasicParser;
tink_json_Parser1.prototype = $extend(tink_json_BasicParser.prototype,{
parse0: function() {
var _gthis = this;
var v_page = null;
var hasv_page = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("page".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "page") {
v_page = this.parse1();
hasv_page = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { page : hasv_page ? v_page : __missing__("page")};
}
,parse1: function() {
var _gthis = this;
var v_bbox = null;
var hasv_bbox = false;
var v_id = 0;
var hasv_id = false;
var v_rotate = null;
var v_textbox = null;
var hasv_textbox = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("textbox".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "textbox") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_textbox1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 91) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_textbox1 = true;
} else {
v_textbox1 = false;
}
if(!v_textbox1) {
this.die("Expected [");
}
var __ret = [];
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_textbox2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_textbox2 = true;
} else {
v_textbox2 = false;
}
if(!v_textbox2) {
while(true) {
__ret.push(this.parse2());
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_textbox3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_textbox3 = true;
} else {
v_textbox3 = false;
}
if(!v_textbox3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_textbox4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_textbox4 = true;
} else {
v_textbox4 = false;
}
if(!v_textbox4) {
this.die("Expected ]");
}
}
v_textbox = __ret;
hasv_textbox = true;
} else if("rotate".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "rotate") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_rotate1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_rotate1 = true;
} else {
v_rotate1 = false;
}
if(v_rotate1) {
v_rotate = null;
} else {
v_rotate = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else if("id".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "id") {
var this1 = this.parseNumber();
v_id = Std.parseInt(this1.source.substring(this1.min,this1.max));
hasv_id = true;
} else if("bbox".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bbox") {
v_bbox = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_bbox = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { bbox : hasv_bbox ? v_bbox : __missing__("bbox"), id : hasv_id ? v_id : __missing__("id"), rotate : v_rotate, textbox : hasv_textbox ? v_textbox : __missing__("textbox")};
}
,parse2: function() {
var _gthis = this;
var v_bbox = null;
var hasv_bbox = false;
var v_id = 0;
var hasv_id = false;
var v_textline = null;
var hasv_textline = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("textline".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "textline") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_textline1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 91) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_textline1 = true;
} else {
v_textline1 = false;
}
if(!v_textline1) {
this.die("Expected [");
}
var __ret = [];
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_textline2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_textline2 = true;
} else {
v_textline2 = false;
}
if(!v_textline2) {
while(true) {
__ret.push(this.parse3());
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_textline3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_textline3 = true;
} else {
v_textline3 = false;
}
if(!v_textline3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_textline4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_textline4 = true;
} else {
v_textline4 = false;
}
if(!v_textline4) {
this.die("Expected ]");
}
}
v_textline = __ret;
hasv_textline = true;
} else if("id".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "id") {
var this1 = this.parseNumber();
v_id = Std.parseInt(this1.source.substring(this1.min,this1.max));
hasv_id = true;
} else if("bbox".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bbox") {
v_bbox = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_bbox = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { bbox : hasv_bbox ? v_bbox : __missing__("bbox"), id : hasv_id ? v_id : __missing__("id"), textline : hasv_textline ? v_textline : __missing__("textline")};
}
,parse3: function() {
var _gthis = this;
var v_text = null;
var hasv_text = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("text".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "text") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_text1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 91) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_text1 = true;
} else {
v_text1 = false;
}
if(!v_text1) {
this.die("Expected [");
}
var __ret = [];
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_text2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_text2 = true;
} else {
v_text2 = false;
}
if(!v_text2) {
while(true) {
__ret.push(this.parse4());
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_text3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_text3 = true;
} else {
v_text3 = false;
}
if(!v_text3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_text4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 93) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_text4 = true;
} else {
v_text4 = false;
}
if(!v_text4) {
this.die("Expected ]");
}
}
v_text = __ret;
hasv_text = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { text : hasv_text ? v_text : __missing__("text")};
}
,parse4: function() {
var _gthis = this;
var v_bbox = null;
var v_character = null;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("character".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "character") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_character1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_character1 = true;
} else {
v_character1 = false;
}
if(v_character1) {
v_character = null;
} else {
v_character = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else if("bbox".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bbox") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_bbox1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_bbox1 = true;
} else {
v_bbox1 = false;
}
if(v_bbox1) {
v_bbox = null;
} else {
v_bbox = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
}
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { bbox : v_bbox, character : v_character};
}
,parse: function(source) {
this.init(source);
return this.parse0();
}
,__class__: tink_json_Parser1
});
var tink_json_Parser2 = function() {
tink_json_BasicParser.call(this);
};
tink_json_Parser2.__name__ = ["tink","json","Parser2"];
tink_json_Parser2.__super__ = tink_json_BasicParser;
tink_json_Parser2.prototype = $extend(tink_json_BasicParser.prototype,{
parse0: function() {
var _gthis = this;
var v_bg = null;
var hasv_bg = false;
var v_cookieBanner = null;
var hasv_cookieBanner = false;
var v_customLinkButton = null;
var v_customerGDPR = null;
var hasv_customerGDPR = false;
var v_customerImprint = null;
var hasv_customerImprint = false;
var v_directory = null;
var hasv_directory = false;
var v_display = null;
var hasv_display = false;
var v_download = null;
var hasv_download = false;
var v_fullscreen = null;
var hasv_fullscreen = false;
var v_logo = null;
var v_media = null;
var hasv_media = false;
var v_metadata = null;
var hasv_metadata = false;
var v_navigationBar = null;
var hasv_navigationBar = false;
var v_pageShadow = null;
var hasv_pageShadow = false;
var v_pagesOverview = null;
var hasv_pagesOverview = false;
var v_search = null;
var hasv_search = false;
var v_share = null;
var hasv_share = false;
var v_subDir = null;
var hasv_subDir = false;
var v_zoom = null;
var hasv_zoom = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("zoom".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "zoom") {
v_zoom = this.parse13();
hasv_zoom = true;
} else if("subDir".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "subDir") {
v_subDir = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_subDir = true;
} else if("share".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "share") {
v_share = this.parse12();
hasv_share = true;
} else if("search".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "search") {
v_search = this.parse8();
hasv_search = true;
} else if("pagesOverview".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "pagesOverview") {
v_pagesOverview = this.parse8();
hasv_pagesOverview = true;
} else if("pageShadow".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "pageShadow") {
v_pageShadow = this.parse8();
hasv_pageShadow = true;
} else if("navigationBar".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "navigationBar") {
v_navigationBar = this.parse8();
hasv_navigationBar = true;
} else if("metadata".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "metadata") {
v_metadata = this.parse11();
hasv_metadata = true;
} else if("media".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "media") {
v_media = this.parse10();
hasv_media = true;
} else if("logo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logo") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_logo1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_logo1 = true;
} else {
v_logo1 = false;
}
if(v_logo1) {
v_logo = null;
} else {
v_logo = this.parse9();
}
} else if("fullscreen".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "fullscreen") {
v_fullscreen = this.parse8();
hasv_fullscreen = true;
} else if("download".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "download") {
v_download = this.parse7();
hasv_download = true;
} else if("display".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "display") {
v_display = this.parse6();
hasv_display = true;
} else if("directory".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "directory") {
v_directory = this.parse5();
hasv_directory = true;
} else if("customerImprint".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "customerImprint") {
v_customerImprint = this.parse4();
hasv_customerImprint = true;
} else if("customerGDPR".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "customerGDPR") {
v_customerGDPR = this.parse4();
hasv_customerGDPR = true;
} else if("customLinkButton".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "customLinkButton") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_customLinkButton1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_customLinkButton1 = true;
} else {
v_customLinkButton1 = false;
}
if(v_customLinkButton1) {
v_customLinkButton = null;
} else {
v_customLinkButton = this.parse3();
}
} else if("cookieBanner".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "cookieBanner") {
v_cookieBanner = this.parse2();
hasv_cookieBanner = true;
} else if("bg".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "bg") {
v_bg = this.parse1();
hasv_bg = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { bg : hasv_bg ? v_bg : __missing__("bg"), cookieBanner : hasv_cookieBanner ? v_cookieBanner : __missing__("cookieBanner"), customLinkButton : v_customLinkButton, customerGDPR : hasv_customerGDPR ? v_customerGDPR : __missing__("customerGDPR"), customerImprint : hasv_customerImprint ? v_customerImprint : __missing__("customerImprint"), directory : hasv_directory ? v_directory : __missing__("directory"), display : hasv_display ? v_display : __missing__("display"), download : hasv_download ? v_download : __missing__("download"), fullscreen : hasv_fullscreen ? v_fullscreen : __missing__("fullscreen"), logo : v_logo, media : hasv_media ? v_media : __missing__("media"), metadata : hasv_metadata ? v_metadata : __missing__("metadata"), navigationBar : hasv_navigationBar ? v_navigationBar : __missing__("navigationBar"), pageShadow : hasv_pageShadow ? v_pageShadow : __missing__("pageShadow"), pagesOverview : hasv_pagesOverview ? v_pagesOverview : __missing__("pagesOverview"), search : hasv_search ? v_search : __missing__("search"), share : hasv_share ? v_share : __missing__("share"), subDir : hasv_subDir ? v_subDir : __missing__("subDir"), zoom : hasv_zoom ? v_zoom : __missing__("zoom")};
}
,parse1: function() {
var _gthis = this;
var v_color = null;
var hasv_color = false;
var v_contrastColor = null;
var hasv_contrastColor = false;
var v_url = null;
var hasv_url = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("url".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "url") {
v_url = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_url = true;
} else if("contrastColor".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "contrastColor") {
v_contrastColor = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_contrastColor = true;
} else if("color".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "color") {
v_color = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_color = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { color : hasv_color ? v_color : __missing__("color"), contrastColor : hasv_contrastColor ? v_contrastColor : __missing__("contrastColor"), url : hasv_url ? v_url : __missing__("url")};
}
,parse2: function() {
var _gthis = this;
var v_buttonLabel = null;
var hasv_buttonLabel = false;
var v_content = null;
var hasv_content = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("content".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "content") {
v_content = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_content = true;
} else if("buttonLabel".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "buttonLabel") {
v_buttonLabel = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_buttonLabel = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { buttonLabel : hasv_buttonLabel ? v_buttonLabel : __missing__("buttonLabel"), content : hasv_content ? v_content : __missing__("content")};
}
,parse3: function() {
var _gthis = this;
var v_description = null;
var hasv_description = false;
var v_icon = null;
var hasv_icon = false;
var v_inOverlay = false;
var hasv_inOverlay = false;
var v_label = null;
var hasv_label = false;
var v_link = null;
var hasv_link = false;
var v_overlayHeight = 0;
var hasv_overlayHeight = false;
var v_overlayWidth = 0;
var hasv_overlayWidth = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("overlayWidth".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "overlayWidth") {
var this1 = this.parseNumber();
v_overlayWidth = Std.parseInt(this1.source.substring(this1.min,this1.max));
hasv_overlayWidth = true;
} else if("overlayHeight".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "overlayHeight") {
var this2 = this.parseNumber();
v_overlayHeight = Std.parseInt(this2.source.substring(this2.min,this2.max));
hasv_overlayHeight = true;
} else if("link".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "link") {
v_link = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_link = true;
} else if("label".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "label") {
v_label = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_label = true;
} else if("inOverlay".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "inOverlay") {
v_inOverlay = this.parseBool();
hasv_inOverlay = true;
} else if("icon".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "icon") {
v_icon = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_icon = true;
} else if("description".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "description") {
v_description = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_description = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { description : hasv_description ? v_description : __missing__("description"), icon : hasv_icon ? v_icon : __missing__("icon"), inOverlay : hasv_inOverlay ? v_inOverlay : __missing__("inOverlay"), label : hasv_label ? v_label : __missing__("label"), link : hasv_link ? v_link : __missing__("link"), overlayHeight : hasv_overlayHeight ? v_overlayHeight : __missing__("overlayHeight"), overlayWidth : hasv_overlayWidth ? v_overlayWidth : __missing__("overlayWidth")};
}
,parse4: function() {
var _gthis = this;
var v_content = null;
var hasv_content = false;
var v_maxHeight = 0;
var hasv_maxHeight = false;
var v_maxWidth = 0;
var hasv_maxWidth = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("maxWidth".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "maxWidth") {
var this1 = this.parseNumber();
v_maxWidth = Std.parseInt(this1.source.substring(this1.min,this1.max));
hasv_maxWidth = true;
} else if("maxHeight".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "maxHeight") {
var this2 = this.parseNumber();
v_maxHeight = Std.parseInt(this2.source.substring(this2.min,this2.max));
hasv_maxHeight = true;
} else if("content".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "content") {
v_content = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_content = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { content : hasv_content ? v_content : __missing__("content"), maxHeight : hasv_maxHeight ? v_maxHeight : __missing__("maxHeight"), maxWidth : hasv_maxWidth ? v_maxWidth : __missing__("maxWidth")};
}
,parse5: function() {
var _gthis = this;
var v_descriptionAsTooltip = null;
var v_hideAtItemClick = null;
var v_showThumbnails = null;
var v_visibleAtStart = null;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("visibleAtStart".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "visibleAtStart") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_visibleAtStart1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_visibleAtStart1 = true;
} else {
v_visibleAtStart1 = false;
}
if(v_visibleAtStart1) {
v_visibleAtStart = null;
} else {
v_visibleAtStart = this.parseBool();
}
} else if("showThumbnails".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "showThumbnails") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_showThumbnails1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_showThumbnails1 = true;
} else {
v_showThumbnails1 = false;
}
if(v_showThumbnails1) {
v_showThumbnails = null;
} else {
v_showThumbnails = this.parseBool();
}
} else if("hideAtItemClick".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "hideAtItemClick") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_hideAtItemClick1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_hideAtItemClick1 = true;
} else {
v_hideAtItemClick1 = false;
}
if(v_hideAtItemClick1) {
v_hideAtItemClick = null;
} else {
v_hideAtItemClick = this.parseBool();
}
} else if("descriptionAsTooltip".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "descriptionAsTooltip") {
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var v_descriptionAsTooltip1;
if(this.max > this.pos + 3 && this.source.charCodeAt(this.pos) == 110 && this.source.charCodeAt(this.pos + 1) == 117 && this.source.charCodeAt(this.pos + 2) == 108 && this.source.charCodeAt(this.pos + 3) == 108) {
this.pos += 4;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
v_descriptionAsTooltip1 = true;
} else {
v_descriptionAsTooltip1 = false;
}
if(v_descriptionAsTooltip1) {
v_descriptionAsTooltip = null;
} else {
v_descriptionAsTooltip = this.parseBool();
}
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { descriptionAsTooltip : v_descriptionAsTooltip, hideAtItemClick : v_hideAtItemClick, showThumbnails : v_showThumbnails, visibleAtStart : v_visibleAtStart};
}
,parse6: function() {
var _gthis = this;
var v_pageMode = null;
var hasv_pageMode = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("pageMode".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "pageMode") {
v_pageMode = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_pageMode = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { pageMode : hasv_pageMode ? v_pageMode : __missing__("pageMode")};
}
,parse7: function() {
var _gthis = this;
var v_enabled = false;
var hasv_enabled = false;
var v_link = null;
var hasv_link = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("link".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "link") {
v_link = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_link = true;
} else if("enabled".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "enabled") {
v_enabled = this.parseBool();
hasv_enabled = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { enabled : hasv_enabled ? v_enabled : __missing__("enabled"), link : hasv_link ? v_link : __missing__("link")};
}
,parse8: function() {
var _gthis = this;
var v_enabled = false;
var hasv_enabled = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("enabled".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "enabled") {
v_enabled = this.parseBool();
hasv_enabled = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { enabled : hasv_enabled ? v_enabled : __missing__("enabled")};
}
,parse9: function() {
var _gthis = this;
var v_logoBig = null;
var hasv_logoBig = false;
var v_logoMedium = null;
var hasv_logoMedium = false;
var v_logoOriginal = null;
var hasv_logoOriginal = false;
var v_logoSmall = null;
var hasv_logoSmall = false;
var v_targetLink = null;
var hasv_targetLink = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("targetLink".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "targetLink") {
v_targetLink = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_targetLink = true;
} else if("logoSmall".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logoSmall") {
v_logoSmall = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_logoSmall = true;
} else if("logoOriginal".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logoOriginal") {
v_logoOriginal = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_logoOriginal = true;
} else if("logoMedium".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logoMedium") {
v_logoMedium = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_logoMedium = true;
} else if("logoBig".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "logoBig") {
v_logoBig = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_logoBig = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { logoBig : hasv_logoBig ? v_logoBig : __missing__("logoBig"), logoMedium : hasv_logoMedium ? v_logoMedium : __missing__("logoMedium"), logoOriginal : hasv_logoOriginal ? v_logoOriginal : __missing__("logoOriginal"), logoSmall : hasv_logoSmall ? v_logoSmall : __missing__("logoSmall"), targetLink : hasv_targetLink ? v_targetLink : __missing__("targetLink")};
}
,parse10: function() {
var _gthis = this;
var v_allowIconsOnGeo = false;
var hasv_allowIconsOnGeo = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("allowIconsOnGeo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "allowIconsOnGeo") {
v_allowIconsOnGeo = this.parseBool();
hasv_allowIconsOnGeo = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { allowIconsOnGeo : hasv_allowIconsOnGeo ? v_allowIconsOnGeo : __missing__("allowIconsOnGeo")};
}
,parse11: function() {
var _gthis = this;
var v_appId = null;
var hasv_appId = false;
var v_appType = null;
var hasv_appType = false;
var v_customerId = null;
var hasv_customerId = false;
var v_epaperId = null;
var hasv_epaperId = false;
var v_publishTarget = null;
var hasv_publishTarget = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("publishTarget".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "publishTarget") {
v_publishTarget = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_publishTarget = true;
} else if("epaperId".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "epaperId") {
v_epaperId = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_epaperId = true;
} else if("customerId".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "customerId") {
v_customerId = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_customerId = true;
} else if("appType".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "appType") {
v_appType = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_appType = true;
} else if("appId".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "appId") {
v_appId = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_appId = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { appId : hasv_appId ? v_appId : __missing__("appId"), appType : hasv_appType ? v_appType : __missing__("appType"), customerId : hasv_customerId ? v_customerId : __missing__("customerId"), epaperId : hasv_epaperId ? v_epaperId : __missing__("epaperId"), publishTarget : hasv_publishTarget ? v_publishTarget : __missing__("publishTarget")};
}
,parse12: function() {
var _gthis = this;
var v_enabled = false;
var hasv_enabled = false;
var v_previewDesciption = null;
var hasv_previewDesciption = false;
var v_previewHeadline = null;
var hasv_previewHeadline = false;
var v_previewImage = null;
var hasv_previewImage = false;
var v_withEmail = false;
var hasv_withEmail = false;
var v_withEmbed = false;
var hasv_withEmbed = false;
var v_withFacebook = false;
var hasv_withFacebook = false;
var v_withGplus = false;
var hasv_withGplus = false;
var v_withLine = false;
var hasv_withLine = false;
var v_withLinkedIn = false;
var hasv_withLinkedIn = false;
var v_withPocket = false;
var hasv_withPocket = false;
var v_withReddit = false;
var hasv_withReddit = false;
var v_withRenren = false;
var hasv_withRenren = false;
var v_withSinaweibo = false;
var hasv_withSinaweibo = false;
var v_withTelegram = false;
var hasv_withTelegram = false;
var v_withTumblr = false;
var hasv_withTumblr = false;
var v_withTwitter = false;
var hasv_withTwitter = false;
var v_withVk = false;
var hasv_withVk = false;
var v_withWhatsapp = false;
var hasv_withWhatsapp = false;
var v_withXing = false;
var hasv_withXing = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("withXing".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withXing") {
v_withXing = this.parseBool();
hasv_withXing = true;
} else if("withWhatsapp".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withWhatsapp") {
v_withWhatsapp = this.parseBool();
hasv_withWhatsapp = true;
} else if("withVk".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withVk") {
v_withVk = this.parseBool();
hasv_withVk = true;
} else if("withTwitter".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withTwitter") {
v_withTwitter = this.parseBool();
hasv_withTwitter = true;
} else if("withTumblr".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withTumblr") {
v_withTumblr = this.parseBool();
hasv_withTumblr = true;
} else if("withTelegram".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withTelegram") {
v_withTelegram = this.parseBool();
hasv_withTelegram = true;
} else if("withSinaweibo".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withSinaweibo") {
v_withSinaweibo = this.parseBool();
hasv_withSinaweibo = true;
} else if("withRenren".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withRenren") {
v_withRenren = this.parseBool();
hasv_withRenren = true;
} else if("withReddit".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withReddit") {
v_withReddit = this.parseBool();
hasv_withReddit = true;
} else if("withPocket".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withPocket") {
v_withPocket = this.parseBool();
hasv_withPocket = true;
} else if("withLinkedIn".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withLinkedIn") {
v_withLinkedIn = this.parseBool();
hasv_withLinkedIn = true;
} else if("withLine".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withLine") {
v_withLine = this.parseBool();
hasv_withLine = true;
} else if("withGplus".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withGplus") {
v_withGplus = this.parseBool();
hasv_withGplus = true;
} else if("withFacebook".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withFacebook") {
v_withFacebook = this.parseBool();
hasv_withFacebook = true;
} else if("withEmbed".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withEmbed") {
v_withEmbed = this.parseBool();
hasv_withEmbed = true;
} else if("withEmail".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "withEmail") {
v_withEmail = this.parseBool();
hasv_withEmail = true;
} else if("previewImage".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "previewImage") {
v_previewImage = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_previewImage = true;
} else if("previewHeadline".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "previewHeadline") {
v_previewHeadline = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_previewHeadline = true;
} else if("previewDesciption".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "previewDesciption") {
v_previewDesciption = tink_json__$Parser_JsonString_$Impl_$.toString(this.parseString());
hasv_previewDesciption = true;
} else if("enabled".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "enabled") {
v_enabled = this.parseBool();
hasv_enabled = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { enabled : hasv_enabled ? v_enabled : __missing__("enabled"), previewDesciption : hasv_previewDesciption ? v_previewDesciption : __missing__("previewDesciption"), previewHeadline : hasv_previewHeadline ? v_previewHeadline : __missing__("previewHeadline"), previewImage : hasv_previewImage ? v_previewImage : __missing__("previewImage"), withEmail : hasv_withEmail ? v_withEmail : __missing__("withEmail"), withEmbed : hasv_withEmbed ? v_withEmbed : __missing__("withEmbed"), withFacebook : hasv_withFacebook ? v_withFacebook : __missing__("withFacebook"), withGplus : hasv_withGplus ? v_withGplus : __missing__("withGplus"), withLine : hasv_withLine ? v_withLine : __missing__("withLine"), withLinkedIn : hasv_withLinkedIn ? v_withLinkedIn : __missing__("withLinkedIn"), withPocket : hasv_withPocket ? v_withPocket : __missing__("withPocket"), withReddit : hasv_withReddit ? v_withReddit : __missing__("withReddit"), withRenren : hasv_withRenren ? v_withRenren : __missing__("withRenren"), withSinaweibo : hasv_withSinaweibo ? v_withSinaweibo : __missing__("withSinaweibo"), withTelegram : hasv_withTelegram ? v_withTelegram : __missing__("withTelegram"), withTumblr : hasv_withTumblr ? v_withTumblr : __missing__("withTumblr"), withTwitter : hasv_withTwitter ? v_withTwitter : __missing__("withTwitter"), withVk : hasv_withVk ? v_withVk : __missing__("withVk"), withWhatsapp : hasv_withWhatsapp ? v_withWhatsapp : __missing__("withWhatsapp"), withXing : hasv_withXing ? v_withXing : __missing__("withXing")};
}
,parse13: function() {
var _gthis = this;
var v_defaultZoomMultiplier = 0;
var hasv_defaultZoomMultiplier = false;
var __start__ = this.pos;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 123) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp = true;
} else {
tmp = false;
}
if(!tmp) {
this.die("Expected {");
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp1;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp1 = true;
} else {
tmp1 = false;
}
if(!tmp1) {
while(true) {
var __name__ = this.parseString();
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp2;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 58) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp2 = true;
} else {
tmp2 = false;
}
if(!tmp2) {
this.die("Expected :");
}
if("defaultZoomMultiplier".length == __name__.max - __name__.min && __name__.source.substring(__name__.min,__name__.max) == "defaultZoomMultiplier") {
var this1 = this.parseNumber();
v_defaultZoomMultiplier = Std.parseInt(this1.source.substring(this1.min,this1.max));
hasv_defaultZoomMultiplier = true;
} else {
this.skipValue();
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp3;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 44) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp3 = true;
} else {
tmp3 = false;
}
if(!tmp3) {
break;
}
}
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
var tmp4;
if(this.max > this.pos && this.source.charCodeAt(this.pos) == 125) {
this.pos += 1;
while(this.pos < this.max && this.source.charCodeAt(this.pos) < 33) this.pos++;
tmp4 = true;
} else {
tmp4 = false;
}
if(!tmp4) {
this.die("Expected }");
}
}
var __missing__ = function(field) {
return _gthis.die("missing field \"" + field + "\"",__start__);
};
return { defaultZoomMultiplier : hasv_defaultZoomMultiplier ? v_defaultZoomMultiplier : __missing__("defaultZoomMultiplier")};
}
,parse: function(source) {
this.init(source);
return this.parse0();
}
,__class__: tink_json_Parser2
});
var tink_json_Value = { __ename__ : true, __constructs__ : ["VNumber","VString","VNull","VBool","VArray","VObject"] };
tink_json_Value.VNumber = function(f) { var $x = ["VNumber",0,f]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; };
tink_json_Value.VString = function(s) { var $x = ["VString",1,s]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; };
tink_json_Value.VNull = ["VNull",2];
tink_json_Value.VNull.toString = $estr;
tink_json_Value.VNull.__enum__ = tink_json_Value;
tink_json_Value.VBool = function(b) { var $x = ["VBool",3,b]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; };
tink_json_Value.VArray = function(a) { var $x = ["VArray",4,a]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; };
tink_json_Value.VObject = function(a) { var $x = ["VObject",5,a]; $x.__enum__ = tink_json_Value; $x.toString = $estr; return $x; };
var tink_json_BasicWriter = function() {
this.plugins = new tink_core_Annex(this);
};
tink_json_BasicWriter.__name__ = ["tink","json","BasicWriter"];
tink_json_BasicWriter.prototype = {
init: function() {
var this1 = "";
this.buf = this1;
}
,__class__: tink_json_BasicWriter
};
var tink_json_Writer0 = function() {
tink_json_BasicWriter.call(this);
};
tink_json_Writer0.__name__ = ["tink","json","Writer0"];
tink_json_Writer0.__super__ = tink_json_BasicWriter;
tink_json_Writer0.prototype = $extend(tink_json_BasicWriter.prototype,{
parse0: function(value) {
this.buf += "{\"page\":";
var value1 = value.page;
this.parse1(value1);
this.buf += "}";
}
,parse1: function(value) {
this.buf += "{\"bbox\":";
var value1 = value.bbox;
var s = JSON.stringify(value1);
this.buf += s;
this.buf += ",\"id\":";
var value2 = value.id;
this.buf += value2 == null ? "null" : "" + value2;
this.buf += ",\"rotate\":";
var value3 = value.rotate;
if(value3 == null) {
this.buf += "null";
} else {
var s1 = JSON.stringify(value3);
this.buf += s1;
}
this.buf += ",\"textbox\":";
var value4 = value.textbox;
this.buf += "[";
var first = true;
var _g = 0;
while(_g < value4.length) {
var value5 = value4[_g];
++_g;
if(first) {
first = false;
} else {
this.buf += ",";
}
this.parse2(value5);
}
this.buf += "]";
this.buf += "}";
}
,parse2: function(value) {
this.buf += "{\"bbox\":";
var value1 = value.bbox;
var s = JSON.stringify(value1);
this.buf += s;
this.buf += ",\"id\":";
var value2 = value.id;
this.buf += value2 == null ? "null" : "" + value2;
this.buf += ",\"textline\":";
var value3 = value.textline;
this.buf += "[";
var first = true;
var _g = 0;
while(_g < value3.length) {
var value4 = value3[_g];
++_g;
if(first) {
first = false;
} else {
this.buf += ",";
}
this.parse3(value4);
}
this.buf += "]";
this.buf += "}";
}
,parse3: function(value) {
this.buf += "{\"text\":";
var value1 = value.text;
this.buf += "[";
var first = true;
var _g = 0;
while(_g < value1.length) {
var value2 = value1[_g];
++_g;
if(first) {
first = false;
} else {
this.buf += ",";
}
this.parse4(value2);
}
this.buf += "]";
this.buf += "}";
}
,parse4: function(value) {
this.buf += "{\"bbox\":";
var value1 = value.bbox;
if(value1 == null) {
this.buf += "null";
} else {
var s = JSON.stringify(value1);
this.buf += s;
}
this.buf += ",\"character\":";
var value2 = value.character;
if(value2 == null) {
this.buf += "null";
} else {
var s1 = JSON.stringify(value2);
this.buf += s1;
}
this.buf += "}";
}
,write: function(value) {
this.init();
this.parse0(value);
return this.buf.toString();
}
,__class__: tink_json_Writer0
});
var tink_pure__$List_List_$Impl_$ = {};
tink_pure__$List_List_$Impl_$.__name__ = ["tink","pure","_List","List_Impl_"];
tink_pure__$List_List_$Impl_$.fromArray = function(i) {
var ret = null;
var len = 0;
var pos = i.length;
while(pos-- > 0) ret = new tink_pure__$List_Node(++len,i[pos],ret == null ? tink_pure__$List_Node.EMPTY : [ret]);
return ret;
};
var tink_pure__$List_Node = function(length,value,tails) {
this.value = value;
this.length = length;
this.tails = tails == null ? tink_pure__$List_Node.EMPTY : tails;
};
tink_pure__$List_Node.__name__ = ["tink","pure","_List","Node"];
tink_pure__$List_Node.prototype = {
__class__: tink_pure__$List_Node
};
var tink_pure_NodeIterator = function(node) {
this.list = [];
if(node != null) {
this.list.push(node);
}
};
tink_pure_NodeIterator.__name__ = ["tink","pure","NodeIterator"];
tink_pure_NodeIterator.prototype = {
hasNext: function() {
return this.list.length > 0;
}
,next: function() {
var _g = this.list.pop();
if(_g == null) {
return null;
} else {
var next = _g;
var _g1 = -next.tails.length;
while(_g1 < 0) {
var i = _g1++;
this.list.push(next.tails[-i - 1]);
}
return next.value;
}
}
,__class__: tink_pure_NodeIterator
};
var tink_state__$Observable_Observable_$Impl_$ = {};
tink_state__$Observable_Observable_$Impl_$.__name__ = ["tink","state","_Observable","Observable_Impl_"];
tink_state__$Observable_Observable_$Impl_$.get_value = function(this1) {
return tink_state__$Observable_Observable_$Impl_$.measure(this1).a;
};
tink_state__$Observable_Observable_$Impl_$.combine = function(this1,that,f) {
return new tink_state__$Observable_SimpleObservable(function() {
var p = tink_state__$Observable_Observable_$Impl_$.measure(this1);
var q = tink_state__$Observable_Observable_$Impl_$.measure(that);
var this2;
var this3 = new tink_core_MPair(f(p.a,q.a),tink_core__$Future_Future_$Impl_$.first(p.b,q.b));
this2 = this3;
return this2;
});
};
tink_state__$Observable_Observable_$Impl_$.nextTime = function(this1,options,check) {
return tink_state__$Observable_Observable_$Impl_$.getNext(this1,options,function(v) {
if(check(v)) {
return haxe_ds_Option.Some(v);
} else {
return haxe_ds_Option.None;
}
});
};
tink_state__$Observable_Observable_$Impl_$.getNext = function(this1,options,select) {
var ret = new tink_core_FutureTrigger();
var waiting = options != null && options.butNotNow;
var link = tink_state__$Observable_Observable_$Impl_$.bind(this1,{ direct : options != null && options.hires},function(value) {
var out = select(value);
if(waiting) {
waiting = out != haxe_ds_Option.None;
} else {
switch(out[1]) {
case 0:
var value1 = out[2];
ret.trigger(value1);
break;
case 1:
break;
}
}
});
var _e = link;
var tmp = function() {
if(_e != null) {
_e.dissolve();
}
};
ret.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic(tmp));
return ret;
};
tink_state__$Observable_Observable_$Impl_$.map = function(this1,f) {
return tink_state__$Observable_Observable_$Impl_$.create(function() {
var m = tink_state__$Observable_Observable_$Impl_$.measure(this1);
var this2;
var this3 = new tink_core_MPair(f(m.a),m.b);
this2 = this3;
return this2;
});
};
tink_state__$Observable_Observable_$Impl_$.measure = function(this1) {
var before = tink_state__$Observable_Observable_$Impl_$.stack.first();
tink_state__$Observable_Observable_$Impl_$.stack.push(this1);
var p = this1.poll();
var _g = (before instanceof tink_state__$Observable_AutoObservable) ? before : null;
if(_g != null) {
var v = _g;
p.b.handle(tink_core__$Callback_Callback_$Impl_$.fromNiladic($bind(v,v.invalidate)));
}
tink_state__$Observable_Observable_$Impl_$.stack.pop();
return p;
};
tink_state__$Observable_Observable_$Impl_$.bind = function(this1,options,cb) {
if(options == null) {
var scheduled = false;
var active = true;
var updated = null;
var link = null;
var update = function() {
if(active) {
var next = tink_state__$Observable_Observable_$Impl_$.measure(this1);
tink_core__$Callback_Callback_$Impl_$.invoke(cb,next.a);
scheduled = false;
link = next.b.handle(updated);
}
};
var doSchedule = function() {
if(scheduled) {
return;
}
scheduled = true;
tink_state__$Observable_Observable_$Impl_$.schedule(update);
};
updated = tink_core__$Callback_Callback_$Impl_$.fromNiladic(doSchedule);
doSchedule();
var this2 = new tink_core__$Callback_SimpleLink(function() {
if(active) {
active = false;
if(link != null) {
link.dissolve();
}
}
});
return this2;
} else if(options.direct == null) {
var scheduled1 = false;
var active1 = true;
var updated1 = null;
var link1 = null;
var update1 = function() {
if(active1) {
var next1 = tink_state__$Observable_Observable_$Impl_$.measure(this1);
tink_core__$Callback_Callback_$Impl_$.invoke(cb,next1.a);
scheduled1 = false;
link1 = next1.b.handle(updated1);
}
};
var doSchedule1 = function() {
if(scheduled1) {
return;
}
scheduled1 = true;
tink_state__$Observable_Observable_$Impl_$.schedule(update1);
};
updated1 = tink_core__$Callback_Callback_$Impl_$.fromNiladic(doSchedule1);
doSchedule1();
var this3 = new tink_core__$Callback_SimpleLink(function() {
if(active1) {
active1 = false;
if(link1 != null) {
link1.dissolve();
}
}
});
return this3;
} else if(options.direct == false) {
var scheduled2 = false;
var active2 = true;
var updated2 = null;
var link2 = null;
var update2 = function() {
if(active2) {
var next2 = tink_state__$Observable_Observable_$Impl_$.measure(this1);
tink_core__$Callback_Callback_$Impl_$.invoke(cb,next2.a);
scheduled2 = false;
link2 = next2.b.handle(updated2);
}
};
var doSchedule2 = function() {
if(scheduled2) {
return;
}
scheduled2 = true;
tink_state__$Observable_Observable_$Impl_$.schedule(update2);
};
updated2 = tink_core__$Callback_Callback_$Impl_$.fromNiladic(doSchedule2);
doSchedule2();
var this4 = new tink_core__$Callback_SimpleLink(function() {
if(active2) {
active2 = false;
if(link2 != null) {
link2.dissolve();
}
}
});
return this4;
} else {
var link3 = null;
var update3 = null;
update3 = function(_) {
var next3 = tink_state__$Observable_Observable_$Impl_$.measure(this1);
tink_core__$Callback_Callback_$Impl_$.invoke(cb,next3.a);
link3 = next3.b.handle(update3);
};
var update4 = update3;
update4(tink_core_Noise.Noise);
var this5 = new tink_core__$Callback_SimpleLink(function() {
if(link3 != null) {
link3.dissolve();
}
});
return this5;
}
};
tink_state__$Observable_Observable_$Impl_$.schedule = function(f) {
var _g = tink_state__$Observable_Observable_$Impl_$.scheduled;
if(_g == null) {
f();
} else {
var v = _g;
v.push(f);
tink_state__$Observable_Observable_$Impl_$.scheduleUpdate();
}
};
tink_state__$Observable_Observable_$Impl_$.scheduleUpdate = function() {
if(!tink_state__$Observable_Observable_$Impl_$.isScheduled) {
tink_state__$Observable_Observable_$Impl_$.isScheduled = true;
if(tink_state__$Observable_Observable_$Impl_$.hasRAF) {
window.requestAnimationFrame(function(_) {
tink_state__$Observable_Observable_$Impl_$.scheduledRun();
});
} else {
tink_core__$Callback_Callback_$Impl_$.defer(tink_state__$Observable_Observable_$Impl_$.scheduledRun);
}
}
};
tink_state__$Observable_Observable_$Impl_$.scheduledRun = function() {
tink_state__$Observable_Observable_$Impl_$.isScheduled = false;
tink_state__$Observable_Observable_$Impl_$.updatePending();
};
tink_state__$Observable_Observable_$Impl_$.updatePending = function(maxSeconds) {
if(maxSeconds == null) {
maxSeconds = .01;
}
var end = new Date().getTime() / 1000 + maxSeconds;
while(true) {
var old = tink_state__$Observable_Observable_$Impl_$.scheduled;
tink_state__$Observable_Observable_$Impl_$.scheduled = [];
var _g = 0;
while(_g < old.length) {
var o = old[_g];
++_g;
o();
}
if(!(tink_state__$Observable_Observable_$Impl_$.scheduled.length > 0 && new Date().getTime() / 1000 < end)) {
break;
}
}
if(tink_state__$Observable_Observable_$Impl_$.scheduled.length > 0) {
tink_state__$Observable_Observable_$Impl_$.scheduleUpdate();
return true;
} else {
return false;
}
};
tink_state__$Observable_Observable_$Impl_$.create = function(f) {
return new tink_state__$Observable_SimpleObservable(f);
};
tink_state__$Observable_Observable_$Impl_$.auto = function(f) {
return new tink_state__$Observable_AutoObservable(f);
};
tink_state__$Observable_Observable_$Impl_$["const"] = function(value) {
return new tink_state_ConstObservable(value);
};
var tink_state_ObservableObject = function() { };
tink_state_ObservableObject.__name__ = ["tink","state","ObservableObject"];
tink_state_ObservableObject.prototype = {
__class__: tink_state_ObservableObject
};
var tink_state__$Observable_SimpleObservable = function(f) {
this._poll = f;
};
tink_state__$Observable_SimpleObservable.__name__ = ["tink","state","_Observable","SimpleObservable"];
tink_state__$Observable_SimpleObservable.__interfaces__ = [tink_state_ObservableObject];
tink_state__$Observable_SimpleObservable.prototype = {
resetCache: function(_) {
this.cache = null;
}
,poll: function() {
var count = 0;
var last = null;
while(this.cache == null) {
var cache = this.cache = this._poll();
if(last == cache) {
throw new js__$Boot_HaxeError("Polling loops on the same value");
}
last = cache;
cache.b.handle($bind(this,this.resetCache));
if(count++ >= 100) {
throw new js__$Boot_HaxeError("Polling not concluded after 100 iterations");
}
}
return this.cache;
}
,__class__: tink_state__$Observable_SimpleObservable
};
var tink_state__$Observable_Transform_$Impl_$ = {};
tink_state__$Observable_Transform_$Impl_$.__name__ = ["tink","state","_Observable","Transform_Impl_"];
tink_state__$Observable_Transform_$Impl_$.plain = function(f) {
var this1 = f;
return this1;
};
var tink_state_ConstObservable = function(value) {
var this1;
var this2 = new tink_core_MPair(value,tink_state_ConstObservable.NEVER);
this1 = this2;
this.m = this1;
};
tink_state_ConstObservable.__name__ = ["tink","state","ConstObservable"];
tink_state_ConstObservable.__interfaces__ = [tink_state_ObservableObject];
tink_state_ConstObservable.prototype = {
poll: function() {
return this.m;
}
,__class__: tink_state_ConstObservable
};
var tink_state__$Observable_AutoObservable = function(comp) {
var _gthis = this;
tink_state__$Observable_SimpleObservable.call(this,function() {
_gthis.trigger = new tink_core_FutureTrigger();
var this1;
var this2 = new tink_core_MPair(comp.f(),_gthis.trigger);
this1 = this2;
return this1;
});
};
tink_state__$Observable_AutoObservable.__name__ = ["tink","state","_Observable","AutoObservable"];
tink_state__$Observable_AutoObservable.__super__ = tink_state__$Observable_SimpleObservable;
tink_state__$Observable_AutoObservable.prototype = $extend(tink_state__$Observable_SimpleObservable.prototype,{
invalidate: function() {
this.trigger.trigger(tink_core_Noise.Noise);
}
,__class__: tink_state__$Observable_AutoObservable
});
var tink_state__$State_State_$Impl_$ = {};
tink_state__$State_State_$Impl_$.__name__ = ["tink","state","_State","State_Impl_"];
tink_state__$State_State_$Impl_$.get_value = function(this1) {
return tink_state__$Observable_Observable_$Impl_$.get_value(this1);
};
tink_state__$State_State_$Impl_$.toggle = function(s) {
s.set(!s.value);
};
tink_state__$State_State_$Impl_$.ofConstant = function(value) {
var this1 = new tink_state__$State_StateObject(value,null);
return this1;
};
var tink_state__$State_StateObject = function(value,isEqual) {
this.value = value;
var tmp;
if(isEqual == null) {
tmp = function(a,b) {
return a == b;
};
} else {
var v = isEqual;
tmp = v;
}
this.isEqual = tmp;
this.arm();
};
tink_state__$State_StateObject.__name__ = ["tink","state","_State","StateObject"];
tink_state__$State_StateObject.__interfaces__ = [tink_state_ObservableObject];
tink_state__$State_StateObject.prototype = {
poll: function() {
return this.next;
}
,arm: function() {
this.trigger = new tink_core_FutureTrigger();
var this1;
var this2 = new tink_core_MPair(this.value,this.trigger);
this1 = this2;
this.next = this1;
}
,set: function(value) {
if(!this.isEqual(value,this.value)) {
this.value = value;
var last = this.trigger;
this.arm();
last.trigger(tink_core_Noise.Noise);
}
}
,__class__: tink_state__$State_StateObject
};
var tink_template__$Html_Html_$Impl_$ = {};
tink_template__$Html_Html_$Impl_$.__name__ = ["tink","template","_Html","Html_Impl_"];
tink_template__$Html_Html_$Impl_$.escape = function(s) {
if(s == null) {
return null;
}
if(s == null) {
s = "null";
} else {
s = "" + s;
}
var start = 0;
var pos = 0;
var max = s.length;
var ret = "";
while(pos < max) {
var _g = s.charAt(pos++);
switch(_g) {
case "\"":
var start1 = start;
start = pos;
ret += s.substring(start1,start - 1) + """;
break;
case "&":
var start2 = start;
start = pos;
ret += s.substring(start2,start - 1) + "&";
break;
case "<":
var start3 = start;
start = pos;
ret += s.substring(start3,start - 1) + "<";
break;
case ">":
var start4 = start;
start = pos;
ret += s.substring(start4,start - 1) + ">";
break;
}
}
var this1 = ret += HxOverrides.substr(s,start,null);
return this1;
};
tink_template__$Html_Html_$Impl_$.of = function(a) {
return tink_template__$Html_Html_$Impl_$.escape(Std.string(a));
};
tink_template__$Html_Html_$Impl_$.buffer = function() {
var this1 = { s : ""};
return this1;
};
var tink_url__$Portion_Portion_$Impl_$ = {};
tink_url__$Portion_Portion_$Impl_$.__name__ = ["tink","url","_Portion","Portion_Impl_"];
tink_url__$Portion_Portion_$Impl_$.stringly = function(this1) {
return tink_url__$Portion_Portion_$Impl_$.toString(this1);
};
tink_url__$Portion_Portion_$Impl_$.toString = function(this1) {
if(this1 == null) {
return null;
} else {
return decodeURIComponent(this1.split("+").join(" "));
}
};
tink_url__$Portion_Portion_$Impl_$.ofString = function(s) {
var this1 = s == null ? "" : encodeURIComponent(s);
return this1;
};
var tink_url__$Query_QueryStringParser = function(s,sep,set,pos) {
this.s = s == null ? "" : s;
this.sep = sep;
this.set = set;
this.pos = pos;
};
tink_url__$Query_QueryStringParser.__name__ = ["tink","url","_Query","QueryStringParser"];
tink_url__$Query_QueryStringParser.trimmedSub = function(s,start,end) {
if(start >= s.length) {
var this1 = "";
return this1;
}
while(s.charCodeAt(start) < 33) ++start;
if(end < s.length - 1) {
while(s.charCodeAt(end - 1) < 33) --end;
}
var this2 = s.substring(start,end);
return this2;
};
tink_url__$Query_QueryStringParser.prototype = {
hasNext: function() {
return this.pos < this.s.length;
}
,next: function() {
var next = this.s.indexOf(this.sep,this.pos);
if(next == -1) {
next = this.s.length;
}
var split = this.s.indexOf(this.set,this.pos);
var start = this.pos;
this.pos = next + this.sep.length;
if(split == -1 || split > next) {
return new tink_core_NamedWith(tink_url__$Portion_Portion_$Impl_$.stringly(tink_url__$Query_QueryStringParser.trimmedSub(this.s,start,next)),tink_url__$Portion_Portion_$Impl_$.ofString(""));
} else {
return new tink_core_NamedWith(tink_url__$Portion_Portion_$Impl_$.stringly(tink_url__$Query_QueryStringParser.trimmedSub(this.s,start,split)),tink_url__$Query_QueryStringParser.trimmedSub(this.s,split + this.set.length,next));
}
}
,__class__: tink_url__$Query_QueryStringParser
};
var tink_xml_Reader = function() {
};
tink_xml_Reader.__name__ = ["tink","xml","Reader"];
tink_xml_Reader.prototype = {
doRead: function(x) {
throw new js__$Boot_HaxeError("abstract");
}
,read: function(x) {
try {
return tink_core_Outcome.Success(this.doRead(x));
} catch( $e0 ) {
if ($e0 instanceof js__$Boot_HaxeError) $e0 = $e0.val;
if( js_Boot.__instanceof($e0,tink_xml_ReaderError) ) {
var e = $e0;
return tink_core_Outcome.Failure(e);
} else {
var e1 = $e0;
return tink_core_Outcome.Failure(new tink_xml_ReaderError("error \"" + Std.string(e1) + "\"",x,{ fileName : "Reader.hx", lineNumber : 21, className : "tink.xml.Reader", methodName : "read"}));
}
}
}
,__class__: tink_xml_Reader
};
var tink_xml_Parser_$0 = function() {
tink_xml_Reader.call(this);
};
tink_xml_Parser_$0.__name__ = ["tink","xml","Parser_0"];
tink_xml_Parser_$0.__super__ = tink_xml_Reader;
tink_xml_Parser_$0.prototype = $extend(tink_xml_Reader.prototype,{
doRead: function(x) {
var page = false;
var ret = { page : null};
var i = 0;
var x1 = x.elements();
while(x1.hasNext()) {
var x2 = x1.next();
var n = ++i;
var a = x2.get_name();
var this1 = "page".toUpperCase();
if(a == this1) {
if(!page) {
page = true;
ret.page = tink_xml_Parser_$1.inst.doRead(x2);
} else {
throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Duplicate element \"page\"",x2,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_0", methodName : "doRead"}));
}
continue;
}
}
if(!page) {
throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing element \"page\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_0", methodName : "doRead"}));
}
return ret;
}
,__class__: tink_xml_Parser_$0
});
var tink_xml_Parser_$1 = function() {
tink_xml_Reader.call(this);
};
tink_xml_Parser_$1.__name__ = ["tink","xml","Parser_1"];
tink_xml_Parser_$1.__super__ = tink_xml_Reader;
tink_xml_Parser_$1.prototype = $extend(tink_xml_Reader.prototype,{
doRead: function(x) {
var ret = { bbox : null, id : null, textbox : []};
var i = 0;
var x1 = x.elements();
while(x1.hasNext()) {
var x2 = x1.next();
var n = ++i;
var a = x2.get_name();
var this1 = "textbox".toUpperCase();
if(a == this1) {
ret.textbox.push(tink_xml_Parser_$2.inst.doRead(x2));
continue;
}
}
var _g = x.getAttribute("bbox");
if(_g == null) {
throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing attribute \"bbox\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_1", methodName : "doRead"}));
} else {
var v = _g;
ret.bbox = v;
}
var _g1 = x.getAttribute("id");
if(_g1 == null) {
throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing attribute \"id\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_1", methodName : "doRead"}));
} else {
var v1 = _g1;
ret.id = v1 == null ? 0 : Std.parseInt(StringTools.trim(v1));
}
var _g2 = x.getAttribute("rotate");
if(_g2 != null) {
var v2 = _g2;
ret.rotate = v2;
}
return ret;
}
,__class__: tink_xml_Parser_$1
});
var tink_xml_Parser_$2 = function() {
tink_xml_Reader.call(this);
};
tink_xml_Parser_$2.__name__ = ["tink","xml","Parser_2"];
tink_xml_Parser_$2.__super__ = tink_xml_Reader;
tink_xml_Parser_$2.prototype = $extend(tink_xml_Reader.prototype,{
doRead: function(x) {
var ret = { bbox : null, id : null, textline : []};
var i = 0;
var x1 = x.elements();
while(x1.hasNext()) {
var x2 = x1.next();
var n = ++i;
var a = x2.get_name();
var this1 = "textline".toUpperCase();
if(a == this1) {
ret.textline.push(tink_xml_Parser_$3.inst.doRead(x2));
continue;
}
}
var _g = x.getAttribute("bbox");
if(_g == null) {
throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing attribute \"bbox\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_2", methodName : "doRead"}));
} else {
var v = _g;
ret.bbox = v;
}
var _g1 = x.getAttribute("id");
if(_g1 == null) {
throw new js__$Boot_HaxeError(new tink_xml_ReaderError("Missing attribute \"id\"",x,{ fileName : "Structure.hx", lineNumber : 154, className : "tink.xml.Parser_2", methodName : "doRead"}));
} else {
var v1 = _g1;
ret.id = v1 == null ? 0 : Std.parseInt(StringTools.trim(v1));
}
return ret;
}
,__class__: tink_xml_Parser_$2
});
var tink_xml_Parser_$3 = function() {
tink_xml_Reader.call(this);
};
tink_xml_Parser_$3.__name__ = ["tink","xml","Parser_3"];
tink_xml_Parser_$3.__super__ = tink_xml_Reader;
tink_xml_Parser_$3.prototype = $extend(tink_xml_Reader.prototype,{
doRead: function(x) {
var ret = { text : []};
var i = 0;
var x1 = x.elements();
while(x1.hasNext()) {
var x2 = x1.next();
var n = ++i;
var a = x2.get_name();
var this1 = "text".toUpperCase();
if(a == this1) {
ret.text.push(tink_xml_Parser_$4.inst.doRead(x2));
continue;
}
}
return ret;
}
,__class__: tink_xml_Parser_$3
});
var tink_xml_Parser_$4 = function() {
tink_xml_Reader.call(this);
};
tink_xml_Parser_$4.__name__ = ["tink","xml","Parser_4"];
tink_xml_Parser_$4.__super__ = tink_xml_Reader;
tink_xml_Parser_$4.prototype = $extend(tink_xml_Reader.prototype,{
doRead: function(x) {
var ret = { character : x.getText()};
var i = 0;
var x1 = x.elements();
while(x1.hasNext()) {
var x2 = x1.next();
var n = ++i;
}
var _g = x.getAttribute("bbox");
if(_g != null) {
var v = _g;
ret.bbox = v;
}
return ret;
}
,__class__: tink_xml_Parser_$4
});
var tink_xml_ReaderError = function(msg,data,pos) {
tink_core_TypedError.call(this,422,msg,pos);
this.data = data;
};
tink_xml_ReaderError.__name__ = ["tink","xml","ReaderError"];
tink_xml_ReaderError.__super__ = tink_core_TypedError;
tink_xml_ReaderError.prototype = $extend(tink_core_TypedError.prototype,{
toString: function() {
return "" + this.message + " at element:" + this.data.toString();
}
,__class__: tink_xml_ReaderError
});
var tink_xml__$Source_Source_$Impl_$ = {};
tink_xml__$Source_Source_$Impl_$.__name__ = ["tink","xml","_Source","Source_Impl_"];
tink_xml__$Source_Source_$Impl_$.fromString = function(s) {
try {
return tink_xml__$Source_Source_$Impl_$.fromXml(Xml.parse(s));
} catch( e ) {
if (e instanceof js__$Boot_HaxeError) e = e.val;
return new tink_xml__$Source_InvalidSource(s,e);
}
};
tink_xml__$Source_Source_$Impl_$.fromXml = function(x) {
var _g = x.nodeType;
return new tink_xml__$Source_XmlSource(_g == 6 ? x.firstElement() : x);
};
var tink_xml_ISource = function() { };
tink_xml_ISource.__name__ = ["tink","xml","ISource"];
tink_xml_ISource.prototype = {
__class__: tink_xml_ISource
};
var tink_xml__$Source_InvalidSource = function(source,error) {
this.source = source;
this.error = new tink_xml_ReaderError("Failed to parse Xml because " + Std.string(error),this,{ fileName : "Source.hx", lineNumber : 75, className : "tink.xml._Source.InvalidSource", methodName : "new"});
};
tink_xml__$Source_InvalidSource.__name__ = ["tink","xml","_Source","InvalidSource"];
tink_xml__$Source_InvalidSource.__interfaces__ = [tink_xml_ISource];
tink_xml__$Source_InvalidSource.prototype = {
get_name: function() {
throw new js__$Boot_HaxeError(this.error);
}
,getText: function() {
throw new js__$Boot_HaxeError(this.error);
}
,getAttribute: function(name) {
throw new js__$Boot_HaxeError(this.error);
}
,elements: function() {
throw new js__$Boot_HaxeError(this.error);
}
,toString: function() {
return this.source;
}
,__class__: tink_xml__$Source_InvalidSource
};
var tink_xml__$Source_XmlSource = function(x) {
this.x = x;
};
tink_xml__$Source_XmlSource.__name__ = ["tink","xml","_Source","XmlSource"];
tink_xml__$Source_XmlSource.__interfaces__ = [tink_xml_ISource];
tink_xml__$Source_XmlSource.prototype = {
get_name: function() {
var _this = this.x;
if(_this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + _this.nodeType);
}
var this1 = _this.nodeName.toUpperCase();
return this1;
}
,getText: function() {
var _g = [];
var _this = this.x;
if(_this.nodeType != Xml.Document && _this.nodeType != Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + _this.nodeType);
}
var c = HxOverrides.iter(_this.children);
while(c.hasNext()) {
var c1 = c.next();
if(c1.nodeType != Xml.Comment) {
var tmp;
try {
if(c1.nodeType == Xml.Document || c1.nodeType == Xml.Element) {
throw new js__$Boot_HaxeError("Bad node type, unexpected " + c1.nodeType);
}
tmp = c1.nodeValue;
} catch( e ) {
tmp = haxe_xml_Printer.print(c1);
}
_g.push(tmp);
}
}
return _g.join("");
}
,getAttribute: function(name) {
return this.x.get(name);
}
,elements: function() {
var ret = this.x.elements();
return { hasNext : function() {
return ret.hasNext();
}, next : function() {
return new tink_xml__$Source_XmlSource(ret.next());
}};
}
,toString: function() {
return haxe_xml_Printer.print(this.x);
}
,__class__: tink_xml__$Source_XmlSource
};
var util_touch_TouchHandler = function() {
this._tap = new tink_core_SignalTrigger();
this._move = new tink_core_SignalTrigger();
this._jet = new tink_core_SignalTrigger();
this._pinch = new tink_core_SignalTrigger();
this.pinch = this._pinch;
this.jet = this._jet;
this.move = this._move;
this.tap = this._tap;
this.trails = new haxe_ds_IntMap();
var root = window.document.body.querySelector(".epaper-root");
root.addEventListener("touchstart",$bind(this,this.touchstart),true);
root.addEventListener("touchmove",$bind(this,this.touchmove),true);
root.addEventListener("touchend",$bind(this,this.touchend),true);
};
util_touch_TouchHandler.__name__ = ["util","touch","TouchHandler"];
util_touch_TouchHandler.prototype = {
array: function(t) {
var __tmp = [];
var _g = 0;
while(_g < t.length) {
var t1 = t[_g];
++_g;
__tmp.push(t1);
}
return __tmp;
}
,target: function(t) {
return t.target;
}
,touchstart: function(t) {
var _g = 0;
var _g1 = t.changedTouches;
while(_g < _g1.length) {
var t1 = _g1[_g];
++_g;
var this1 = this.trails;
var k = t1.identifier;
var v = new util_touch_TouchTrail(t1);
this1.h[k] = v;
}
if(Lambda.count(this.trails) > 1) {
var t2 = this.trails.iterator();
while(t2.hasNext()) {
var t3 = t2.next();
t3.dirty = true;
}
}
var _g2 = this.array(t.touches);
if(_g2.length == 1) {
var v1 = _g2[0];
var cur = this.target(t);
while(cur != null) {
var style = window.getComputedStyle(cur);
var _g3 = style.overflowY;
var _g11 = style.overflowX;
switch(_g11) {
case "auto":case "scroll":
return;
default:
switch(_g3) {
case "auto":case "scroll":
return;
default:
cur = cur.parentElement;
}
}
}
if(!util_touch_TouchHandler.isAnroid) {
t.preventDefault();
}
} else {
var v2 = _g2;
if(!util_touch_TouchHandler.isAnroid) {
t.preventDefault();
}
}
}
,touchmove: function(t) {
var _gthis = this;
var _g = 0;
var _g1 = t.changedTouches;
while(_g < _g1.length) {
var t1 = _g1[_g];
++_g;
this.trails.h[t1.identifier].add(t1);
}
var _g2 = this.array(t.touches).map(function(t2) {
return _gthis.trails.get(t2.identifier);
});
switch(_g2.length) {
case 1:
var t3 = _g2[0];
var _this = this._move;
var a = t3.get(-1).point;
var b = t3.get(-2).point;
var this1;
var this2 = new tink_core_MPair(a.a - b.a,a.b - b.b);
this1 = this2;
var event = { delta : this1, pos : t3.get(-1).point, target : t3.target};
tink_core__$Callback_CallbackList_$Impl_$.invoke(_this.handlers,event);
break;
case 2:
var t21 = _g2[1];
var t11 = _g2[0];
var a1 = t11.get_last().point;
var b1 = t21.get_last().point;
var this3;
var this4 = new tink_core_MPair(a1.a - b1.a,a1.b - b1.b);
this3 = this4;
var this5 = this3;
var nuDist = Math.sqrt(this5.a * this5.a + this5.b * this5.b);
var a2 = t11.get(-2).point;
var b2 = t21.get(-2).point;
var this6;
var this7 = new tink_core_MPair(a2.a - b2.a,a2.b - b2.b);
this6 = this7;
var this8 = this6;
var oldDist = Math.sqrt(this8.a * this8.a + this8.b * this8.b);
var a3 = t11.get_last().point;
var b3 = t21.get_last().point;
var this9;
var this10 = new tink_core_MPair(a3.a + b3.a,a3.b + b3.b);
this9 = this10;
var p = this9;
var this11;
var this12 = new tink_core_MPair(p.a * .5,p.b * .5);
this11 = this12;
var center = this11;
var scale = nuDist / oldDist;
tink_core__$Callback_CallbackList_$Impl_$.invoke(this._pinch.handlers,{ scale : scale, center : center, target : t11.target});
t.preventDefault();
break;
default:
}
}
,touchend: function(t) {
if(t.touches.length == 0) {
var _g = this.trails.get(t.changedTouches[0].identifier);
var v = _g;
if(!v.dirty) {
var a = v.get(0).point;
var b = v.get(-1).point;
var this1;
var this2 = new tink_core_MPair(a.a - b.a,a.b - b.b);
this1 = this2;
var this3 = this1;
if(Math.sqrt(this3.a * this3.a + this3.b * this3.b) < 10) {
if(!util_touch_TouchHandler.isAnroid) {
var target = this.target(t);
if(target.nodeName != "INPUT") {
t.preventDefault();
}
util_touch_TouchHandler.isFakeClick = true;
try {
target.focus();
var lT = t.changedTouches[0];
var evt1 = window.document.createEvent("MouseEvents");
evt1.initMouseEvent("click",true,true,window,1,lT.screenX,lT.screenY,lT.clientX,lT.clientX,false,false,false,false,0,null);
target.dispatchEvent(evt1);
util_touch_TouchHandler.isFakeClick = false;
} catch( e ) {
var $hx_rethrow = e;
util_touch_TouchHandler.isFakeClick = false;
throw $hx_rethrow;
}
}
} else {
var _this = this._jet;
var event = { v : v.get_lastVelocity(), pos : v.get_last().point, target : v.target};
tink_core__$Callback_CallbackList_$Impl_$.invoke(_this.handlers,event);
}
}
}
var _g1 = 0;
var _g11 = t.changedTouches;
while(_g1 < _g11.length) {
var t1 = _g11[_g1];
++_g1;
this.trails.remove(t1.identifier);
}
}
,get_pinch: function() {
return this.pinch;
}
,get_jet: function() {
return this.jet;
}
,get_move: function() {
return this.move;
}
,__class__: util_touch_TouchHandler
};
var util_touch_TouchTrail = function(touch) {
this.dirty = false;
this.touch = touch;
this.target = touch.target;
this.steps = [new util_touch_TouchStep(touch)];
};
util_touch_TouchTrail.__name__ = ["util","touch","TouchTrail"];
util_touch_TouchTrail.prototype = {
get: function(i) {
while(i < 0) i += this.steps.length;
return this.steps[i];
}
,add: function(touch) {
this.steps.push(new util_touch_TouchStep(touch));
}
,get_last: function() {
return this.get(-1);
}
,get_lastTimeDelta: function() {
return this.get(-1).stamp - this.get(-2).stamp;
}
,get_lastMovement: function() {
var a = this.get(-1).point;
var b = this.get(-2).point;
var this1;
var this2 = new tink_core_MPair(a.a - b.a,a.b - b.b);
this1 = this2;
return this1;
}
,get_lastVelocity: function() {
var p = this.get_lastMovement();
var f = 1 / this.get_lastTimeDelta();
var this1;
var this2 = new tink_core_MPair(p.a * f,p.b * f);
this1 = this2;
return this1;
}
,__class__: util_touch_TouchTrail
};
var util_touch_TouchStep = function(t) {
this.stamp = new Date().getTime() / 1000;
var this1;
var this2 = new tink_core_MPair(t.clientX,t.clientY);
this1 = this2;
this.point = this1;
};
util_touch_TouchStep.__name__ = ["util","touch","TouchStep"];
util_touch_TouchStep.prototype = {
__class__: util_touch_TouchStep
};
var vdom__$Attr_ClassName_$Impl_$ = {};
vdom__$Attr_ClassName_$Impl_$.__name__ = ["vdom","_Attr","ClassName_Impl_"];
vdom__$Attr_ClassName_$Impl_$.ofMap = function(parts) {
var _g = [];
var c = parts.keys();
while(c.hasNext()) {
var c1 = c.next();
if(__map_reserved[c1] != null ? parts.getReserved(c1) : parts.h[c1]) {
_g.push(vdom__$Attr_ClassName_$Impl_$.ofString(c1));
}
}
var this1 = vdom__$Attr_ClassName_$Impl_$.ofArray(_g);
return this1;
};
vdom__$Attr_ClassName_$Impl_$.ofArray = function(parts) {
var this1 = parts.map(vdom__$Attr_ClassName_$Impl_$.ofString).join(" ");
return this1;
};
vdom__$Attr_ClassName_$Impl_$.ofString = function(s) {
var this1 = StringTools.trim(s);
return this1;
};
var vdom__$Attr_Key_$Impl_$ = {};
vdom__$Attr_Key_$Impl_$.__name__ = ["vdom","_Attr","Key_Impl_"];
vdom__$Attr_Key_$Impl_$.ofObj = function(v) {
if(v == null) {
return null;
}
var o = v;
if(o.__vdomKey__ == null) {
o.__vdomKey__ = vdom__$Attr_Key_$Impl_$.keygen++;
}
return o.__vdomKey__;
};
var vdom_Foreign = function(e) {
vdom_Widget.call(this);
this.element = e;
};
vdom_Foreign.__name__ = ["vdom","Foreign"];
vdom_Foreign.__super__ = vdom_Widget;
vdom_Foreign.prototype = $extend(vdom_Widget.prototype,{
init: function() {
return this.element;
}
,update: function(_,_1) {
return this.element;
}
,__class__: vdom_Foreign
});
var vdom_HtmlFragment = function(content,tag,className) {
if(tag == null) {
tag = "span";
}
vdom_Widget.call(this);
this.content = content;
this.tag = tag;
this.className = className;
};
vdom_HtmlFragment.__name__ = ["vdom","HtmlFragment"];
vdom_HtmlFragment.create = function(attr) {
if(attr.content == "" && attr.force != true) {
return null;
} else {
return new vdom_HtmlFragment(attr.content,attr.tag,attr.className);
}
};
vdom_HtmlFragment.__super__ = vdom_Widget;
vdom_HtmlFragment.prototype = $extend(vdom_Widget.prototype,{
init: function() {
if(this.element == null) {
this.element = window.document.createElement(this.tag);
this.element.innerHTML = this.content;
if(this.className != null) {
this.element.className = this.className;
}
}
return this.element;
}
,update: function(old,e) {
var _g = (old instanceof vdom_HtmlFragment) ? old : null;
if(_g == null) {
return this.init();
} else {
var v = _g;
if(v.tag == this.tag) {
this.element = e;
if(this.className != v.className) {
this.element.className = this.className;
}
if(this.content != v.content) {
this.element.innerHTML = this.content;
}
return e;
} else {
return this.init();
}
}
}
,__class__: vdom_HtmlFragment
});
var vdom__$Style_Style_$Impl_$ = {};
vdom__$Style_Style_$Impl_$.__name__ = ["vdom","_Style","Style_Impl_"];
vdom__$Style_Style_$Impl_$.ofString = function(s) {
vdom__$Style_Style_$Impl_$.style.cssText = s;
var ret = { };
var ret1 = ret;
var _g = 0;
var _g1 = vdom__$Style_Style_$Impl_$.style;
while(_g < _g1.length) {
var name = _g1[_g];
++_g;
ret1[name] = vdom__$Style_Style_$Impl_$.style.getPropertyValue(name);
}
return ret;
};
var vdom__$VNode_VNode_$Impl_$ = {};
vdom__$VNode_VNode_$Impl_$.__name__ = ["vdom","_VNode","VNode_Impl_"];
vdom__$VNode_VNode_$Impl_$.flatten = function(c) {
return c;
};
function $iterator(o) { if( o instanceof Array ) return function() { return HxOverrides.iter(o); }; return typeof(o.iterator) == 'function' ? $bind(o,o.iterator) : o.iterator; }
var $_, $fid = 0;
function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $fid++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; o.hx__closures__[m.__id__] = f; } return f; }
var prefixes = ["moz","webkit","ms"];
var obj = Object;
var fields = function(o) {
var ret = [];
for (var name in o) ret.push(name);
return ret;
};
var copy = function(source,target) {
var _g = 0;
var _g1 = fields(source);
while(_g < _g1.length) {
var f = _g1[_g];
++_g;
var _g2 = 0;
while(_g2 < prefixes.length) {
var p = prefixes[_g2];
++_g2;
if(StringTools.startsWith(f,p)) {
var name = HxOverrides.substr(f,p.length,1).toLowerCase() + HxOverrides.substr(f,p.length + 1,null);
if(obj.getOwnPropertyDescriptor(target,name) == null) {
obj.defineProperty(target,name,{ get : eval("(function () { return this." + f + "; })"), set : eval("(function (param) { this." + f + " = param; })")});
}
}
}
}
};
var dummy = window.document.createElement("div");
copy(dummy,HTMLElement.prototype);
copy(dummy.style,CSSStyleDeclaration.prototype);
copy(window.document,window.document);
if(HTMLElement.prototype.matches == null) {
HTMLElement.prototype.matches = HTMLElement.prototype.matchesSelector;
}
if(window.document.mozCancelFullScreen) {
window.document.exitFullscreen = window.document.mozCancelFullScreen;
}
if(HTMLElement.prototype.requestFullScreen) {
HTMLElement.prototype.requestFullscreen = HTMLElement.prototype.requestFullScreen;
}
String.prototype.__class__ = String;
String.__name__ = ["String"];
Array.__name__ = ["Array"];
Date.prototype.__class__ = Date;
Date.__name__ = ["Date"];
var Int = { __name__ : ["Int"]};
var Dynamic = { __name__ : ["Dynamic"]};
var Float = Number;
Float.__name__ = ["Float"];
var Bool = Boolean;
Bool.__ename__ = ["Bool"];
var Class = { __name__ : ["Class"]};
var Enum = { };
var __map_reserved = {}
var vdom_VDom = function(e){return e()}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o
* Available under the MIT License
* ECMAScript compliant, uniform cross-browser split method
*/
/**
* Splits a string into an array of strings using a regex or string separator. Matches of the
* separator are not included in the result array. However, if `separator` is a regex that contains
* capturing groups, backreferences are spliced into the result each time `separator` is matched.
* Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably
* cross-browser.
* @param {String} str String to split.
* @param {RegExp|String} separator Regex or string to use for separating the string.
* @param {Number} [limit] Maximum number of items to include in the result array.
* @returns {Array} Array of substrings.
* @example
*
* // Basic use
* split('a b c d', ' ');
* // -> ['a', 'b', 'c', 'd']
*
* // With limit
* split('a b c d', ' ', 2);
* // -> ['a', 'b']
*
* // Backreferences in result array
* split('..word1 word2..', /([a-z]+)(\d+)/i);
* // -> ['..', 'word', '1', ' ', 'word', '2', '..']
*/
module.exports = (function split(undef) {
var nativeSplit = String.prototype.split,
compliantExecNpcg = /()??/.exec("")[1] === undef,
// NPCG: nonparticipating capturing group
self;
self = function(str, separator, limit) {
// If `separator` is not a regex, use `nativeSplit`
if (Object.prototype.toString.call(separator) !== "[object RegExp]") {
return nativeSplit.call(str, separator, limit);
}
var output = [],
flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6
(separator.sticky ? "y" : ""),
// Firefox 3+
lastLastIndex = 0,
// Make `global` and avoid `lastIndex` issues by working with a copy
separator = new RegExp(separator.source, flags + "g"),
separator2, match, lastIndex, lastLength;
str += ""; // Type-convert
if (!compliantExecNpcg) {
// Doesn't need flags gy, but they don't hurt
separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags);
}
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // Math.pow(2, 32) - 1
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
* If other: Type-convert, then use the above rules
*/
limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1
limit >>> 0; // ToUint32(limit)
while (match = separator.exec(str)) {
// `separator.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0].length;
if (lastIndex > lastLastIndex) {
output.push(str.slice(lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1) {
match[0].replace(separator2, function() {
for (var i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undef) {
match[i] = undef;
}
}
});
}
if (match.length > 1 && match.index < str.length) {
Array.prototype.push.apply(output, match.slice(1));
}
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= limit) {
break;
}
}
if (separator.lastIndex === match.index) {
separator.lastIndex++; // Avoid an infinite loop
}
}
if (lastLastIndex === str.length) {
if (lastLength || !separator.test("")) {
output.push("");
}
} else {
output.push(str.slice(lastLastIndex));
}
return output.length > limit ? output.slice(0, limit) : output;
};
return self;
})();
},{}],6:[function(require,module,exports){
},{}],7:[function(require,module,exports){
'use strict';
var OneVersionConstraint = require('individual/one-version');
var MY_VERSION = '7';
OneVersionConstraint('ev-store', MY_VERSION);
var hashKey = '__EV_STORE_KEY@' + MY_VERSION;
module.exports = EvStore;
function EvStore(elem) {
var hash = elem[hashKey];
if (!hash) {
hash = elem[hashKey] = {};
}
return hash;
}
},{"individual/one-version":9}],8:[function(require,module,exports){
(function (global){
'use strict';
/*global window, global*/
var root = typeof window !== 'undefined' ?
window : typeof global !== 'undefined' ?
global : {};
module.exports = Individual;
function Individual(key, value) {
if (key in root) {
return root[key];
}
root[key] = value;
return value;
}
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],9:[function(require,module,exports){
'use strict';
var Individual = require('./index.js');
module.exports = OneVersion;
function OneVersion(moduleName, version, defaultValue) {
var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName;
var enforceKey = key + '_ENFORCE_SINGLETON';
var versionValue = Individual(enforceKey, version);
if (versionValue !== version) {
throw new Error('Can only have one copy of ' +
moduleName + '.\n' +
'You already have version ' + versionValue +
' installed.\n' +
'This means you cannot install version ' + version);
}
return Individual(key, defaultValue);
}
},{"./index.js":8}],10:[function(require,module,exports){
(function (global){
var topLevel = typeof global !== 'undefined' ? global :
typeof window !== 'undefined' ? window : {}
var minDoc = require('min-document');
if (typeof document !== 'undefined') {
module.exports = document;
} else {
var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
if (!doccy) {
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
}
module.exports = doccy;
}
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"min-document":6}],11:[function(require,module,exports){
"use strict";
module.exports = function isObject(x) {
return typeof x === "object" && x !== null;
};
},{}],12:[function(require,module,exports){
var nativeIsArray = Array.isArray
var toString = Object.prototype.toString
module.exports = nativeIsArray || isArray
function isArray(obj) {
return toString.call(obj) === "[object Array]"
}
},{}],13:[function(require,module,exports){
var patch = require("./vdom/patch.js")
module.exports = patch
},{"./vdom/patch.js":18}],14:[function(require,module,exports){
var isObject = require("is-object")
var isHook = require("../vnode/is-vhook.js")
module.exports = applyProperties
function applyProperties(node, props, previous) {
for (var propName in props) {
var propValue = props[propName]
if (propValue === undefined) {
removeProperty(node, propName, propValue, previous);
} else if (isHook(propValue)) {
removeProperty(node, propName, propValue, previous)
if (propValue.hook) {
propValue.hook(node,
propName,
previous ? previous[propName] : undefined)
}
} else {
if (isObject(propValue)) {
patchObject(node, props, previous, propName, propValue);
} else {
node[propName] = propValue
}
}
}
}
function removeProperty(node, propName, propValue, previous) {
if (previous) {
var previousValue = previous[propName]
if (!isHook(previousValue)) {
if (propName === "attributes") {
for (var attrName in previousValue) {
node.removeAttribute(attrName)
}
} else if (propName === "style") {
for (var i in previousValue) {
node.style[i] = ""
}
} else if (typeof previousValue === "string") {
node[propName] = ""
} else {
node[propName] = null
}
} else if (previousValue.unhook) {
previousValue.unhook(node, propName, propValue)
}
}
}
function patchObject(node, props, previous, propName, propValue) {
var previousValue = previous ? previous[propName] : undefined
// Set attributes
if (propName === "attributes") {
for (var attrName in propValue) {
var attrValue = propValue[attrName]
if (attrValue === undefined) {
node.removeAttribute(attrName)
} else {
node.setAttribute(attrName, attrValue)
}
}
return
}
if(previousValue && isObject(previousValue) &&
getPrototype(previousValue) !== getPrototype(propValue)) {
node[propName] = propValue
return
}
if (!isObject(node[propName])) {
node[propName] = {}
}
var replacer = propName === "style" ? "" : undefined
for (var k in propValue) {
var value = propValue[k]
node[propName][k] = (value === undefined) ? replacer : value
}
}
function getPrototype(value) {
if (Object.getPrototypeOf) {
return Object.getPrototypeOf(value)
} else if (value.__proto__) {
return value.__proto__
} else if (value.constructor) {
return value.constructor.prototype
}
}
},{"../vnode/is-vhook.js":26,"is-object":11}],15:[function(require,module,exports){
var document = require("global/document")
var applyProperties = require("./apply-properties")
var isVNode = require("../vnode/is-vnode.js")
var isVText = require("../vnode/is-vtext.js")
var isWidget = require("../vnode/is-widget.js")
var handleThunk = require("../vnode/handle-thunk.js")
module.exports = createElement
function createElement(vnode, opts) {
var doc = opts ? opts.document || document : document
var warn = opts ? opts.warn : null
vnode = handleThunk(vnode).a
if (isWidget(vnode)) {
return vnode.init()
} else if (isVText(vnode)) {
return doc.createTextNode(vnode.text)
} else if (!isVNode(vnode)) {
if (warn) {
warn("Item is not a valid virtual dom node", vnode)
}
return null
}
var node = (vnode.namespace === null) ?
doc.createElement(vnode.tagName) :
doc.createElementNS(vnode.namespace, vnode.tagName)
var props = vnode.properties
applyProperties(node, props)
var children = vnode.children
for (var i = 0; i < children.length; i++) {
var childNode = createElement(children[i], opts)
if (childNode) {
node.appendChild(childNode)
}
}
return node
}
},{"../vnode/handle-thunk.js":24,"../vnode/is-vnode.js":27,"../vnode/is-vtext.js":28,"../vnode/is-widget.js":29,"./apply-properties":14,"global/document":10}],16:[function(require,module,exports){
// Maps a virtual DOM tree onto a real DOM tree in an efficient manner.
// We don't want to read all of the DOM nodes in the tree so we use
// the in-order tree indexing to eliminate recursion down certain branches.
// We only recurse into a DOM node if we know that it contains a child of
// interest.
var noChild = {}
module.exports = domIndex
function domIndex(rootNode, tree, indices, nodes) {
if (!indices || indices.length === 0) {
return {}
} else {
indices.sort(ascending)
return recurse(rootNode, tree, indices, nodes, 0)
}
}
function recurse(rootNode, tree, indices, nodes, rootIndex) {
nodes = nodes || {}
if (rootNode) {
if (indexInRange(indices, rootIndex, rootIndex)) {
nodes[rootIndex] = rootNode
}
var vChildren = tree.children
if (vChildren) {
var childNodes = rootNode.childNodes
for (var i = 0; i < tree.children.length; i++) {
rootIndex += 1
var vChild = vChildren[i] || noChild
var nextIndex = rootIndex + (vChild.count || 0)
// skip recursion down the tree if there are no nodes down here
if (indexInRange(indices, rootIndex, nextIndex)) {
recurse(childNodes[i], vChild, indices, nodes, rootIndex)
}
rootIndex = nextIndex
}
}
}
return nodes
}
// Binary search for an index in the interval [left, right]
function indexInRange(indices, left, right) {
if (indices.length === 0) {
return false
}
var minIndex = 0
var maxIndex = indices.length - 1
var currentIndex
var currentItem
while (minIndex <= maxIndex) {
currentIndex = ((maxIndex + minIndex) / 2) >> 0
currentItem = indices[currentIndex]
if (minIndex === maxIndex) {
return currentItem >= left && currentItem <= right
} else if (currentItem < left) {
minIndex = currentIndex + 1
} else if (currentItem > right) {
maxIndex = currentIndex - 1
} else {
return true
}
}
return false;
}
function ascending(a, b) {
return a > b ? 1 : -1
}
},{}],17:[function(require,module,exports){
var applyProperties = require("./apply-properties")
var isWidget = require("../vnode/is-widget.js")
var VPatch = require("../vnode/vpatch.js")
var updateWidget = require("./update-widget")
module.exports = applyPatch
function applyPatch(vpatch, domNode, renderOptions) {
var type = vpatch.type
var vNode = vpatch.vNode
var patch = vpatch.patch
switch (type) {
case VPatch.REMOVE:
return removeNode(domNode, vNode)
case VPatch.INSERT:
return insertNode(domNode, patch, renderOptions)
case VPatch.VTEXT:
return stringPatch(domNode, vNode, patch, renderOptions)
case VPatch.WIDGET:
return widgetPatch(domNode, vNode, patch, renderOptions)
case VPatch.VNODE:
return vNodePatch(domNode, vNode, patch, renderOptions)
case VPatch.ORDER:
reorderChildren(domNode, patch)
return domNode
case VPatch.PROPS:
applyProperties(domNode, patch, vNode.properties)
return domNode
case VPatch.THUNK:
return replaceRoot(domNode,
renderOptions.patch(domNode, patch, renderOptions))
default:
return domNode
}
}
function removeNode(domNode, vNode) {
var parentNode = domNode.parentNode
if (parentNode) {
parentNode.removeChild(domNode)
}
destroyWidget(domNode, vNode);
return null
}
function insertNode(parentNode, vNode, renderOptions) {
var newNode = renderOptions.render(vNode, renderOptions)
if (parentNode) {
parentNode.appendChild(newNode)
}
return parentNode
}
function stringPatch(domNode, leftVNode, vText, renderOptions) {
var newNode
if (domNode.nodeType === 3) {
domNode.replaceData(0, domNode.length, vText.text)
newNode = domNode
} else {
var parentNode = domNode.parentNode
newNode = renderOptions.render(vText, renderOptions)
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
}
return newNode
}
function widgetPatch(domNode, leftVNode, widget, renderOptions) {
var updating = updateWidget(leftVNode, widget)
var newNode
if (updating) {
newNode = widget.update(leftVNode, domNode) || domNode
} else {
newNode = renderOptions.render(widget, renderOptions)
}
var parentNode = domNode.parentNode
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
if (!updating) {
destroyWidget(domNode, leftVNode)
}
return newNode
}
function vNodePatch(domNode, leftVNode, vNode, renderOptions) {
var parentNode = domNode.parentNode
var newNode = renderOptions.render(vNode, renderOptions)
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
return newNode
}
function destroyWidget(domNode, w) {
if (typeof w.destroy === "function" && isWidget(w)) {
w.destroy(domNode)
}
}
function reorderChildren(domNode, moves) {
var childNodes = domNode.childNodes
var keyMap = {}
var node
var remove
var insert
for (var i = 0; i < moves.removes.length; i++) {
remove = moves.removes[i]
node = childNodes[remove.from]
if (remove.key) {
keyMap[remove.key] = node
}
domNode.removeChild(node)
}
var length = childNodes.length
for (var j = 0; j < moves.inserts.length; j++) {
insert = moves.inserts[j]
node = keyMap[insert.key]
// this is the weirdest bug i've ever seen in webkit
domNode.insertBefore(node, insert.to >= length++ ? null : childNodes[insert.to])
}
}
function replaceRoot(oldRoot, newRoot) {
if (oldRoot && newRoot && oldRoot !== newRoot && oldRoot.parentNode) {
oldRoot.parentNode.replaceChild(newRoot, oldRoot)
}
return newRoot;
}
},{"../vnode/is-widget.js":29,"../vnode/vpatch.js":32,"./apply-properties":14,"./update-widget":19}],18:[function(require,module,exports){
var document = require("global/document")
var isArray = require("x-is-array")
var render = require("./create-element")
var domIndex = require("./dom-index")
var patchOp = require("./patch-op")
module.exports = patch
function patch(rootNode, patches, renderOptions) {
renderOptions = renderOptions || {}
renderOptions.patch = renderOptions.patch && renderOptions.patch !== patch
? renderOptions.patch
: patchRecursive
renderOptions.render = renderOptions.render || render
return renderOptions.patch(rootNode, patches, renderOptions)
}
function patchRecursive(rootNode, patches, renderOptions) {
var indices = patchIndices(patches)
if (indices.length === 0) {
return rootNode
}
var index = domIndex(rootNode, patches.a, indices)
var ownerDocument = rootNode.ownerDocument
if (!renderOptions.document && ownerDocument !== document) {
renderOptions.document = ownerDocument
}
for (var i = 0; i < indices.length; i++) {
var nodeIndex = indices[i]
rootNode = applyPatch(rootNode,
index[nodeIndex],
patches[nodeIndex],
renderOptions)
}
return rootNode
}
function applyPatch(rootNode, domNode, patchList, renderOptions) {
if (!domNode) {
return rootNode
}
var newNode
if (isArray(patchList)) {
for (var i = 0; i < patchList.length; i++) {
newNode = patchOp(patchList[i], domNode, renderOptions)
if (domNode === rootNode) {
rootNode = newNode
}
}
} else {
newNode = patchOp(patchList, domNode, renderOptions)
if (domNode === rootNode) {
rootNode = newNode
}
}
return rootNode
}
function patchIndices(patches) {
var indices = []
for (var key in patches) {
if (key !== "a") {
indices.push(Number(key))
}
}
return indices
}
},{"./create-element":15,"./dom-index":16,"./patch-op":17,"global/document":10,"x-is-array":12}],19:[function(require,module,exports){
var isWidget = require("../vnode/is-widget.js")
module.exports = updateWidget
function updateWidget(a, b) {
if (isWidget(a) && isWidget(b)) {
if ("name" in a && "name" in b) {
return a.id === b.id
} else {
return a.init === b.init
}
}
return false
}
},{"../vnode/is-widget.js":29}],20:[function(require,module,exports){
'use strict';
var EvStore = require('ev-store');
module.exports = EvHook;
function EvHook(value) {
if (!(this instanceof EvHook)) {
return new EvHook(value);
}
this.value = value;
}
EvHook.prototype.hook = function (node, propertyName) {
var es = EvStore(node);
var propName = propertyName.substr(3);
es[propName] = this.value;
};
EvHook.prototype.unhook = function(node, propertyName) {
var es = EvStore(node);
var propName = propertyName.substr(3);
es[propName] = undefined;
};
},{"ev-store":7}],21:[function(require,module,exports){
'use strict';
module.exports = SoftSetHook;
function SoftSetHook(value) {
if (!(this instanceof SoftSetHook)) {
return new SoftSetHook(value);
}
this.value = value;
}
SoftSetHook.prototype.hook = function (node, propertyName) {
if (node[propertyName] !== this.value) {
node[propertyName] = this.value;
}
};
},{}],22:[function(require,module,exports){
'use strict';
var isArray = require('x-is-array');
var VNode = require('../vnode/vnode.js');
var VText = require('../vnode/vtext.js');
var isVNode = require('../vnode/is-vnode');
var isVText = require('../vnode/is-vtext');
var isWidget = require('../vnode/is-widget');
var isHook = require('../vnode/is-vhook');
var isVThunk = require('../vnode/is-thunk');
var parseTag = require('./parse-tag.js');
var softSetHook = require('./hooks/soft-set-hook.js');
var evHook = require('./hooks/ev-hook.js');
module.exports = h;
function h(tagName, properties, children) {
var childNodes = [];
var tag, props, key, namespace;
if (!children && isChildren(properties)) {
children = properties;
props = {};
}
props = props || properties || {};
tag = parseTag(tagName, props);
// support keys
if (props.hasOwnProperty('key')) {
key = props.key;
props.key = undefined;
}
// support namespace
if (props.hasOwnProperty('namespace')) {
namespace = props.namespace;
props.namespace = undefined;
}
// fix cursor bug
if (tag === 'INPUT' &&
!namespace &&
props.hasOwnProperty('value') &&
props.value !== undefined &&
!isHook(props.value)
) {
props.value = softSetHook(props.value);
}
transformProperties(props);
if (children !== undefined && children !== null) {
addChild(children, childNodes, tag, props);
}
return new VNode(tag, props, childNodes, key, namespace);
}
function addChild(c, childNodes, tag, props) {
if (typeof c === 'string') {
childNodes.push(new VText(c));
} else if (typeof c === 'number') {
childNodes.push(new VText(String(c)));
} else if (isChild(c)) {
childNodes.push(c);
} else if (isArray(c)) {
for (var i = 0; i < c.length; i++) {
addChild(c[i], childNodes, tag, props);
}
} else if (c === null || c === undefined) {
return;
} else {
throw UnexpectedVirtualElement({
foreignObject: c,
parentVnode: {
tagName: tag,
properties: props
}
});
}
}
function transformProperties(props) {
for (var propName in props) {
if (props.hasOwnProperty(propName)) {
var value = props[propName];
if (isHook(value)) {
continue;
}
if (propName.substr(0, 3) === 'ev-') {
// add ev-foo support
props[propName] = evHook(value);
}
}
}
}
function isChild(x) {
return isVNode(x) || isVText(x) || isWidget(x) || isVThunk(x);
}
function isChildren(x) {
return typeof x === 'string' || isArray(x) || isChild(x);
}
function UnexpectedVirtualElement(data) {
var err = new Error();
err.type = 'virtual-hyperscript.unexpected.virtual-element';
err.message = 'Unexpected virtual child passed to h().\n' +
'Expected a VNode / Vthunk / VWidget / string but:\n' +
'got:\n' +
errorString(data.foreignObject) +
'.\n' +
'The parent vnode is:\n' +
errorString(data.parentVnode)
'\n' +
'Suggested fix: change your `h(..., [ ... ])` callsite.';
err.foreignObject = data.foreignObject;
err.parentVnode = data.parentVnode;
return err;
}
function errorString(obj) {
try {
return JSON.stringify(obj, null, ' ');
} catch (e) {
return String(obj);
}
}
},{"../vnode/is-thunk":25,"../vnode/is-vhook":26,"../vnode/is-vnode":27,"../vnode/is-vtext":28,"../vnode/is-widget":29,"../vnode/vnode.js":31,"../vnode/vtext.js":33,"./hooks/ev-hook.js":20,"./hooks/soft-set-hook.js":21,"./parse-tag.js":23,"x-is-array":12}],23:[function(require,module,exports){
'use strict';
var split = require('browser-split');
var classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/;
var notClassId = /^\.|#/;
module.exports = parseTag;
function parseTag(tag, props) {
if (!tag) {
return 'DIV';
}
var noId = !(props.hasOwnProperty('id'));
var tagParts = split(tag, classIdSplit);
var tagName = null;
if (notClassId.test(tagParts[1])) {
tagName = 'DIV';
}
var classes, part, type, i;
for (i = 0; i < tagParts.length; i++) {
part = tagParts[i];
if (!part) {
continue;
}
type = part.charAt(0);
if (!tagName) {
tagName = part;
} else if (type === '.') {
classes = classes || [];
classes.push(part.substring(1, part.length));
} else if (type === '#' && noId) {
props.id = part.substring(1, part.length);
}
}
if (classes) {
if (props.className) {
classes.push(props.className);
}
props.className = classes.join(' ');
}
return props.namespace ? tagName : tagName.toUpperCase();
}
},{"browser-split":5}],24:[function(require,module,exports){
var isVNode = require("./is-vnode")
var isVText = require("./is-vtext")
var isWidget = require("./is-widget")
var isThunk = require("./is-thunk")
module.exports = handleThunk
function handleThunk(a, b) {
var renderedA = a
var renderedB = b
if (isThunk(b)) {
renderedB = renderThunk(b, a)
}
if (isThunk(a)) {
renderedA = renderThunk(a, null)
}
return {
a: renderedA,
b: renderedB
}
}
function renderThunk(thunk, previous) {
var renderedThunk = thunk.vnode
if (!renderedThunk) {
renderedThunk = thunk.vnode = thunk.render(previous)
}
if (!(isVNode(renderedThunk) ||
isVText(renderedThunk) ||
isWidget(renderedThunk))) {
throw new Error("thunk did not return a valid node");
}
return renderedThunk
}
},{"./is-thunk":25,"./is-vnode":27,"./is-vtext":28,"./is-widget":29}],25:[function(require,module,exports){
module.exports = isThunk
function isThunk(t) {
return t && t.type === "Thunk"
}
},{}],26:[function(require,module,exports){
module.exports = isHook
function isHook(hook) {
return hook &&
(typeof hook.hook === "function" && !hook.hasOwnProperty("hook") ||
typeof hook.unhook === "function" && !hook.hasOwnProperty("unhook"))
}
},{}],27:[function(require,module,exports){
var version = require("./version")
module.exports = isVirtualNode
function isVirtualNode(x) {
return x && x.type === "VirtualNode" && x.version === version
}
},{"./version":30}],28:[function(require,module,exports){
var version = require("./version")
module.exports = isVirtualText
function isVirtualText(x) {
return x && x.type === "VirtualText" && x.version === version
}
},{"./version":30}],29:[function(require,module,exports){
module.exports = isWidget
function isWidget(w) {
return w && w.type === "Widget"
}
},{}],30:[function(require,module,exports){
module.exports = "2"
},{}],31:[function(require,module,exports){
var version = require("./version")
var isVNode = require("./is-vnode")
var isWidget = require("./is-widget")
var isThunk = require("./is-thunk")
var isVHook = require("./is-vhook")
module.exports = VirtualNode
var noProperties = {}
var noChildren = []
function VirtualNode(tagName, properties, children, key, namespace) {
this.tagName = tagName
this.properties = properties || noProperties
this.children = children || noChildren
this.key = key != null ? String(key) : undefined
this.namespace = (typeof namespace === "string") ? namespace : null
var count = (children && children.length) || 0
var descendants = 0
var hasWidgets = false
var hasThunks = false
var descendantHooks = false
var hooks
for (var propName in properties) {
if (properties.hasOwnProperty(propName)) {
var property = properties[propName]
if (isVHook(property) && property.unhook) {
if (!hooks) {
hooks = {}
}
hooks[propName] = property
}
}
}
for (var i = 0; i < count; i++) {
var child = children[i]
if (isVNode(child)) {
descendants += child.count || 0
if (!hasWidgets && child.hasWidgets) {
hasWidgets = true
}
if (!hasThunks && child.hasThunks) {
hasThunks = true
}
if (!descendantHooks && (child.hooks || child.descendantHooks)) {
descendantHooks = true
}
} else if (!hasWidgets && isWidget(child)) {
if (typeof child.destroy === "function") {
hasWidgets = true
}
} else if (!hasThunks && isThunk(child)) {
hasThunks = true;
}
}
this.count = count + descendants
this.hasWidgets = hasWidgets
this.hasThunks = hasThunks
this.hooks = hooks
this.descendantHooks = descendantHooks
}
VirtualNode.prototype.version = version
VirtualNode.prototype.type = "VirtualNode"
},{"./is-thunk":25,"./is-vhook":26,"./is-vnode":27,"./is-widget":29,"./version":30}],32:[function(require,module,exports){
var version = require("./version")
VirtualPatch.NONE = 0
VirtualPatch.VTEXT = 1
VirtualPatch.VNODE = 2
VirtualPatch.WIDGET = 3
VirtualPatch.PROPS = 4
VirtualPatch.ORDER = 5
VirtualPatch.INSERT = 6
VirtualPatch.REMOVE = 7
VirtualPatch.THUNK = 8
module.exports = VirtualPatch
function VirtualPatch(type, vNode, patch) {
this.type = Number(type)
this.vNode = vNode
this.patch = patch
}
VirtualPatch.prototype.version = version
VirtualPatch.prototype.type = "VirtualPatch"
},{"./version":30}],33:[function(require,module,exports){
var version = require("./version")
module.exports = VirtualText
function VirtualText(text) {
this.text = String(text)
}
VirtualText.prototype.version = version
VirtualText.prototype.type = "VirtualText"
},{"./version":30}],34:[function(require,module,exports){
var isObject = require("is-object")
var isHook = require("../vnode/is-vhook")
module.exports = diffProps
function diffProps(a, b) {
var diff
for (var aKey in a) {
if (!(aKey in b)) {
diff = diff || {}
diff[aKey] = undefined
}
var aValue = a[aKey]
var bValue = b[aKey]
if (aValue === bValue) {
continue
} else if (isObject(aValue) && isObject(bValue)) {
if (getPrototype(bValue) !== getPrototype(aValue)) {
diff = diff || {}
diff[aKey] = bValue
} else if (isHook(bValue)) {
diff = diff || {}
diff[aKey] = bValue
} else {
var objectDiff = diffProps(aValue, bValue)
if (objectDiff) {
diff = diff || {}
diff[aKey] = objectDiff
}
}
} else {
diff = diff || {}
diff[aKey] = bValue
}
}
for (var bKey in b) {
if (!(bKey in a)) {
diff = diff || {}
diff[bKey] = b[bKey]
}
}
return diff
}
function getPrototype(value) {
if (Object.getPrototypeOf) {
return Object.getPrototypeOf(value)
} else if (value.__proto__) {
return value.__proto__
} else if (value.constructor) {
return value.constructor.prototype
}
}
},{"../vnode/is-vhook":26,"is-object":11}],35:[function(require,module,exports){
var isArray = require("x-is-array")
var VPatch = require("../vnode/vpatch")
var isVNode = require("../vnode/is-vnode")
var isVText = require("../vnode/is-vtext")
var isWidget = require("../vnode/is-widget")
var isThunk = require("../vnode/is-thunk")
var handleThunk = require("../vnode/handle-thunk")
var diffProps = require("./diff-props")
module.exports = diff
function diff(a, b) {
var patch = { a: a }
walk(a, b, patch, 0)
return patch
}
function walk(a, b, patch, index) {
if (a === b) {
return
}
var apply = patch[index]
var applyClear = false
if (isThunk(a) || isThunk(b)) {
thunks(a, b, patch, index)
} else if (b == null) {
// If a is a widget we will add a remove patch for it
// Otherwise any child widgets/hooks must be destroyed.
// This prevents adding two remove patches for a widget.
if (!isWidget(a)) {
clearState(a, patch, index)
apply = patch[index]
}
apply = appendPatch(apply, new VPatch(VPatch.REMOVE, a, b))
} else if (isVNode(b)) {
if (isVNode(a)) {
if (a.tagName === b.tagName &&
a.namespace === b.namespace &&
a.key === b.key) {
var propsPatch = diffProps(a.properties, b.properties)
if (propsPatch) {
apply = appendPatch(apply,
new VPatch(VPatch.PROPS, a, propsPatch))
}
apply = diffChildren(a, b, patch, apply, index)
} else {
apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b))
applyClear = true
}
} else {
apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b))
applyClear = true
}
} else if (isVText(b)) {
if (!isVText(a)) {
apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b))
applyClear = true
} else if (a.text !== b.text) {
apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b))
}
} else if (isWidget(b)) {
if (!isWidget(a)) {
applyClear = true
}
apply = appendPatch(apply, new VPatch(VPatch.WIDGET, a, b))
}
if (apply) {
patch[index] = apply
}
if (applyClear) {
clearState(a, patch, index)
}
}
function diffChildren(a, b, patch, apply, index) {
var aChildren = a.children
var orderedSet = reorder(aChildren, b.children)
var bChildren = orderedSet.children
var aLen = aChildren.length
var bLen = bChildren.length
var len = aLen > bLen ? aLen : bLen
for (var i = 0; i < len; i++) {
var leftNode = aChildren[i]
var rightNode = bChildren[i]
index += 1
if (!leftNode) {
if (rightNode) {
// Excess nodes in b need to be added
apply = appendPatch(apply,
new VPatch(VPatch.INSERT, null, rightNode))
}
} else {
walk(leftNode, rightNode, patch, index)
}
if (isVNode(leftNode) && leftNode.count) {
index += leftNode.count
}
}
if (orderedSet.moves) {
// Reorder nodes last
apply = appendPatch(apply, new VPatch(
VPatch.ORDER,
a,
orderedSet.moves
))
}
return apply
}
function clearState(vNode, patch, index) {
// TODO: Make this a single walk, not two
unhook(vNode, patch, index)
destroyWidgets(vNode, patch, index)
}
// Patch records for all destroyed widgets must be added because we need
// a DOM node reference for the destroy function
function destroyWidgets(vNode, patch, index) {
if (isWidget(vNode)) {
if (typeof vNode.destroy === "function") {
patch[index] = appendPatch(
patch[index],
new VPatch(VPatch.REMOVE, vNode, null)
)
}
} else if (isVNode(vNode) && (vNode.hasWidgets || vNode.hasThunks)) {
var children = vNode.children
var len = children.length
for (var i = 0; i < len; i++) {
var child = children[i]
index += 1
destroyWidgets(child, patch, index)
if (isVNode(child) && child.count) {
index += child.count
}
}
} else if (isThunk(vNode)) {
thunks(vNode, null, patch, index)
}
}
// Create a sub-patch for thunks
function thunks(a, b, patch, index) {
var nodes = handleThunk(a, b)
var thunkPatch = diff(nodes.a, nodes.b)
if (hasPatches(thunkPatch)) {
patch[index] = new VPatch(VPatch.THUNK, null, thunkPatch)
}
}
function hasPatches(patch) {
for (var index in patch) {
if (index !== "a") {
return true
}
}
return false
}
// Execute hooks when two nodes are identical
function unhook(vNode, patch, index) {
if (isVNode(vNode)) {
if (vNode.hooks) {
patch[index] = appendPatch(
patch[index],
new VPatch(
VPatch.PROPS,
vNode,
undefinedKeys(vNode.hooks)
)
)
}
if (vNode.descendantHooks || vNode.hasThunks) {
var children = vNode.children
var len = children.length
for (var i = 0; i < len; i++) {
var child = children[i]
index += 1
unhook(child, patch, index)
if (isVNode(child) && child.count) {
index += child.count
}
}
}
} else if (isThunk(vNode)) {
thunks(vNode, null, patch, index)
}
}
function undefinedKeys(obj) {
var result = {}
for (var key in obj) {
result[key] = undefined
}
return result
}
// List diff, naive left to right reordering
function reorder(aChildren, bChildren) {
// O(M) time, O(M) memory
var bChildIndex = keyIndex(bChildren)
var bKeys = bChildIndex.keys
var bFree = bChildIndex.free
if (bFree.length === bChildren.length) {
return {
children: bChildren,
moves: null
}
}
// O(N) time, O(N) memory
var aChildIndex = keyIndex(aChildren)
var aKeys = aChildIndex.keys
var aFree = aChildIndex.free
if (aFree.length === aChildren.length) {
return {
children: bChildren,
moves: null
}
}
// O(MAX(N, M)) memory
var newChildren = []
var freeIndex = 0
var freeCount = bFree.length
var deletedItems = 0
// Iterate through a and match a node in b
// O(N) time,
for (var i = 0 ; i < aChildren.length; i++) {
var aItem = aChildren[i]
var itemIndex
if (aItem.key) {
if (bKeys.hasOwnProperty(aItem.key)) {
// Match up the old keys
itemIndex = bKeys[aItem.key]
newChildren.push(bChildren[itemIndex])
} else {
// Remove old keyed items
itemIndex = i - deletedItems++
newChildren.push(null)
}
} else {
// Match the item in a with the next free item in b
if (freeIndex < freeCount) {
itemIndex = bFree[freeIndex++]
newChildren.push(bChildren[itemIndex])
} else {
// There are no free items in b to match with
// the free items in a, so the extra free nodes
// are deleted.
itemIndex = i - deletedItems++
newChildren.push(null)
}
}
}
var lastFreeIndex = freeIndex >= bFree.length ?
bChildren.length :
bFree[freeIndex]
// Iterate through b and append any new keys
// O(M) time
for (var j = 0; j < bChildren.length; j++) {
var newItem = bChildren[j]
if (newItem.key) {
if (!aKeys.hasOwnProperty(newItem.key)) {
// Add any new keyed items
// We are adding new items to the end and then sorting them
// in place. In future we should insert new items in place.
newChildren.push(newItem)
}
} else if (j >= lastFreeIndex) {
// Add any leftover non-keyed items
newChildren.push(newItem)
}
}
var simulate = newChildren.slice()
var simulateIndex = 0
var removes = []
var inserts = []
var simulateItem
for (var k = 0; k < bChildren.length;) {
var wantedItem = bChildren[k]
simulateItem = simulate[simulateIndex]
// remove items
while (simulateItem === null && simulate.length) {
removes.push(remove(simulate, simulateIndex, null))
simulateItem = simulate[simulateIndex]
}
if (!simulateItem || simulateItem.key !== wantedItem.key) {
// if we need a key in this position...
if (wantedItem.key) {
if (simulateItem && simulateItem.key) {
// if an insert doesn't put this key in place, it needs to move
if (bKeys[simulateItem.key] !== k + 1) {
removes.push(remove(simulate, simulateIndex, simulateItem.key))
simulateItem = simulate[simulateIndex]
// if the remove didn't put the wanted item in place, we need to insert it
if (!simulateItem || simulateItem.key !== wantedItem.key) {
inserts.push({key: wantedItem.key, to: k})
}
// items are matching, so skip ahead
else {
simulateIndex++
}
}
else {
inserts.push({key: wantedItem.key, to: k})
}
}
else {
inserts.push({key: wantedItem.key, to: k})
}
k++
}
// a key in simulate has no matching wanted key, remove it
else if (simulateItem && simulateItem.key) {
removes.push(remove(simulate, simulateIndex, simulateItem.key))
}
}
else {
simulateIndex++
k++
}
}
// remove all the remaining nodes from simulate
while(simulateIndex < simulate.length) {
simulateItem = simulate[simulateIndex]
removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))
}
// If the only moves we have are deletes then we can just
// let the delete patch remove these items.
if (removes.length === deletedItems && !inserts.length) {
return {
children: newChildren,
moves: null
}
}
return {
children: newChildren,
moves: {
removes: removes,
inserts: inserts
}
}
}
function remove(arr, index, key) {
arr.splice(index, 1)
return {
from: index,
key: key
}
}
function keyIndex(children) {
var keys = {}
var free = []
var length = children.length
for (var i = 0; i < length; i++) {
var child = children[i]
if (child.key) {
keys[child.key] = i
} else {
free.push(i)
}
}
return {
keys: keys, // A hash of key name to index
free: free // An array of unkeyed item indices
}
}
function appendPatch(apply, patch) {
if (apply) {
if (isArray(apply)) {
apply.push(patch)
} else {
apply = [apply, patch]
}
return apply
} else {
return patch
}
}
},{"../vnode/handle-thunk":24,"../vnode/is-thunk":25,"../vnode/is-vnode":27,"../vnode/is-vtext":28,"../vnode/is-widget":29,"../vnode/vpatch":32,"./diff-props":34,"x-is-array":12}]},{},[4])(4)
});
Dom.cache = new haxe_ds_StringMap();
Dom.counter = 0;
Dom.hasScope = (function($this) {
var $r;
try {
$r = (function($this) {
var $r;
window.document.body.querySelectorAll(":scope>*");
$r = true;
return $r;
}($this));
} catch( e ) {
$r = false;
}
return $r;
}(this));
Xml.Element = 0;
Xml.PCData = 1;
Xml.CData = 2;
Xml.Comment = 3;
Xml.DocType = 4;
Xml.ProcessingInstruction = 5;
Xml.Document = 6;
coconut_ui_tools_ViewCache.stack = [];
epaper_debug_DebugUi.initialized = false;
epaper_i18n_Localizable.currentLocale = haxe_ds_Option.None;
tink_geom2__$FitRect_FitRect_$Impl_$.ALL = ["above","below","lefthand","righthand"];
epaper_media_MediaBubble.centered = tink_geom2__$FitRect_FitRect_$Impl_$.allSides(["above","below"]);
epaper_media_MediaBubble.sideways = tink_geom2__$FitRect_FitRect_$Impl_$.compound([tink_geom2__$FitRect_FitRect_$Impl_$.ofConstraint({ side : "lefthand", align : .0}),tink_geom2__$FitRect_FitRect_$Impl_$.ofConstraint({ side : "righthand", align : .0})]);
epaper_media_MediaController.MAIN_CONTROLS_HEIGHT = 70;
epaper_media_MediaController.BAR_TOP_OFFSET = 20;
epaper_media_MediaController.BAR_BOTTOM_OFFSET = epaper_media_MediaController.BAR_TOP_OFFSET + 20;
epaper_tracking_EpaperTracker.previousPage = -9999;
epaper_tracking_EpaperTracker.previousSelector = "none";
epaper_tracking_EpaperTracker.previousHash = "none";
flipbook_BookView.OS = (function($this) {
var $r;
var platforms = "win,ipad,iphone,ipod,mac,android,linux".split(",");
var platform = platforms.pop();
var found = window.navigator.userAgent.toLowerCase();
{
var _g = 0;
while(_g < platforms.length) {
var p = platforms[_g];
++_g;
if(found.indexOf(p) != -1) {
platform = p;
break;
}
}
}
$r = platform;
return $r;
}(this));
flipbook_Pagination.isMac = StringTools.startsWith(window.navigator.platform,"Mac");
flipbook_Pagination.never = (function($this) {
var $r;
var this1 = new tink_core__$Future_SimpleFuture(function(_) {
return null;
});
$r = this1;
return $r;
}(this));
flipbook_Zoom.DEVICE_PIXEL_RATIO = window.devicePixelRatio > 0 ? window.devicePixelRatio : 1.0;
haxe_ds_ObjectMap.count = 0;
haxe_xml_Parser.escapes = (function($this) {
var $r;
var h = new haxe_ds_StringMap();
if(__map_reserved["lt"] != null) {
h.setReserved("lt","<");
} else {
h.h["lt"] = "<";
}
if(__map_reserved["gt"] != null) {
h.setReserved("gt",">");
} else {
h.h["gt"] = ">";
}
if(__map_reserved["amp"] != null) {
h.setReserved("amp","&");
} else {
h.h["amp"] = "&";
}
if(__map_reserved["quot"] != null) {
h.setReserved("quot","\"");
} else {
h.h["quot"] = "\"";
}
if(__map_reserved["apos"] != null) {
h.setReserved("apos","'");
} else {
h.h["apos"] = "'";
}
$r = h;
return $r;
}(this));
js_Boot.__toStr = ({ }).toString;
tink_core__$Callback_Callback_$Impl_$.depth = 0;
tink_geom2__$Matrix_Matrix_$Impl_$.IDENTITY = (function($this) {
var $r;
var this1 = { a : 1, b : 0, c : 0, d : 1, tx : 0, ty : 0};
$r = this1;
return $r;
}(this));
tink_pure__$List_Node.EMPTY = [];
tink_state__$Observable_Observable_$Impl_$.stack = new List();
tink_state__$Observable_Observable_$Impl_$.scheduled = [];
tink_state__$Observable_Observable_$Impl_$.hasRAF = typeof window != 'undefined' && 'requestAnimationFrame' in window;
tink_state__$Observable_Observable_$Impl_$.isScheduled = false;
tink_state_ConstObservable.NEVER = (function($this) {
var $r;
var this1 = new tink_core__$Future_SimpleFuture(function(_) {
return null;
});
$r = this1;
return $r;
}(this));
tink_xml_Parser_$1.inst = new tink_xml_Parser_$1();
tink_xml_Parser_$2.inst = new tink_xml_Parser_$2();
tink_xml_Parser_$3.inst = new tink_xml_Parser_$3();
tink_xml_Parser_$4.inst = new tink_xml_Parser_$4();
util_touch_TouchHandler.isAnroid = (function($this) {
var $r;
try {
$r = (function($this) {
var $r;
window.document.body.click();
$r = false;
return $r;
}($this));
} catch( e ) {
$r = true;
}
return $r;
}(this));
util_touch_TouchHandler.isFakeClick = false;
vdom__$Attr_Key_$Impl_$.keygen = 0;
vdom__$Style_Style_$Impl_$.style = window.document.createElement("div").style;
epaper_viewer_Boot.main();
})(typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);