function ArcTileImageryProvider(t) {
if (!Cesium.defined(t)) throw new DeveloperError("options is required.");
if (!Cesium.defined(t.url)) throw new DeveloperError("options.url is required.");
if (this._url = t.url + "/_alllayers/", this._isUpper = Cesium.defaultValue(t.isUpper, !0), this._imgType = Cesium.defaultValue(t.imgType, ".jpg"), this._subdomains = t.subdomains, Cesium.isArray(this._subdomains) ? this._subdomains = this._subdomains.slice() : Cesium.defined(this._subdomains) && this._subdomains.length > 0 ? this._subdomains = this._subdomains.split("") : this._subdomains = ["a", "b", "c"], this._tileWidth = Cesium.defaultValue(t.tileWidth, 256), this._tileHeight = Cesium.defaultValue(t.tileHeight, 256), this._minimumLevel = Cesium.defaultValue(t.minimumLevel, 0), this._maximumLevel = t.maximumLevel, t.rectangle && t.rectangle.xmin && t.rectangle.xmax && t.rectangle.ymin && t.rectangle.ymax) {
var e = t.rectangle.xmin,
i = t.rectangle.xmax,
n = t.rectangle.ymin,
r = t.rectangle.ymax;
t.rectangle = Cesium.Rectangle.fromDegrees(e, n, i, r)
}
this._tilingScheme = Cesium.defaultValue(t.tilingScheme, new Cesium.WebMercatorTilingScheme({
ellipsoid: t.ellipsoid
})), this._rectangle = Cesium.defaultValue(t.rectangle, this._tilingScheme.rectangle), this._rectangle = Cesium.Rectangle.intersection(this._rectangle, this._tilingScheme.rectangle), this._hasAlphaChannel = Cesium.defaultValue(t.hasAlphaChannel, !0), this._credit = void 0, this._ready = !0
}!
function(t, e) {
"use strict";
"function" == typeof define && define.amd && define([], e)
}("undefined" != typeof window ? window : "undefined" != typeof self ? self : this, function() {
var t, e, i;
return function(n) {
function r(t, e) {
return b.call(t, e)
}
function o(t, e) {
var i, n, r, o, a, s, l, u, c, h, d, p, f = e && e.split("/"),
m = _.map,
g = m && m["*"] || {};
if (t) {
for (t = t.split("/"), a = t.length - 1, _.nodeIdCompat && C.test(t[a]) && (t[a] = t[a].replace(C, "")), "." === t[0].charAt(0) && f && (p = f.slice(0, f.length - 1), t = p.concat(t)), c = 0; c < t.length; c++) if (d = t[c], "." === d) t.splice(c, 1), c -= 1;
else if (".." === d) {
if (0 === c || 1 === c && ".." === t[2] || ".." === t[c - 1]) continue;
c > 0 && (t.splice(c - 1, 2), c -= 2)
}
t = t.join("/")
}
if ((f || g) && m) {
for (i = t.split("/"), c = i.length; c > 0; c -= 1) {
if (n = i.slice(0, c).join("/"), f) for (h = f.length; h > 0; h -= 1) if (r = m[f.slice(0, h).join("/")], r && (r = r[n])) {
o = r, s = c;
break
}
if (o) break;
!l && g && g[n] && (l = g[n], u = c)
}!o && l && (o = l, s = u), o && (i.splice(0, s, o), t = i.join("/"))
}
return t
}
function a(t, e) {
return function() {
var i = w.call(arguments, 0);
return "string" != typeof i[0] && 1 === i.length && i.push(null), p.apply(n, i.concat([t, e]))
}
}
function s(t) {
return function(e) {
return o(e, t)
}
}
function l(t) {
return function(e) {
g[t] = e
}
}
function u(t) {
if (r(v, t)) {
var e = v[t];
delete v[t], y[t] = !0, d.apply(n, e)
}
if (!r(g, t) && !r(y, t)) throw new Error("No " + t);
return g[t]
}
function c(t) {
var e, i = t ? t.indexOf("!") : -1;
return i > -1 && (e = t.substring(0, i), t = t.substring(i + 1, t.length)), [e, t]
}
function h(t) {
return function() {
return _ && _.config && _.config[t] || {}
}
}
var d, p, f, m, g = {},
v = {},
_ = {},
y = {},
b = Object.prototype.hasOwnProperty,
w = [].slice,
C = /\.js$/;
f = function(t, e) {
var i, n = c(t),
r = n[0];
return t = n[1], r && (r = o(r, e), i = u(r)), r ? t = i && i.normalize ? i.normalize(t, s(e)) : o(t, e) : (t = o(t, e), n = c(t), r = n[0], t = n[1], r && (i = u(r))), {
f: r ? r + "!" + t : t,
n: t,
pr: r,
p: i
}
}, m = {
require: function(t) {
return a(t)
},
exports: function(t) {
var e = g[t];
return "undefined" != typeof e ? e : g[t] = {}
},
module: function(t) {
return {
id: t,
uri: "",
exports: g[t],
config: h(t)
}
}
}, d = function(t, e, i, o) {
var s, c, h, d, p, _, b = [],
w = typeof i;
if (o = o || t, "undefined" === w || "function" === w) {
for (e = !e.length && i.length ? ["require", "exports", "module"] : e, p = 0; p < e.length; p += 1) if (d = f(e[p], o), c = d.f, "require" === c) b[p] = m.require(t);
else if ("exports" === c) b[p] = m.exports(t), _ = !0;
else if ("module" === c) s = b[p] = m.module(t);
else if (r(g, c) || r(v, c) || r(y, c)) b[p] = u(c);
else {
if (!d.p) throw new Error(t + " missing " + c);
d.p.load(d.n, a(o, !0), l(c), {}), b[p] = g[c]
}
h = i ? i.apply(g[t], b) : void 0, t && (s && s.exports !== n && s.exports !== g[t] ? g[t] = s.exports : h === n && _ || (g[t] = h))
} else t && (g[t] = i)
}, t = e = p = function(t, e, i, r, o) {
if ("string" == typeof t) return m[t] ? m[t](e) : u(f(t, e).f);
if (!t.splice) {
if (_ = t, _.deps && p(_.deps, _.callback), !e) return;
e.splice ? (t = e, e = i, i = null) : t = n
}
return e = e ||
function() {}, "function" == typeof i && (i = r, r = o), r ? d(n, t, e, i) : setTimeout(function() {
d(n, t, e, i)
}, 4), p
}, p.config = function(t) {
return p(t)
}, t._defined = g, i = function(t, e, i) {
if ("string" != typeof t) throw new Error("See almond README: incorrect module build, no module name");
e.splice || (i = e, e = []), r(g, t) || r(v, t) || (v[t] = [t, e, i])
}, i.amd = {
jQuery: !0
}
}(), i("almond", function() {}), function() {
!
function(t) {
var e = this || (0, eval)("this"),
n = e.document,
r = e.navigator,
o = e.jQuery,
a = e.JSON;
!
function(t) {
"function" == typeof i && i.amd ? i("knockout", ["exports", "require"], t) : t("object" == typeof exports && "object" == typeof module ? module.exports || exports : e.ko = {})
}(function(i, s) {
function l(t, e) {
return (null === t || typeof t in g) && t === e
}
function u(e, i) {
var n;
return function() {
n || (n = m.a.setTimeout(function() {
n = t, e()
}, i))
}
}
function c(t, e) {
var i;
return function() {
clearTimeout(i), i = m.a.setTimeout(t, e)
}
}
function h(t, e) {
e && e !== v ? "beforeChange" === e ? this.Kb(t) : this.Ha(t, e) : this.Lb(t)
}
function d(t, e) {
null !== e && e.k && e.k()
}
function p(t, e) {
var i = this.Hc,
n = i[C];
n.R || (this.lb && this.Ma[e] ? (i.Pb(e, t, this.Ma[e]), this.Ma[e] = null, --this.lb) : n.r[e] || i.Pb(e, t, n.s ? {
ia: t
} : i.uc(t)))
}
function f(t, e, i, n) {
m.d[t] = {
init: function(t, r, o, a, s) {
var l, u;
return m.m(function() {
var o = m.a.c(r()),
a = !i != !o,
c = !u;
(c || e || a !== l) && (c && m.va.Aa() && (u = m.a.ua(m.f.childNodes(t), !0)), a ? (c || m.f.da(t, m.a.ua(u)), m.eb(n ? n(s, o) : s, t)) : m.f.xa(t), l = a)
}, null, {
i: t
}), {
controlsDescendantBindings: !0
}
}
}, m.h.ta[t] = !1, m.f.Z[t] = !0
}
var m = "undefined" != typeof i ? i : {};
m.b = function(t, e) {
for (var i = t.split("."), n = m, r = 0; r < i.length - 1; r++) n = n[i[r]];
n[i[i.length - 1]] = e
}, m.G = function(t, e, i) {
t[e] = i
}, m.version = "3.4.0", m.b("version", m.version), m.options = {
deferUpdates: !1,
useOnlyNativeEvents: !1
}, m.a = function() {
function i(t, e) {
for (var i in t) t.hasOwnProperty(i) && e(i, t[i])
}
function s(t, e) {
if (e) for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
return t
}
function l(t, e) {
return t.__proto__ = e, t
}
function u(t, e, i, n) {
var r = t[e].match(v) || [];
m.a.q(i.match(v), function(t) {
m.a.pa(r, t, n)
}), t[e] = r.join(" ")
}
var c = {
__proto__: []
}
instanceof Array, h = "function" == typeof Symbol, d = {}, p = {};
d[r && /Firefox\/2/i.test(r.userAgent) ? "KeyboardEvent" : "UIEvents"] = ["keyup", "keydown", "keypress"], d.MouseEvents = "click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "), i(d, function(t, e) {
if (e.length) for (var i = 0, n = e.length; i < n; i++) p[e[i]] = t
});
var f = {
propertychange: !0
},
g = n &&
function() {
for (var e = 3, i = n.createElement("div"), r = i.getElementsByTagName("i"); i.innerHTML = "", r[0];);
return 4 < e ? e : t
}(), v = /\S+/g;
return {
cc: ["authenticity_token", /^__RequestVerificationToken(_.*)?$/],
q: function(t, e) {
for (var i = 0, n = t.length; i < n; i++) e(t[i], i)
},
o: function(t, e) {
if ("function" == typeof Array.prototype.indexOf) return Array.prototype.indexOf.call(t, e);
for (var i = 0, n = t.length; i < n; i++) if (t[i] === e) return i;
return -1
},
Sb: function(t, e, i) {
for (var n = 0, r = t.length; n < r; n++) if (e.call(i, t[n], n)) return t[n];
return null
},
La: function(t, e) {
var i = m.a.o(t, e);
0 < i ? t.splice(i, 1) : 0 === i && t.shift()
},
Tb: function(t) {
t = t || [];
for (var e = [], i = 0, n = t.length; i < n; i++) 0 > m.a.o(e, t[i]) && e.push(t[i]);
return e
},
fb: function(t, e) {
t = t || [];
for (var i = [], n = 0, r = t.length; n < r; n++) i.push(e(t[n], n));
return i
},
Ka: function(t, e) {
t = t || [];
for (var i = [], n = 0, r = t.length; n < r; n++) e(t[n], n) && i.push(t[n]);
return i
},
ra: function(t, e) {
if (e instanceof Array) t.push.apply(t, e);
else for (var i = 0, n = e.length; i < n; i++) t.push(e[i]);
return t
},
pa: function(t, e, i) {
var n = m.a.o(m.a.zb(t), e);
0 > n ? i && t.push(e) : i || t.splice(n, 1)
},
ka: c,
extend: s,
Xa: l,
Ya: c ? l : s,
D: i,
Ca: function(t, e) {
if (!t) return t;
var i, n = {};
for (i in t) t.hasOwnProperty(i) && (n[i] = e(t[i], i, t));
return n
},
ob: function(t) {
for (; t.firstChild;) m.removeNode(t.firstChild)
},
jc: function(t) {
t = m.a.V(t);
for (var e = (t[0] && t[0].ownerDocument || n).createElement("div"), i = 0, r = t.length; i < r; i++) e.appendChild(m.$(t[i]));
return e
},
ua: function(t, e) {
for (var i = 0, n = t.length, r = []; i < n; i++) {
var o = t[i].cloneNode(!0);
r.push(e ? m.$(o) : o)
}
return r
},
da: function(t, e) {
if (m.a.ob(t), e) for (var i = 0, n = e.length; i < n; i++) t.appendChild(e[i])
},
qc: function(t, e) {
var i = t.nodeType ? [t] : t;
if (0 < i.length) {
for (var n = i[0], r = n.parentNode, o = 0, a = e.length; o < a; o++) r.insertBefore(e[o], n);
for (o = 0, a = i.length; o < a; o++) m.removeNode(i[o])
}
},
za: function(t, e) {
if (t.length) {
for (e = 8 === e.nodeType && e.parentNode || e; t.length && t[0].parentNode !== e;) t.splice(0, 1);
for (; 1 < t.length && t[t.length - 1].parentNode !== e;) t.length--;
if (1 < t.length) {
var i = t[0],
n = t[t.length - 1];
for (t.length = 0; i !== n;) t.push(i), i = i.nextSibling;
t.push(n)
}
}
return t
},
sc: function(t, e) {
7 > g ? t.setAttribute("selected", e) : t.selected = e
},
$a: function(e) {
return null === e || e === t ? "" : e.trim ? e.trim() : e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, "")
},
nd: function(t, e) {
return t = t || "", !(e.length > t.length) && t.substring(0, e.length) === e
},
Mc: function(t, e) {
if (t === e) return !0;
if (11 === t.nodeType) return !1;
if (e.contains) return e.contains(3 === t.nodeType ? t.parentNode : t);
if (e.compareDocumentPosition) return 16 == (16 & e.compareDocumentPosition(t));
for (; t && t != e;) t = t.parentNode;
return !!t
},
nb: function(t) {
return m.a.Mc(t, t.ownerDocument.documentElement)
},
Qb: function(t) {
return !!m.a.Sb(t, m.a.nb)
},
A: function(t) {
return t && t.tagName && t.tagName.toLowerCase()
},
Wb: function(t) {
return m.onError ?
function() {
try {
return t.apply(this, arguments)
} catch (e) {
throw m.onError && m.onError(e), e
}
} : t
},
setTimeout: function(t, e) {
return setTimeout(m.a.Wb(t), e)
},
$b: function(t) {
setTimeout(function() {
throw m.onError && m.onError(t), t
}, 0)
},
p: function(t, e, i) {
var n = m.a.Wb(i);
if (i = g && f[e], m.options.useOnlyNativeEvents || i || !o) if (i || "function" != typeof t.addEventListener) {
if ("undefined" == typeof t.attachEvent) throw Error("Browser doesn't support addEventListener or attachEvent");
var r = function(e) {
n.call(t, e)
},
a = "on" + e;
t.attachEvent(a, r), m.a.F.oa(t, function() {
t.detachEvent(a, r)
})
} else t.addEventListener(e, n, !1);
else o(t).bind(e, n)
},
Da: function(t, i) {
if (!t || !t.nodeType) throw Error("element must be a DOM node when calling triggerEvent");
var r;
if ("input" === m.a.A(t) && t.type && "click" == i.toLowerCase() ? (r = t.type, r = "checkbox" == r || "radio" == r) : r = !1, m.options.useOnlyNativeEvents || !o || r) if ("function" == typeof n.createEvent) {
if ("function" != typeof t.dispatchEvent) throw Error("The supplied element doesn't support dispatchEvent");
r = n.createEvent(p[i] || "HTMLEvents"), r.initEvent(i, !0, !0, e, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, t), t.dispatchEvent(r)
} else if (r && t.click) t.click();
else {
if ("undefined" == typeof t.fireEvent) throw Error("Browser doesn't support triggering events");
t.fireEvent("on" + i)
} else o(t).trigger(i)
},
c: function(t) {
return m.H(t) ? t() : t
},
zb: function(t) {
return m.H(t) ? t.t() : t
},
bb: function(t, e, i) {
var n;
e && ("object" == typeof t.classList ? (n = t.classList[i ? "add" : "remove"], m.a.q(e.match(v), function(e) {
n.call(t.classList, e)
})) : "string" == typeof t.className.baseVal ? u(t.className, "baseVal", e, i) : u(t, "className", e, i))
},
Za: function(e, i) {
var n = m.a.c(i);
null !== n && n !== t || (n = "");
var r = m.f.firstChild(e);
!r || 3 != r.nodeType || m.f.nextSibling(r) ? m.f.da(e, [e.ownerDocument.createTextNode(n)]) : r.data = n, m.a.Rc(e)
},
rc: function(t, e) {
if (t.name = e, 7 >= g) try {
t.mergeAttributes(n.createElement(""), !1)
} catch (i) {}
},
Rc: function(t) {
9 <= g && (t = 1 == t.nodeType ? t : t.parentNode, t.style && (t.style.zoom = t.style.zoom))
},
Nc: function(t) {
if (g) {
var e = t.style.width;
t.style.width = 0, t.style.width = e
}
},
hd: function(t, e) {
t = m.a.c(t), e = m.a.c(e);
for (var i = [], n = t; n <= e; n++) i.push(n);
return i
},
V: function(t) {
for (var e = [], i = 0, n = t.length; i < n; i++) e.push(t[i]);
return e
},
Yb: function(t) {
return h ? Symbol(t) : t
},
rd: 6 === g,
sd: 7 === g,
C: g,
ec: function(t, e) {
for (var i = m.a.V(t.getElementsByTagName("input")).concat(m.a.V(t.getElementsByTagName("textarea"))), n = "string" == typeof e ?
function(t) {
return t.name === e
} : function(t) {
return e.test(t.name)
}, r = [], o = i.length - 1; 0 <= o; o--) n(i[o]) && r.push(i[o]);
return r
},
ed: function(t) {
return "string" == typeof t && (t = m.a.$a(t)) ? a && a.parse ? a.parse(t) : new Function("return " + t)() : null
},
Eb: function(t, e, i) {
if (!a || !a.stringify) throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
return a.stringify(m.a.c(t), e, i)
},
fd: function(t, e, r) {
r = r || {};
var o = r.params || {},
a = r.includeFields || this.cc,
s = t;
if ("object" == typeof t && "form" === m.a.A(t)) for (var s = t.action, l = a.length - 1; 0 <= l; l--) for (var u = m.a.ec(t, a[l]), c = u.length - 1; 0 <= c; c--) o[u[c].name] = u[c].value;
e = m.a.c(e);
var h = n.createElement("form");
h.style.display = "none", h.action = s, h.method = "post";
for (var d in e) t = n.createElement("input"), t.type = "hidden", t.name = d, t.value = m.a.Eb(m.a.c(e[d])), h.appendChild(t);
i(o, function(t, e) {
var i = n.createElement("input");
i.type = "hidden", i.name = t, i.value = e, h.appendChild(i)
}), n.body.appendChild(h), r.submitter ? r.submitter(h) : h.submit(), setTimeout(function() {
h.parentNode.removeChild(h)
}, 0)
}
}
}(), m.b("utils", m.a), m.b("utils.arrayForEach", m.a.q), m.b("utils.arrayFirst", m.a.Sb), m.b("utils.arrayFilter", m.a.Ka), m.b("utils.arrayGetDistinctValues", m.a.Tb), m.b("utils.arrayIndexOf", m.a.o), m.b("utils.arrayMap", m.a.fb), m.b("utils.arrayPushAll", m.a.ra), m.b("utils.arrayRemoveItem", m.a.La), m.b("utils.extend", m.a.extend), m.b("utils.fieldsIncludedWithJsonPost", m.a.cc), m.b("utils.getFormFields", m.a.ec), m.b("utils.peekObservable", m.a.zb), m.b("utils.postJson", m.a.fd), m.b("utils.parseJson", m.a.ed), m.b("utils.registerEventHandler", m.a.p), m.b("utils.stringifyJson", m.a.Eb), m.b("utils.range", m.a.hd), m.b("utils.toggleDomNodeCssClass", m.a.bb), m.b("utils.triggerEvent", m.a.Da), m.b("utils.unwrapObservable", m.a.c), m.b("utils.objectForEach", m.a.D), m.b("utils.addOrRemoveItem", m.a.pa), m.b("utils.setTextContent", m.a.Za), m.b("unwrap", m.a.c), Function.prototype.bind || (Function.prototype.bind = function(t) {
var e = this;
if (1 === arguments.length) return function() {
return e.apply(t, arguments)
};
var i = Array.prototype.slice.call(arguments, 1);
return function() {
var n = i.slice(0);
return n.push.apply(n, arguments), e.apply(t, n)
}
}), m.a.e = new function() {
function e(e, o) {
var a = e[n];
if (!a || "null" === a || !r[a]) {
if (!o) return t;
a = e[n] = "ko" + i++, r[a] = {}
}
return r[a]
}
var i = 0,
n = "__ko__" + (new Date).getTime(),
r = {};
return {
get: function(i, n) {
var r = e(i, !1);
return r === t ? t : r[n]
},
set: function(i, n, r) {
r === t && e(i, !1) === t || (e(i, !0)[n] = r)
},
clear: function(t) {
var e = t[n];
return !!e && (delete r[e], t[n] = null, !0)
},
I: function() {
return i+++n
}
}
}, m.b("utils.domData", m.a.e), m.b("utils.domData.clear", m.a.e.clear), m.a.F = new function() {
function e(e, i) {
var r = m.a.e.get(e, n);
return r === t && i && (r = [], m.a.e.set(e, n, r)), r
}
function i(t) {
var n = e(t, !1);
if (n) for (var n = n.slice(0), r = 0; r < n.length; r++) n[r](t);
if (m.a.e.clear(t), m.a.F.cleanExternalData(t), a[t.nodeType]) for (n = t.firstChild; t = n;) n = t.nextSibling, 8 === t.nodeType && i(t)
}
var n = m.a.e.I(),
r = {
1: !0,
8: !0,
9: !0
},
a = {
1: !0,
9: !0
};
return {
oa: function(t, i) {
if ("function" != typeof i) throw Error("Callback must be a function");
e(t, !0).push(i)
},
pc: function(i, r) {
var o = e(i, !1);
o && (m.a.La(o, r), 0 == o.length && m.a.e.set(i, n, t))
},
$: function(t) {
if (r[t.nodeType] && (i(t), a[t.nodeType])) {
var e = [];
m.a.ra(e, t.getElementsByTagName("*"));
for (var n = 0, o = e.length; n < o; n++) i(e[n])
}
return t
},
removeNode: function(t) {
m.$(t), t.parentNode && t.parentNode.removeChild(t)
},
cleanExternalData: function(t) {
o && "function" == typeof o.cleanData && o.cleanData([t])
}
}
}, m.$ = m.a.F.$, m.removeNode = m.a.F.removeNode, m.b("cleanNode", m.$), m.b("removeNode", m.removeNode), m.b("utils.domNodeDisposal", m.a.F), m.b("utils.domNodeDisposal.addDisposeCallback", m.a.F.oa), m.b("utils.domNodeDisposal.removeDisposeCallback", m.a.F.pc), function() {
var i = [0, "", ""],
r = [1, "
", "
"],
a = [3, "
", "
"],
s = [1, ""],
l = {
thead: r,
tbody: r,
tfoot: r,
tr: [2, "
", "
"],
td: a,
th: a,
option: s,
optgroup: s
},
u = 8 >= m.a.C;
m.a.ma = function(t, r) {
var a;
if (o) {
if (o.parseHTML) a = o.parseHTML(t, r) || [];
else if ((a = o.clean([t], r)) && a[0]) {
for (var s = a[0]; s.parentNode && 11 !== s.parentNode.nodeType;) s = s.parentNode;
s.parentNode && s.parentNode.removeChild(s)
}
} else {
(a = r) || (a = n);
var c, s = a.parentWindow || a.defaultView || e,
h = m.a.$a(t).toLowerCase(),
d = a.createElement("div");
for (c = (h = h.match(/^<([a-z]+)[ >]/)) && l[h[1]] || i, h = c[0], c = "ignored
" + c[1] + t + c[2] + "
", "function" == typeof s.innerShiv ? d.appendChild(s.innerShiv(c)) : (u && a.appendChild(d), d.innerHTML = c, u && d.parentNode.removeChild(d)); h--;) d = d.lastChild;
a = m.a.V(d.lastChild.childNodes)
}
return a
}, m.a.Cb = function(e, i) {
if (m.a.ob(e), i = m.a.c(i), null !== i && i !== t) if ("string" != typeof i && (i = i.toString()), o) o(e).html(i);
else for (var n = m.a.ma(i, e.ownerDocument), r = 0; r < n.length; r++) e.appendChild(n[r])
}
}(), m.b("utils.parseHtmlFragment", m.a.ma), m.b("utils.setHtml", m.a.Cb), m.M = function() {
function e(t, i) {
if (t) if (8 == t.nodeType) {
var n = m.M.lc(t.nodeValue);
null != n && i.push({
Lc: t,
cd: n
})
} else if (1 == t.nodeType) for (var n = 0, r = t.childNodes, o = r.length; n < o; n++) e(r[n], i)
}
var i = {};
return {
wb: function(t) {
if ("function" != typeof t) throw Error("You can only pass a function to ko.memoization.memoize()");
var e = (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1) + (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1);
return i[e] = t, ""
},
xc: function(e, n) {
var r = i[e];
if (r === t) throw Error("Couldn't find any memo with ID " + e + ". Perhaps it's already been unmemoized.");
try {
return r.apply(null, n || []), !0
} finally {
delete i[e]
}
},
yc: function(t, i) {
var n = [];
e(t, n);
for (var r = 0, o = n.length; r < o; r++) {
var a = n[r].Lc,
s = [a];
i && m.a.ra(s, i), m.M.xc(n[r].cd, s), a.nodeValue = "", a.parentNode && a.parentNode.removeChild(a)
}
},
lc: function(t) {
return (t = t.match(/^\[ko_memo\:(.*?)\]$/)) ? t[1] : null
}
}
}(), m.b("memoization", m.M), m.b("memoization.memoize", m.M.wb), m.b("memoization.unmemoize", m.M.xc), m.b("memoization.parseMemoText", m.M.lc), m.b("memoization.unmemoizeDomNodeAndDescendants", m.M.yc), m.Y = function() {
function t() {
if (o) for (var t, e = o, i = 0; s < o;) if (t = r[s++]) {
if (s > e) {
if (5e3 <= ++i) {
s = o, m.a.$b(Error("'Too much recursion' after processing " + i + " task groups."));
break
}
e = o
}
try {
t()
} catch (n) {
m.a.$b(n)
}
}
}
function i() {
t(), s = o = r.length = 0
}
var r = [],
o = 0,
a = 1,
s = 0;
return {
scheduler: e.MutationObserver ?
function(t) {
var e = n.createElement("div");
return new MutationObserver(t).observe(e, {
attributes: !0
}), function() {
e.classList.toggle("foo")
}
}(i) : n && "onreadystatechange" in n.createElement("script") ?
function(t) {
var e = n.createElement("script");
e.onreadystatechange = function() {
e.onreadystatechange = null, n.documentElement.removeChild(e), e = null, t()
}, n.documentElement.appendChild(e)
} : function(t) {
setTimeout(t, 0)
},
Wa: function(t) {
return o || m.Y.scheduler(i), r[o++] = t, a++
},
cancel: function(t) {
t -= a - o, t >= s && t < o && (r[t] = null)
},
resetForTesting: function() {
var t = o - s;
return s = o = r.length = 0, t
},
md: t
}
}(), m.b("tasks", m.Y), m.b("tasks.schedule", m.Y.Wa), m.b("tasks.runEarly", m.Y.md), m.ya = {
throttle: function(t, e) {
t.throttleEvaluation = e;
var i = null;
return m.B({
read: t,
write: function(n) {
clearTimeout(i), i = m.a.setTimeout(function() {
t(n)
}, e)
}
})
},
rateLimit: function(t, e) {
var i, n, r;
"number" == typeof e ? i = e : (i = e.timeout, n = e.method), t.cb = !1, r = "notifyWhenChangesStop" == n ? c : u, t.Ta(function(t) {
return r(t, i)
})
},
deferred: function(e, i) {
if (!0 !== i) throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");
e.cb || (e.cb = !0, e.Ta(function(i) {
var n;
return function() {
m.Y.cancel(n), n = m.Y.Wa(i), e.notifySubscribers(t, "dirty")
}
}))
},
notify: function(t, e) {
t.equalityComparer = "always" == e ? null : l
}
};
var g = {
undefined: 1,
"boolean": 1,
number: 1,
string: 1
};
m.b("extenders", m.ya), m.vc = function(t, e, i) {
this.ia = t, this.gb = e, this.Kc = i, this.R = !1, m.G(this, "dispose", this.k)
}, m.vc.prototype.k = function() {
this.R = !0, this.Kc()
}, m.J = function() {
m.a.Ya(this, _), _.rb(this)
};
var v = "change",
_ = {
rb: function(t) {
t.K = {}, t.Nb = 1
},
X: function(t, e, i) {
var n = this;
i = i || v;
var r = new m.vc(n, e ? t.bind(e) : t, function() {
m.a.La(n.K[i], r), n.Ia && n.Ia(i)
});
return n.sa && n.sa(i), n.K[i] || (n.K[i] = []), n.K[i].push(r), r
},
notifySubscribers: function(t, e) {
if (e = e || v, e === v && this.zc(), this.Pa(e)) try {
m.l.Ub();
for (var i, n = this.K[e].slice(0), r = 0; i = n[r]; ++r) i.R || i.gb(t)
} finally {
m.l.end()
}
},
Na: function() {
return this.Nb
},
Uc: function(t) {
return this.Na() !== t
},
zc: function() {
++this.Nb
},
Ta: function(t) {
var e, i, n, r = this,
o = m.H(r);
r.Ha || (r.Ha = r.notifySubscribers, r.notifySubscribers = h);
var a = t(function() {
r.Mb = !1, o && n === r && (n = r()), e = !1, r.tb(i, n) && r.Ha(i = n)
});
r.Lb = function(t) {
r.Mb = e = !0, n = t, a()
}, r.Kb = function(t) {
e || (i = t, r.Ha(t, "beforeChange"))
}
},
Pa: function(t) {
return this.K[t] && this.K[t].length
},
Sc: function(t) {
if (t) return this.K[t] && this.K[t].length || 0;
var e = 0;
return m.a.D(this.K, function(t, i) {
"dirty" !== t && (e += i.length)
}), e
},
tb: function(t, e) {
return !this.equalityComparer || !this.equalityComparer(t, e)
},
extend: function(t) {
var e = this;
return t && m.a.D(t, function(t, i) {
var n = m.ya[t];
"function" == typeof n && (e = n(e, i) || e)
}), e
}
};
m.G(_, "subscribe", _.X), m.G(_, "extend", _.extend), m.G(_, "getSubscriptionsCount", _.Sc), m.a.ka && m.a.Xa(_, Function.prototype), m.J.fn = _, m.hc = function(t) {
return null != t && "function" == typeof t.X && "function" == typeof t.notifySubscribers
}, m.b("subscribable", m.J), m.b("isSubscribable", m.hc), m.va = m.l = function() {
function t(t) {
n.push(i), i = t
}
function e() {
i = n.pop()
}
var i, n = [],
r = 0;
return {
Ub: t,
end: e,
oc: function(t) {
if (i) {
if (!m.hc(t)) throw Error("Only subscribable things can act as dependencies");
i.gb.call(i.Gc, t, t.Cc || (t.Cc = ++r))
}
},
w: function(i, n, r) {
try {
return t(), i.apply(n, r || [])
} finally {
e()
}
},
Aa: function() {
if (i) return i.m.Aa()
},
Sa: function() {
if (i) return i.Sa
}
}
}(), m.b("computedContext", m.va), m.b("computedContext.getDependenciesCount", m.va.Aa), m.b("computedContext.isInitial", m.va.Sa), m.b("ignoreDependencies", m.qd = m.l.w);
var y = m.a.Yb("_latestValue");
m.N = function(t) {
function e() {
return 0 < arguments.length ? (e.tb(e[y], arguments[0]) && (e.ga(), e[y] = arguments[0], e.fa()), this) : (m.l.oc(e), e[y])
}
return e[y] = t, m.a.ka || m.a.extend(e, m.J.fn), m.J.fn.rb(e), m.a.Ya(e, b), m.options.deferUpdates && m.ya.deferred(e, !0), e
};
var b = {
equalityComparer: l,
t: function() {
return this[y]
},
fa: function() {
this.notifySubscribers(this[y])
},
ga: function() {
this.notifySubscribers(this[y], "beforeChange")
}
};
m.a.ka && m.a.Xa(b, m.J.fn);
var w = m.N.gd = "__ko_proto__";
b[w] = m.N, m.Oa = function(e, i) {
return null !== e && e !== t && e[w] !== t && (e[w] === i || m.Oa(e[w], i))
}, m.H = function(t) {
return m.Oa(t, m.N)
}, m.Ba = function(t) {
return !!("function" == typeof t && t[w] === m.N || "function" == typeof t && t[w] === m.B && t.Vc)
}, m.b("observable", m.N), m.b("isObservable", m.H), m.b("isWriteableObservable", m.Ba), m.b("isWritableObservable", m.Ba), m.b("observable.fn", b), m.G(b, "peek", b.t), m.G(b, "valueHasMutated", b.fa), m.G(b, "valueWillMutate", b.ga), m.la = function(t) {
if (t = t || [], "object" != typeof t || !("length" in t)) throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
return t = m.N(t), m.a.Ya(t, m.la.fn), t.extend({
trackArrayChanges: !0
})
}, m.la.fn = {
remove: function(t) {
for (var e = this.t(), i = [], n = "function" != typeof t || m.H(t) ?
function(e) {
return e === t
} : t, r = 0; r < e.length; r++) {
var o = e[r];
n(o) && (0 === i.length && this.ga(), i.push(o), e.splice(r, 1), r--)
}
return i.length && this.fa(), i
},
removeAll: function(e) {
if (e === t) {
var i = this.t(),
n = i.slice(0);
return this.ga(), i.splice(0, i.length), this.fa(), n
}
return e ? this.remove(function(t) {
return 0 <= m.a.o(e, t)
}) : []
},
destroy: function(t) {
var e = this.t(),
i = "function" != typeof t || m.H(t) ?
function(e) {
return e === t
} : t;
this.ga();
for (var n = e.length - 1; 0 <= n; n--) i(e[n]) && (e[n]._destroy = !0);
this.fa()
},
destroyAll: function(e) {
return e === t ? this.destroy(function() {
return !0
}) : e ? this.destroy(function(t) {
return 0 <= m.a.o(e, t)
}) : []
},
indexOf: function(t) {
var e = this();
return m.a.o(e, t)
},
replace: function(t, e) {
var i = this.indexOf(t);
0 <= i && (this.ga(), this.t()[i] = e, this.fa())
}
}, m.a.ka && m.a.Xa(m.la.fn, m.N.fn), m.a.q("pop push reverse shift sort splice unshift".split(" "), function(t) {
m.la.fn[t] = function() {
var e = this.t();
this.ga(), this.Vb(e, t, arguments);
var i = e[t].apply(e, arguments);
return this.fa(), i === e ? this : i
}
}), m.a.q(["slice"], function(t) {
m.la.fn[t] = function() {
var e = this();
return e[t].apply(e, arguments)
}
}), m.b("observableArray", m.la), m.ya.trackArrayChanges = function(t, e) {
function i() {
if (!r) {
r = !0;
var e = t.notifySubscribers;
t.notifySubscribers = function(t, i) {
return i && i !== v || ++a, e.apply(this, arguments)
};
var i = [].concat(t.t() || []);
o = null, n = t.X(function(e) {
if (e = [].concat(e || []), t.Pa("arrayChange")) {
var n;
(!o || 1 < a) && (o = m.a.ib(i, e, t.hb)), n = o
}
i = e, o = null, a = 0, n && n.length && t.notifySubscribers(n, "arrayChange")
})
}
}
if (t.hb = {}, e && "object" == typeof e && m.a.extend(t.hb, e), t.hb.sparse = !0, !t.Vb) {
var n, r = !1,
o = null,
a = 0,
s = t.sa,
l = t.Ia;
t.sa = function(e) {
s && s.call(t, e), "arrayChange" === e && i()
}, t.Ia = function(e) {
l && l.call(t, e), "arrayChange" !== e || t.Pa("arrayChange") || (n.k(), r = !1)
}, t.Vb = function(t, e, i) {
function n(t, e, i) {
return s[s.length] = {
status: t,
value: e,
index: i
}
}
if (r && !a) {
var s = [],
l = t.length,
u = i.length,
c = 0;
switch (e) {
case "push":
c = l;
case "unshift":
for (e = 0; e < u; e++) n("added", i[e], c + e);
break;
case "pop":
c = l - 1;
case "shift":
l && n("deleted", t[c], c);
break;
case "splice":
e = Math.min(Math.max(0, 0 > i[0] ? l + i[0] : i[0]), l);
for (var l = 1 === u ? l : Math.min(e + (i[1] || 0), l), u = e + u - 2, c = Math.max(l, u), h = [], d = [], p = 2; e < c; ++e, ++p) e < l && d.push(n("deleted", t[e], e)), e < u && h.push(n("added", i[p], e));
m.a.dc(d, h);
break;
default:
return
}
o = s
}
}
}
};
var C = m.a.Yb("_state");
m.m = m.B = function(e, i, n) {
function r() {
if (0 < arguments.length) {
if ("function" != typeof o) throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
return o.apply(a.pb, arguments), this
}
return m.l.oc(r), (a.S || a.s && r.Qa()) && r.aa(), a.T
}
if ("object" == typeof e ? n = e : (n = n || {}, e && (n.read = e)), "function" != typeof n.read) throw Error("Pass a function that returns the value of the ko.computed");
var o = n.write,
a = {
T: t,
S: !0,
Ra: !1,
Fb: !1,
R: !1,
Va: !1,
s: !1,
jd: n.read,
pb: i || n.owner,
i: n.disposeWhenNodeIsRemoved || n.i || null,
wa: n.disposeWhen || n.wa,
mb: null,
r: {},
L: 0,
bc: null
};
return r[C] = a, r.Vc = "function" == typeof o, m.a.ka || m.a.extend(r, m.J.fn), m.J.fn.rb(r), m.a.Ya(r, x), n.pure ? (a.Va = !0, a.s = !0, m.a.extend(r, E)) : n.deferEvaluation && m.a.extend(r, k), m.options.deferUpdates && m.ya.deferred(r, !0), a.i && (a.Fb = !0, a.i.nodeType || (a.i = null)), a.s || n.deferEvaluation || r.aa(), a.i && r.ba() && m.a.F.oa(a.i, a.mb = function() {
r.k()
}), r
};
var x = {
equalityComparer: l,
Aa: function() {
return this[C].L
},
Pb: function(t, e, i) {
if (this[C].Va && e === this) throw Error("A 'pure' computed must not be called recursively");
this[C].r[t] = i, i.Ga = this[C].L++, i.na = e.Na()
},
Qa: function() {
var t, e, i = this[C].r;
for (t in i) if (i.hasOwnProperty(t) && (e = i[t], e.ia.Uc(e.na))) return !0
},
bd: function() {
this.Fa && !this[C].Ra && this.Fa()
},
ba: function() {
return this[C].S || 0 < this[C].L
},
ld: function() {
this.Mb || this.ac()
},
uc: function(t) {
if (t.cb && !this[C].i) {
var e = t.X(this.bd, this, "dirty"),
i = t.X(this.ld, this);
return {
ia: t,
k: function() {
e.k(), i.k()
}
}
}
return t.X(this.ac, this)
},
ac: function() {
var t = this,
e = t.throttleEvaluation;
e && 0 <= e ? (clearTimeout(this[C].bc), this[C].bc = m.a.setTimeout(function() {
t.aa(!0)
}, e)) : t.Fa ? t.Fa() : t.aa(!0)
},
aa: function(t) {
var e = this[C],
i = e.wa;
if (!e.Ra && !e.R) {
if (e.i && !m.a.nb(e.i) || i && i()) {
if (!e.Fb) return void this.k()
} else e.Fb = !1;
e.Ra = !0;
try {
this.Qc(t)
} finally {
e.Ra = !1
}
e.L || this.k()
}
},
Qc: function(e) {
var i = this[C],
n = i.Va ? t : !i.L,
r = {
Hc: this,
Ma: i.r,
lb: i.L
};
m.l.Ub({
Gc: r,
gb: p,
m: this,
Sa: n
}), i.r = {}, i.L = 0, r = this.Pc(i, r), this.tb(i.T, r) && (i.s || this.notifySubscribers(i.T, "beforeChange"), i.T = r, i.s ? this.zc() : e && this.notifySubscribers(i.T)), n && this.notifySubscribers(i.T, "awake")
},
Pc: function(t, e) {
try {
var i = t.jd;
return t.pb ? i.call(t.pb) : i()
} finally {
m.l.end(), e.lb && !t.s && m.a.D(e.Ma, d), t.S = !1
}
},
t: function() {
var t = this[C];
return (t.S && !t.L || t.s && this.Qa()) && this.aa(), t.T
},
Ta: function(t) {
m.J.fn.Ta.call(this, t), this.Fa = function() {
this.Kb(this[C].T), this[C].S = !0, this.Lb(this)
}
},
k: function() {
var t = this[C];
!t.s && t.r && m.a.D(t.r, function(t, e) {
e.k && e.k()
}), t.i && t.mb && m.a.F.pc(t.i, t.mb), t.r = null, t.L = 0, t.R = !0, t.S = !1, t.s = !1, t.i = null
}
},
E = {
sa: function(t) {
var e = this,
i = e[C];
if (!i.R && i.s && "change" == t) {
if (i.s = !1, i.S || e.Qa()) i.r = null, i.L = 0, i.S = !0, e.aa();
else {
var n = [];
m.a.D(i.r, function(t, e) {
n[e.Ga] = t
}), m.a.q(n, function(t, n) {
var r = i.r[t],
o = e.uc(r.ia);
o.Ga = n, o.na = r.na, i.r[t] = o
})
}
i.R || e.notifySubscribers(i.T, "awake")
}
},
Ia: function(e) {
var i = this[C];
i.R || "change" != e || this.Pa("change") || (m.a.D(i.r, function(t, e) {
e.k && (i.r[t] = {
ia: e.ia,
Ga: e.Ga,
na: e.na
}, e.k())
}), i.s = !0, this.notifySubscribers(t, "asleep"))
},
Na: function() {
var t = this[C];
return t.s && (t.S || this.Qa()) && this.aa(), m.J.fn.Na.call(this)
}
},
k = {
sa: function(t) {
"change" != t && "beforeChange" != t || this.t()
}
};
m.a.ka && m.a.Xa(x, m.J.fn);
var L = m.N.gd;
m.m[L] = m.N, x[L] = m.m, m.Xc = function(t) {
return m.Oa(t, m.m)
}, m.Yc = function(t) {
return m.Oa(t, m.m) && t[C] && t[C].Va
}, m.b("computed", m.m), m.b("dependentObservable", m.m), m.b("isComputed", m.Xc), m.b("isPureComputed", m.Yc), m.b("computed.fn", x), m.G(x, "peek", x.t), m.G(x, "dispose", x.k), m.G(x, "isActive", x.ba), m.G(x, "getDependenciesCount", x.Aa), m.nc = function(t, e) {
return "function" == typeof t ? m.m(t, e, {
pure: !0
}) : (t = m.a.extend({}, t), t.pure = !0, m.m(t, e))
}, m.b("pureComputed", m.nc), function() {
function e(r, o, a) {
if (a = a || new n, r = o(r), "object" != typeof r || null === r || r === t || r instanceof RegExp || r instanceof Date || r instanceof String || r instanceof Number || r instanceof Boolean) return r;
var s = r instanceof Array ? [] : {};
return a.save(r, s), i(r, function(i) {
var n = o(r[i]);
switch (typeof n) {
case "boolean":
case "number":
case "string":
case "function":
s[i] = n;
break;
case "object":
case "undefined":
var l = a.get(n);
s[i] = l !== t ? l : e(n, o, a)
}
}), s
}
function i(t, e) {
if (t instanceof Array) {
for (var i = 0; i < t.length; i++) e(i);
"function" == typeof t.toJSON && e("toJSON")
} else for (i in t) e(i)
}
function n() {
this.keys = [], this.Ib = []
}
m.wc = function(t) {
if (0 == arguments.length) throw Error("When calling ko.toJS, pass the object you want to convert.");
return e(t, function(t) {
for (var e = 0; m.H(t) && 10 > e; e++) t = t();
return t
})
}, m.toJSON = function(t, e, i) {
return t = m.wc(t), m.a.Eb(t, e, i)
}, n.prototype = {
save: function(t, e) {
var i = m.a.o(this.keys, t);
0 <= i ? this.Ib[i] = e : (this.keys.push(t), this.Ib.push(e))
},
get: function(e) {
return e = m.a.o(this.keys, e), 0 <= e ? this.Ib[e] : t
}
}
}(), m.b("toJS", m.wc), m.b("toJSON", m.toJSON), function() {
m.j = {
u: function(e) {
switch (m.a.A(e)) {
case "option":
return !0 === e.__ko__hasDomDataOptionValue__ ? m.a.e.get(e, m.d.options.xb) : 7 >= m.a.C ? e.getAttributeNode("value") && e.getAttributeNode("value").specified ? e.value : e.text : e.value;
case "select":
return 0 <= e.selectedIndex ? m.j.u(e.options[e.selectedIndex]) : t;
default:
return e.value
}
},
ha: function(e, i, n) {
switch (m.a.A(e)) {
case "option":
switch (typeof i) {
case "string":
m.a.e.set(e, m.d.options.xb, t), "__ko__hasDomDataOptionValue__" in e && delete e.__ko__hasDomDataOptionValue__, e.value = i;
break;
default:
m.a.e.set(e, m.d.options.xb, i), e.__ko__hasDomDataOptionValue__ = !0, e.value = "number" == typeof i ? i : ""
}
break;
case "select":
"" !== i && null !== i || (i = t);
for (var r, o = -1, a = 0, s = e.options.length; a < s; ++a) if (r = m.j.u(e.options[a]), r == i || "" == r && i === t) {
o = a;
break
}(n || 0 <= o || i === t && 1 < e.size) && (e.selectedIndex = o);
break;
default:
null !== i && i !== t || (i = ""), e.value = i
}
}
}
}(), m.b("selectExtensions", m.j), m.b("selectExtensions.readValue", m.j.u), m.b("selectExtensions.writeValue", m.j.ha), m.h = function() {
function t(t) {
t = m.a.$a(t), 123 === t.charCodeAt(0) && (t = t.slice(1, -1));
var e, i = [],
a = t.match(n),
s = [],
l = 0;
if (a) {
a.push(",");
for (var u, c = 0; u = a[c]; ++c) {
var h = u.charCodeAt(0);
if (44 === h) {
if (0 >= l) {
i.push(e && s.length ? {
key: e,
value: s.join("")
} : {
unknown: e || s.join("")
}), e = l = 0, s = [];
continue
}
} else if (58 === h) {
if (!l && !e && 1 === s.length) {
e = s.pop();
continue
}
} else 47 === h && c && 1 < u.length ? (h = a[c - 1].match(r)) && !o[h[0]] && (t = t.substr(t.indexOf(u) + 1), a = t.match(n), a.push(","), c = -1, u = "/") : 40 === h || 123 === h || 91 === h ? ++l : 41 === h || 125 === h || 93 === h ? --l : e || s.length || 34 !== h && 39 !== h || (u = u.slice(1, -1));
s.push(u)
}
}
return i
}
var e = ["true", "false", "null", "undefined"],
i = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,
n = RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]", "g"),
r = /[\])"'A-Za-z0-9_$]+$/,
o = {
"in": 1,
"return": 1,
"typeof": 1
},
a = {};
return {
ta: [],
ea: a,
yb: t,
Ua: function(n, r) {
function o(t, n) {
var r;
if (!c) {
var h = m.getBindingHandler(t);
if (h && h.preprocess && !(n = h.preprocess(n, t, o))) return;
(h = a[t]) && (r = n, 0 <= m.a.o(e, r) ? r = !1 : (h = r.match(i), r = null !== h && (h[1] ? "Object(" + h[1] + ")" + h[2] : r)), h = r), h && l.push("'" + t + "':function(_z){" + r + "=_z}");
}
u && (n = "function(){return " + n + " }"), s.push("'" + t + "':" + n)
}
r = r || {};
var s = [],
l = [],
u = r.valueAccessors,
c = r.bindingParams,
h = "string" == typeof n ? t(n) : n;
return m.a.q(h, function(t) {
o(t.key || t.unknown, t.value)
}), l.length && o("_ko_property_writers", "{" + l.join(",") + " }"), s.join(",")
},
ad: function(t, e) {
for (var i = 0; i < t.length; i++) if (t[i].key == e) return !0;
return !1
},
Ea: function(t, e, i, n, r) {
t && m.H(t) ? !m.Ba(t) || r && t.t() === n || t(n) : (t = e.get("_ko_property_writers")) && t[i] && t[i](n)
}
}
}(), m.b("expressionRewriting", m.h), m.b("expressionRewriting.bindingRewriteValidators", m.h.ta), m.b("expressionRewriting.parseObjectLiteral", m.h.yb), m.b("expressionRewriting.preProcessBindings", m.h.Ua), m.b("expressionRewriting._twoWayBindings", m.h.ea), m.b("jsonExpressionRewriting", m.h), m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson", m.h.Ua), function() {
function t(t) {
return 8 == t.nodeType && a.test(o ? t.text : t.nodeValue)
}
function e(t) {
return 8 == t.nodeType && s.test(o ? t.text : t.nodeValue)
}
function i(i, n) {
for (var r = i, o = 1, a = []; r = r.nextSibling;) {
if (e(r) && (o--, 0 === o)) return a;
a.push(r), t(r) && o++
}
if (!n) throw Error("Cannot find closing comment tag to match: " + i.nodeValue);
return null
}
function r(t, e) {
var n = i(t, e);
return n ? 0 < n.length ? n[n.length - 1].nextSibling : t.nextSibling : null
}
var o = n && "" === n.createComment("test").text,
a = o ? /^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/ : /^\s*ko(?:\s+([\s\S]+))?\s*$/,
s = o ? /^\x3c!--\s*\/ko\s*--\x3e$/ : /^\s*\/ko\s*$/,
l = {
ul: !0,
ol: !0
};
m.f = {
Z: {},
childNodes: function(e) {
return t(e) ? i(e) : e.childNodes
},
xa: function(e) {
if (t(e)) {
e = m.f.childNodes(e);
for (var i = 0, n = e.length; i < n; i++) m.removeNode(e[i])
} else m.a.ob(e)
},
da: function(e, i) {
if (t(e)) {
m.f.xa(e);
for (var n = e.nextSibling, r = 0, o = i.length; r < o; r++) n.parentNode.insertBefore(i[r], n)
} else m.a.da(e, i)
},
mc: function(e, i) {
t(e) ? e.parentNode.insertBefore(i, e.nextSibling) : e.firstChild ? e.insertBefore(i, e.firstChild) : e.appendChild(i)
},
gc: function(e, i, n) {
n ? t(e) ? e.parentNode.insertBefore(i, n.nextSibling) : n.nextSibling ? e.insertBefore(i, n.nextSibling) : e.appendChild(i) : m.f.mc(e, i)
},
firstChild: function(i) {
return t(i) ? !i.nextSibling || e(i.nextSibling) ? null : i.nextSibling : i.firstChild
},
nextSibling: function(i) {
return t(i) && (i = r(i)), i.nextSibling && e(i.nextSibling) ? null : i.nextSibling
},
Tc: t,
pd: function(t) {
return (t = (o ? t.text : t.nodeValue).match(a)) ? t[1] : null
},
kc: function(i) {
if (l[m.a.A(i)]) {
var n = i.firstChild;
if (n) do
if (1 === n.nodeType) {
var o;
o = n.firstChild;
var a = null;
if (o) do
if (a) a.push(o);
else if (t(o)) {
var s = r(o, !0);
s ? o = s : a = [o]
} else e(o) && (a = [o]);
while (o = o.nextSibling);
if (o = a) for (a = n.nextSibling, s = 0; s < o.length; s++) a ? i.insertBefore(o[s], a) : i.appendChild(o[s])
}
while (n = n.nextSibling)
}
}
}
}(), m.b("virtualElements", m.f), m.b("virtualElements.allowedBindings", m.f.Z), m.b("virtualElements.emptyNode", m.f.xa), m.b("virtualElements.insertAfter", m.f.gc), m.b("virtualElements.prepend", m.f.mc), m.b("virtualElements.setDomNodeChildren", m.f.da), function() {
m.Q = function() {
this.Fc = {}
}, m.a.extend(m.Q.prototype, {
nodeHasBindings: function(t) {
switch (t.nodeType) {
case 1:
return null != t.getAttribute("data-bind") || m.g.getComponentNameForNode(t);
case 8:
return m.f.Tc(t);
default:
return !1
}
},
getBindings: function(t, e) {
var i = this.getBindingsString(t, e),
i = i ? this.parseBindingsString(i, e, t) : null;
return m.g.Ob(i, t, e, !1)
},
getBindingAccessors: function(t, e) {
var i = this.getBindingsString(t, e),
i = i ? this.parseBindingsString(i, e, t, {
valueAccessors: !0
}) : null;
return m.g.Ob(i, t, e, !0)
},
getBindingsString: function(t) {
switch (t.nodeType) {
case 1:
return t.getAttribute("data-bind");
case 8:
return m.f.pd(t);
default:
return null
}
},
parseBindingsString: function(t, e, i, n) {
try {
var r, o = this.Fc,
a = t + (n && n.valueAccessors || "");
if (!(r = o[a])) {
var s, l = "with($context){with($data||{}){return{" + m.h.Ua(t, n) + "}}}";
s = new Function("$context", "$element", l), r = o[a] = s
}
return r(e, i)
} catch (u) {
throw u.message = "Unable to parse bindings.\nBindings value: " + t + "\nMessage: " + u.message, u
}
}
}), m.Q.instance = new m.Q
}(), m.b("bindingProvider", m.Q), function() {
function i(t) {
return function() {
return t
}
}
function n(t) {
return t()
}
function r(t) {
return m.a.Ca(m.l.w(t), function(e, i) {
return function() {
return t()[i]
}
})
}
function a(t, e, n) {
return "function" == typeof t ? r(t.bind(null, e, n)) : m.a.Ca(t, i)
}
function s(t, e) {
return r(this.getBindings.bind(this, t, e))
}
function l(t, e, i) {
var n, r = m.f.firstChild(e),
o = m.Q.instance,
a = o.preprocessNode;
if (a) {
for (; n = r;) r = m.f.nextSibling(n), a.call(o, n);
r = m.f.firstChild(e)
}
for (; n = r;) r = m.f.nextSibling(n), u(t, n, i)
}
function u(t, e, i) {
var n = !0,
r = 1 === e.nodeType;
r && m.f.kc(e), (r && i || m.Q.instance.nodeHasBindings(e)) && (n = h(e, null, t, i).shouldBindDescendants), n && !p[m.a.A(e)] && l(t, e, !r)
}
function c(t) {
var e = [],
i = {},
n = [];
return m.a.D(t, function r(o) {
if (!i[o]) {
var a = m.getBindingHandler(o);
a && (a.after && (n.push(o), m.a.q(a.after, function(e) {
if (t[e]) {
if (-1 !== m.a.o(n, e)) throw Error("Cannot combine the following bindings, because they have a cyclic dependency: " + n.join(", "));
r(e)
}
}), n.length--), e.push({
key: o,
fc: a
})), i[o] = !0
}
}), e
}
function h(e, i, r, o) {
var a = m.a.e.get(e, f);
if (!i) {
if (a) throw Error("You cannot apply bindings multiple times to the same element.");
m.a.e.set(e, f, !0)
}!a && o && m.tc(e, r);
var l;
if (i && "function" != typeof i) l = i;
else {
var u = m.Q.instance,
h = u.getBindingAccessors || s,
d = m.B(function() {
return (l = i ? i(r, e) : h.call(u, e, r)) && r.P && r.P(), l
}, null, {
i: e
});
l && d.ba() || (d = null)
}
var p;
if (l) {
var g = d ?
function(t) {
return function() {
return n(d()[t])
}
} : function(t) {
return l[t]
}, v = function() {
return m.a.Ca(d ? d() : l, n)
};
v.get = function(t) {
return l[t] && n(g(t))
}, v.has = function(t) {
return t in l
}, o = c(l), m.a.q(o, function(i) {
var n = i.fc.init,
o = i.fc.update,
a = i.key;
if (8 === e.nodeType && !m.f.Z[a]) throw Error("The binding '" + a + "' cannot be used with virtual elements");
try {
"function" == typeof n && m.l.w(function() {
var i = n(e, g(a), v, r.$data, r);
if (i && i.controlsDescendantBindings) {
if (p !== t) throw Error("Multiple bindings (" + p + " and " + a + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
p = a
}
}), "function" == typeof o && m.B(function() {
o(e, g(a), v, r.$data, r)
}, null, {
i: e
})
} catch (s) {
throw s.message = 'Unable to process binding "' + a + ": " + l[a] + '"\nMessage: ' + s.message, s
}
})
}
return {
shouldBindDescendants: p === t
}
}
function d(t) {
return t && t instanceof m.U ? t : new m.U(t)
}
m.d = {};
var p = {
script: !0,
textarea: !0,
template: !0
};
m.getBindingHandler = function(t) {
return m.d[t]
}, m.U = function(e, i, n, r) {
var o, a = this,
s = "function" == typeof e && !m.H(e),
l = m.B(function() {
var t = s ? e() : e,
o = m.a.c(t);
return i ? (i.P && i.P(), m.a.extend(a, i), l && (a.P = l)) : (a.$parents = [], a.$root = o, a.ko = m), a.$rawData = t, a.$data = o, n && (a[n] = o), r && r(a, i, o), a.$data
}, null, {
wa: function() {
return o && !m.a.Qb(o)
},
i: !0
});
l.ba() && (a.P = l, l.equalityComparer = null, o = [], l.Ac = function(e) {
o.push(e), m.a.F.oa(e, function(e) {
m.a.La(o, e), o.length || (l.k(), a.P = l = t)
})
})
}, m.U.prototype.createChildContext = function(t, e, i) {
return new m.U(t, this, e, function(t, e) {
t.$parentContext = e, t.$parent = e.$data, t.$parents = (e.$parents || []).slice(0), t.$parents.unshift(t.$parent), i && i(t)
})
}, m.U.prototype.extend = function(t) {
return new m.U(this.P || this.$data, this, null, function(e, i) {
e.$rawData = i.$rawData, m.a.extend(e, "function" == typeof t ? t() : t)
})
};
var f = m.a.e.I(),
g = m.a.e.I();
m.tc = function(t, e) {
return 2 != arguments.length ? m.a.e.get(t, g) : (m.a.e.set(t, g, e), void(e.P && e.P.Ac(t)))
}, m.Ja = function(t, e, i) {
return 1 === t.nodeType && m.f.kc(t), h(t, e, d(i), !0)
}, m.Dc = function(t, e, i) {
return i = d(i), m.Ja(t, a(e, i, t), i)
}, m.eb = function(t, e) {
1 !== e.nodeType && 8 !== e.nodeType || l(d(t), e, !0)
}, m.Rb = function(t, i) {
if (!o && e.jQuery && (o = e.jQuery), i && 1 !== i.nodeType && 8 !== i.nodeType) throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");
i = i || e.document.body, u(d(t), i, !0)
}, m.kb = function(e) {
switch (e.nodeType) {
case 1:
case 8:
var i = m.tc(e);
if (i) return i;
if (e.parentNode) return m.kb(e.parentNode)
}
return t
}, m.Jc = function(e) {
return (e = m.kb(e)) ? e.$data : t
}, m.b("bindingHandlers", m.d), m.b("applyBindings", m.Rb), m.b("applyBindingsToDescendants", m.eb), m.b("applyBindingAccessorsToNode", m.Ja), m.b("applyBindingsToNode", m.Dc), m.b("contextFor", m.kb), m.b("dataFor", m.Jc)
}(), function(t) {
function e(e, n) {
var a, s = r.hasOwnProperty(e) ? r[e] : t;
s ? s.X(n) : (s = r[e] = new m.J, s.X(n), i(e, function(t, i) {
var n = !(!i || !i.synchronous);
o[e] = {
definition: t,
Zc: n
}, delete r[e], a || n ? s.notifySubscribers(t) : m.Y.Wa(function() {
s.notifySubscribers(t)
})
}), a = !0)
}
function i(t, e) {
n("getConfig", [t], function(i) {
i ? n("loadComponent", [t, i], function(t) {
e(t, i)
}) : e(null, null)
})
}
function n(e, i, r, o) {
o || (o = m.g.loaders.slice(0));
var a = o.shift();
if (a) {
var s = a[e];
if (s) {
var l = !1;
if (s.apply(a, i.concat(function(t) {
l ? r(null) : null !== t ? r(t) : n(e, i, r, o)
})) !== t && (l = !0, !a.suppressLoaderExceptions)) throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")
} else n(e, i, r, o)
} else r(null)
}
var r = {},
o = {};
m.g = {
get: function(i, n) {
var r = o.hasOwnProperty(i) ? o[i] : t;
r ? r.Zc ? m.l.w(function() {
n(r.definition)
}) : m.Y.Wa(function() {
n(r.definition)
}) : e(i, n)
},
Xb: function(t) {
delete o[t]
},
Jb: n
}, m.g.loaders = [], m.b("components", m.g), m.b("components.get", m.g.get), m.b("components.clearCachedDefinition", m.g.Xb)
}(), function() {
function t(t, e, i, n) {
function r() {
0 === --s && n(o)
}
var o = {},
s = 2,
l = i.template;
i = i.viewModel, l ? a(e, l, function(e) {
m.g.Jb("loadTemplate", [t, e], function(t) {
o.template = t, r()
})
}) : r(), i ? a(e, i, function(e) {
m.g.Jb("loadViewModel", [t, e], function(t) {
o[c] = t, r()
})
}) : r()
}
function i(t, e, n) {
if ("function" == typeof e) n(function(t) {
return new e(t)
});
else if ("function" == typeof e[c]) n(e[c]);
else if ("instance" in e) {
var r = e.instance;
n(function() {
return r
})
} else "viewModel" in e ? i(t, e.viewModel, n) : t("Unknown viewModel value: " + e)
}
function r(t) {
switch (m.a.A(t)) {
case "script":
return m.a.ma(t.text);
case "textarea":
return m.a.ma(t.value);
case "template":
if (o(t.content)) return m.a.ua(t.content.childNodes)
}
return m.a.ua(t.childNodes)
}
function o(t) {
return e.DocumentFragment ? t instanceof DocumentFragment : t && 11 === t.nodeType
}
function a(t, i, n) {
"string" == typeof i.require ? s || e.require ? (s || e.require)([i.require], n) : t("Uses require, but no AMD loader is present") : n(i)
}
function l(t) {
return function(e) {
throw Error("Component '" + t + "': " + e)
}
}
var u = {};
m.g.register = function(t, e) {
if (!e) throw Error("Invalid configuration for " + t);
if (m.g.ub(t)) throw Error("Component " + t + " is already registered");
u[t] = e
}, m.g.ub = function(t) {
return u.hasOwnProperty(t)
}, m.g.od = function(t) {
delete u[t], m.g.Xb(t)
}, m.g.Zb = {
getConfig: function(t, e) {
e(u.hasOwnProperty(t) ? u[t] : null)
},
loadComponent: function(e, i, n) {
var r = l(e);
a(r, i, function(i) {
t(e, r, i, n)
})
},
loadTemplate: function(t, i, a) {
if (t = l(t), "string" == typeof i) a(m.a.ma(i));
else if (i instanceof Array) a(i);
else if (o(i)) a(m.a.V(i.childNodes));
else if (i.element) if (i = i.element, e.HTMLElement ? i instanceof HTMLElement : i && i.tagName && 1 === i.nodeType) a(r(i));
else if ("string" == typeof i) {
var s = n.getElementById(i);
s ? a(r(s)) : t("Cannot find element with ID " + i)
} else t("Unknown element type: " + i);
else t("Unknown template value: " + i)
},
loadViewModel: function(t, e, n) {
i(l(t), e, n)
}
};
var c = "createViewModel";
m.b("components.register", m.g.register), m.b("components.isRegistered", m.g.ub), m.b("components.unregister", m.g.od), m.b("components.defaultLoader", m.g.Zb), m.g.loaders.push(m.g.Zb), m.g.Bc = u
}(), function() {
function t(t, i) {
var n = t.getAttribute("params");
if (n) {
var n = e.parseBindingsString(n, i, t, {
valueAccessors: !0,
bindingParams: !0
}),
n = m.a.Ca(n, function(e) {
return m.m(e, null, {
i: t
})
}),
r = m.a.Ca(n, function(e) {
var i = e.t();
return e.ba() ? m.m({
read: function() {
return m.a.c(e())
},
write: m.Ba(i) &&
function(t) {
e()(t)
},
i: t
}) : i
});
return r.hasOwnProperty("$raw") || (r.$raw = n), r
}
return {
$raw: {}
}
}
m.g.getComponentNameForNode = function(t) {
var e = m.a.A(t);
if (m.g.ub(e) && (-1 != e.indexOf("-") || "[object HTMLUnknownElement]" == "" + t || 8 >= m.a.C && t.tagName === e)) return e
}, m.g.Ob = function(e, i, n, r) {
if (1 === i.nodeType) {
var o = m.g.getComponentNameForNode(i);
if (o) {
if (e = e || {}, e.component) throw Error('Cannot use the "component" binding on a custom element matching a component');
var a = {
name: o,
params: t(i, n)
};
e.component = r ?
function() {
return a
} : a
}
}
return e
};
var e = new m.Q;
9 > m.a.C && (m.g.register = function(t) {
return function(e) {
return n.createElement(e), t.apply(this, arguments)
}
}(m.g.register), n.createDocumentFragment = function(t) {
return function() {
var e, i = t(),
n = m.g.Bc;
for (e in n) n.hasOwnProperty(e) && i.createElement(e);
return i
}
}(n.createDocumentFragment))
}(), function(t) {
function e(t, e, i) {
if (e = e.template, !e) throw Error("Component '" + t + "' has no template");
t = m.a.ua(e), m.f.da(i, t)
}
function i(t, e, i, n) {
var r = t.createViewModel;
return r ? r.call(t, n, {
element: e,
templateNodes: i
}) : n
}
var n = 0;
m.d.component = {
init: function(r, o, a, s, l) {
function u() {
var t = c && c.dispose;
"function" == typeof t && t.call(c), h = c = null
}
var c, h, d = m.a.V(m.f.childNodes(r));
return m.a.F.oa(r, u), m.m(function() {
var a, s, p = m.a.c(o());
if ("string" == typeof p ? a = p : (a = m.a.c(p.name), s = m.a.c(p.params)), !a) throw Error("No component name specified");
var f = h = ++n;
m.g.get(a, function(n) {
if (h === f) {
if (u(), !n) throw Error("Unknown component '" + a + "'");
e(a, n, r);
var o = i(n, r, d, s);
n = l.createChildContext(o, t, function(t) {
t.$component = o, t.$componentTemplateNodes = d
}), c = o, m.eb(n, r)
}
})
}, null, {
i: r
}), {
controlsDescendantBindings: !0
}
}
}, m.f.Z.component = !0
}();
var P = {
"class": "className",
"for": "htmlFor"
};
m.d.attr = {
update: function(e, i) {
var n = m.a.c(i()) || {};
m.a.D(n, function(i, n) {
n = m.a.c(n);
var r = !1 === n || null === n || n === t;
r && e.removeAttribute(i), 8 >= m.a.C && i in P ? (i = P[i], r ? e.removeAttribute(i) : e[i] = n) : r || e.setAttribute(i, n.toString()), "name" === i && m.a.rc(e, r ? "" : n.toString())
})
}
}, function() {
m.d.checked = {
after: ["value", "attr"],
init: function(e, i, n) {
function r() {
var t = e.checked,
r = p ? a() : t;
if (!m.va.Sa() && (!l || t)) {
var o = m.l.w(i);
if (c) {
var s = h ? o.t() : o;
d !== r ? (t && (m.a.pa(s, r, !0), m.a.pa(s, d, !1)), d = r) : m.a.pa(s, r, t), h && m.Ba(o) && o(s)
} else m.h.Ea(o, n, "checked", r, !0)
}
}
function o() {
var t = m.a.c(i());
e.checked = c ? 0 <= m.a.o(t, a()) : s ? t : a() === t
}
var a = m.nc(function() {
return n.has("checkedValue") ? m.a.c(n.get("checkedValue")) : n.has("value") ? m.a.c(n.get("value")) : e.value
}),
s = "checkbox" == e.type,
l = "radio" == e.type;
if (s || l) {
var u = i(),
c = s && m.a.c(u) instanceof Array,
h = !(c && u.push && u.splice),
d = c ? a() : t,
p = l || c;
l && !e.name && m.d.uniqueName.init(e, function() {
return !0
}), m.m(r, null, {
i: e
}), m.a.p(e, "click", r), m.m(o, null, {
i: e
}), u = t
}
}
}, m.h.ea.checked = !0, m.d.checkedValue = {
update: function(t, e) {
t.value = m.a.c(e())
}
}
}(), m.d.css = {
update: function(t, e) {
var i = m.a.c(e());
null !== i && "object" == typeof i ? m.a.D(i, function(e, i) {
i = m.a.c(i), m.a.bb(t, e, i)
}) : (i = m.a.$a(String(i || "")), m.a.bb(t, t.__ko__cssValue, !1), t.__ko__cssValue = i, m.a.bb(t, i, !0))
}
}, m.d.enable = {
update: function(t, e) {
var i = m.a.c(e());
i && t.disabled ? t.removeAttribute("disabled") : i || t.disabled || (t.disabled = !0)
}
}, m.d.disable = {
update: function(t, e) {
m.d.enable.update(t, function() {
return !m.a.c(e())
})
}
}, m.d.event = {
init: function(t, e, i, n, r) {
var o = e() || {};
m.a.D(o, function(o) {
"string" == typeof o && m.a.p(t, o, function(t) {
var a, s = e()[o];
if (s) {
try {
var l = m.a.V(arguments);
n = r.$data, l.unshift(n), a = s.apply(n, l)
} finally {
!0 !== a && (t.preventDefault ? t.preventDefault() : t.returnValue = !1)
}!1 === i.get(o + "Bubble") && (t.cancelBubble = !0, t.stopPropagation && t.stopPropagation())
}
})
})
}
}, m.d.foreach = {
ic: function(t) {
return function() {
var e = t(),
i = m.a.zb(e);
return i && "number" != typeof i.length ? (m.a.c(e), {
foreach: i.data,
as: i.as,
includeDestroyed: i.includeDestroyed,
afterAdd: i.afterAdd,
beforeRemove: i.beforeRemove,
afterRender: i.afterRender,
beforeMove: i.beforeMove,
afterMove: i.afterMove,
templateEngine: m.W.sb
}) : {
foreach: e,
templateEngine: m.W.sb
}
}
},
init: function(t, e) {
return m.d.template.init(t, m.d.foreach.ic(e))
},
update: function(t, e, i, n, r) {
return m.d.template.update(t, m.d.foreach.ic(e), i, n, r)
}
}, m.h.ta.foreach = !1, m.f.Z.foreach = !0, m.d.hasfocus = {
init: function(t, e, i) {
function n(n) {
t.__ko_hasfocusUpdating = !0;
var r = t.ownerDocument;
if ("activeElement" in r) {
var o;
try {
o = r.activeElement
} catch (a) {
o = r.body
}
n = o === t
}
r = e(), m.h.Ea(r, i, "hasfocus", n, !0), t.__ko_hasfocusLastValue = n, t.__ko_hasfocusUpdating = !1
}
var r = n.bind(null, !0),
o = n.bind(null, !1);
m.a.p(t, "focus", r), m.a.p(t, "focusin", r), m.a.p(t, "blur", o), m.a.p(t, "focusout", o)
},
update: function(t, e) {
var i = !! m.a.c(e());
t.__ko_hasfocusUpdating || t.__ko_hasfocusLastValue === i || (i ? t.focus() : t.blur(), !i && t.__ko_hasfocusLastValue && t.ownerDocument.body.focus(), m.l.w(m.a.Da, null, [t, i ? "focusin" : "focusout"]))
}
}, m.h.ea.hasfocus = !0, m.d.hasFocus = m.d.hasfocus, m.h.ea.hasFocus = !0, m.d.html = {
init: function() {
return {
controlsDescendantBindings: !0
}
},
update: function(t, e) {
m.a.Cb(t, e())
}
}, f("if"), f("ifnot", !1, !0), f("with", !0, !1, function(t, e) {
return t.createChildContext(e)
});
var D = {};
m.d.options = {
init: function(t) {
if ("select" !== m.a.A(t)) throw Error("options binding applies only to SELECT elements");
for (; 0 < t.length;) t.remove(0);
return {
controlsDescendantBindings: !0
}
},
update: function(e, i, n) {
function r() {
return m.a.Ka(e.options, function(t) {
return t.selected
})
}
function o(t, e, i) {
var n = typeof e;
return "function" == n ? e(t) : "string" == n ? t[e] : i
}
function a(t, i) {
if (f && c) m.j.ha(e, m.a.c(n.get("value")), !0);
else if (p.length) {
var r = 0 <= m.a.o(p, m.j.u(i[0]));
m.a.sc(i[0], r), f && !r && m.l.w(m.a.Da, null, [e, "change"])
}
}
var s = e.multiple,
l = 0 != e.length && s ? e.scrollTop : null,
u = m.a.c(i()),
c = n.get("valueAllowUnset") && n.has("value"),
h = n.get("optionsIncludeDestroyed");
i = {};
var d, p = [];
c || (s ? p = m.a.fb(r(), m.j.u) : 0 <= e.selectedIndex && p.push(m.j.u(e.options[e.selectedIndex]))), u && ("undefined" == typeof u.length && (u = [u]), d = m.a.Ka(u, function(e) {
return h || e === t || null === e || !m.a.c(e._destroy)
}), n.has("optionsCaption") && (u = m.a.c(n.get("optionsCaption")), null !== u && u !== t && d.unshift(D)));
var f = !1;
i.beforeRemove = function(t) {
e.removeChild(t)
}, u = a, n.has("optionsAfterRender") && "function" == typeof n.get("optionsAfterRender") && (u = function(e, i) {
a(0, i), m.l.w(n.get("optionsAfterRender"), null, [i[0], e !== D ? e : t])
}), m.a.Bb(e, d, function(i, r, a) {
return a.length && (p = !c && a[0].selected ? [m.j.u(a[0])] : [], f = !0), r = e.ownerDocument.createElement("option"), i === D ? (m.a.Za(r, n.get("optionsCaption")), m.j.ha(r, t)) : (a = o(i, n.get("optionsValue"), i), m.j.ha(r, m.a.c(a)), i = o(i, n.get("optionsText"), a), m.a.Za(r, i)), [r]
}, i, u), m.l.w(function() {
c ? m.j.ha(e, m.a.c(n.get("value")), !0) : (s ? p.length && r().length < p.length : p.length && 0 <= e.selectedIndex ? m.j.u(e.options[e.selectedIndex]) !== p[0] : p.length || 0 <= e.selectedIndex) && m.a.Da(e, "change")
}), m.a.Nc(e), l && 20 < Math.abs(l - e.scrollTop) && (e.scrollTop = l)
}
}, m.d.options.xb = m.a.e.I(), m.d.selectedOptions = {
after: ["options", "foreach"],
init: function(t, e, i) {
m.a.p(t, "change", function() {
var n = e(),
r = [];
m.a.q(t.getElementsByTagName("option"), function(t) {
t.selected && r.push(m.j.u(t))
}), m.h.Ea(n, i, "selectedOptions", r)
})
},
update: function(t, e) {
if ("select" != m.a.A(t)) throw Error("values binding applies only to SELECT elements");
var i = m.a.c(e()),
n = t.scrollTop;
i && "number" == typeof i.length && m.a.q(t.getElementsByTagName("option"), function(t) {
var e = 0 <= m.a.o(i, m.j.u(t));
t.selected != e && m.a.sc(t, e)
}), t.scrollTop = n
}
}, m.h.ea.selectedOptions = !0, m.d.style = {
update: function(e, i) {
var n = m.a.c(i() || {});
m.a.D(n, function(i, n) {
n = m.a.c(n), null !== n && n !== t && !1 !== n || (n = ""), e.style[i] = n
})
}
}, m.d.submit = {
init: function(t, e, i, n, r) {
if ("function" != typeof e()) throw Error("The value for a submit binding must be a function");
m.a.p(t, "submit", function(i) {
var n, o = e();
try {
n = o.call(r.$data, t)
} finally {
!0 !== n && (i.preventDefault ? i.preventDefault() : i.returnValue = !1)
}
})
}
}, m.d.text = {
init: function() {
return {
controlsDescendantBindings: !0
}
},
update: function(t, e) {
m.a.Za(t, e())
}
}, m.f.Z.text = !0, function() {
if (e && e.navigator) var i = function(t) {
if (t) return parseFloat(t[1])
},
n = e.opera && e.opera.version && parseInt(e.opera.version()),
r = e.navigator.userAgent,
o = i(r.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),
a = i(r.match(/Firefox\/([^ ]*)/));
if (10 > m.a.C) var s = m.a.e.I(),
l = m.a.e.I(),
u = function(t) {
var e = this.activeElement;
(e = e && m.a.e.get(e, l)) && e(t)
},
c = function(t, e) {
var i = t.ownerDocument;
m.a.e.get(i, s) || (m.a.e.set(i, s, !0), m.a.p(i, "selectionchange", u)), m.a.e.set(t, l, e)
};
m.d.textInput = {
init: function(e, i, r) {
function s(t, i) {
m.a.p(e, t, i)
}
function l() {
var n = m.a.c(i());
null !== n && n !== t || (n = ""), p !== t && n === p ? m.a.setTimeout(l, 4) : e.value !== n && (f = n, e.value = n)
}
function u() {
d || (p = e.value, d = m.a.setTimeout(h, 4))
}
function h() {
clearTimeout(d), p = d = t;
var n = e.value;
f !== n && (f = n, m.h.Ea(i(), r, "textInput", n))
}
var d, p, f = e.value,
g = 9 == m.a.C ? u : h;
10 > m.a.C ? (s("propertychange", function(t) {
"value" === t.propertyName && g(t)
}), 8 == m.a.C && (s("keyup", h), s("keydown", h)), 8 <= m.a.C && (c(e, g), s("dragend", u))) : (s("input", h), 5 > o && "textarea" === m.a.A(e) ? (s("keydown", u), s("paste", u), s("cut", u)) : 11 > n ? s("keydown", u) : 4 > a && (s("DOMAutoComplete", h), s("dragdrop", h), s("drop", h))), s("change", h), m.m(l, null, {
i: e
})
}
}, m.h.ea.textInput = !0, m.d.textinput = {
preprocess: function(t, e, i) {
i("textInput", t)
}
}
}(), m.d.uniqueName = {
init: function(t, e) {
if (e()) {
var i = "ko_unique_" + ++m.d.uniqueName.Ic;
m.a.rc(t, i)
}
}
}, m.d.uniqueName.Ic = 0, m.d.value = {
after: ["options", "foreach"],
init: function(t, e, i) {
if ("input" != t.tagName.toLowerCase() || "checkbox" != t.type && "radio" != t.type) {
var n = ["change"],
r = i.get("valueUpdate"),
o = !1,
a = null;
r && ("string" == typeof r && (r = [r]), m.a.ra(n, r), n = m.a.Tb(n));
var s = function() {
a = null, o = !1;
var n = e(),
r = m.j.u(t);
m.h.Ea(n, i, "value", r)
};
!m.a.C || "input" != t.tagName.toLowerCase() || "text" != t.type || "off" == t.autocomplete || t.form && "off" == t.form.autocomplete || -1 != m.a.o(n, "propertychange") || (m.a.p(t, "propertychange", function() {
o = !0
}), m.a.p(t, "focus", function() {
o = !1
}), m.a.p(t, "blur", function() {
o && s()
})), m.a.q(n, function(e) {
var i = s;
m.a.nd(e, "after") && (i = function() {
a = m.j.u(t), m.a.setTimeout(s, 0)
}, e = e.substring(5)), m.a.p(t, e, i)
});
var l = function() {
var n = m.a.c(e()),
r = m.j.u(t);
if (null !== a && n === a) m.a.setTimeout(l, 0);
else if (n !== r) if ("select" === m.a.A(t)) {
var o = i.get("valueAllowUnset"),
r = function() {
m.j.ha(t, n, o)
};
r(), o || n === m.j.u(t) ? m.a.setTimeout(r, 0) : m.l.w(m.a.Da, null, [t, "change"])
} else m.j.ha(t, n)
};
m.m(l, null, {
i: t
})
} else m.Ja(t, {
checkedValue: e
})
},
update: function() {}
}, m.h.ea.value = !0, m.d.visible = {
update: function(t, e) {
var i = m.a.c(e()),
n = "none" != t.style.display;
i && !n ? t.style.display = "" : !i && n && (t.style.display = "none")
}
}, function(t) {
m.d[t] = {
init: function(e, i, n, r, o) {
return m.d.event.init.call(this, e, function() {
var e = {};
return e[t] = i(), e
}, n, r, o)
}
}
}("click"), m.O = function() {}, m.O.prototype.renderTemplateSource = function() {
throw Error("Override renderTemplateSource")
}, m.O.prototype.createJavaScriptEvaluatorBlock = function() {
throw Error("Override createJavaScriptEvaluatorBlock")
}, m.O.prototype.makeTemplateSource = function(t, e) {
if ("string" == typeof t) {
e = e || n;
var i = e.getElementById(t);
if (!i) throw Error("Cannot find template with ID " + t);
return new m.v.n(i)
}
if (1 == t.nodeType || 8 == t.nodeType) return new m.v.qa(t);
throw Error("Unknown template type: " + t)
}, m.O.prototype.renderTemplate = function(t, e, i, n) {
return t = this.makeTemplateSource(t, n), this.renderTemplateSource(t, e, i, n)
}, m.O.prototype.isTemplateRewritten = function(t, e) {
return !1 === this.allowTemplateRewriting || this.makeTemplateSource(t, e).data("isRewritten")
}, m.O.prototype.rewriteTemplate = function(t, e, i) {
t = this.makeTemplateSource(t, i), e = e(t.text()), t.text(e), t.data("isRewritten", !0)
}, m.b("templateEngine", m.O), m.Gb = function() {
function t(t, e, i, n) {
t = m.h.yb(t);
for (var r = m.h.ta, o = 0; o < t.length; o++) {
var a = t[o].key;
if (r.hasOwnProperty(a)) {
var s = r[a];
if ("function" == typeof s) {
if (a = s(t[o].value)) throw Error(a)
} else if (!s) throw Error("This template engine does not support the '" + a + "' binding within its templates")
}
}
return i = "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + m.h.Ua(t, {
valueAccessors: !0
}) + " } })()},'" + i.toLowerCase() + "')", n.createJavaScriptEvaluatorBlock(i) + e
}
var e = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,
i = /\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;
return {
Oc: function(t, e, i) {
e.isTemplateRewritten(t, i) || e.rewriteTemplate(t, function(t) {
return m.Gb.dd(t, e)
}, i)
},
dd: function(n, r) {
return n.replace(e, function(e, i, n, o, a) {
return t(a, i, n, r)
}).replace(i, function(e, i) {
return t(i, "", "#comment", r)
})
},
Ec: function(t, e) {
return m.M.wb(function(i, n) {
var r = i.nextSibling;
r && r.nodeName.toLowerCase() === e && m.Ja(r, t, n)
})
}
}
}(), m.b("__tr_ambtns", m.Gb.Ec), function() {
m.v = {}, m.v.n = function(t) {
if (this.n = t) {
var e = m.a.A(t);
this.ab = "script" === e ? 1 : "textarea" === e ? 2 : "template" == e && t.content && 11 === t.content.nodeType ? 3 : 4
}
}, m.v.n.prototype.text = function() {
var t = 1 === this.ab ? "text" : 2 === this.ab ? "value" : "innerHTML";
if (0 == arguments.length) return this.n[t];
var e = arguments[0];
"innerHTML" === t ? m.a.Cb(this.n, e) : this.n[t] = e
};
var e = m.a.e.I() + "_";
m.v.n.prototype.data = function(t) {
return 1 === arguments.length ? m.a.e.get(this.n, e + t) : void m.a.e.set(this.n, e + t, arguments[1])
};
var i = m.a.e.I();
m.v.n.prototype.nodes = function() {
var e = this.n;
return 0 == arguments.length ? (m.a.e.get(e, i) || {}).jb || (3 === this.ab ? e.content : 4 === this.ab ? e : t) : void m.a.e.set(e, i, {
jb: arguments[0]
})
}, m.v.qa = function(t) {
this.n = t
}, m.v.qa.prototype = new m.v.n, m.v.qa.prototype.text = function() {
if (0 == arguments.length) {
var e = m.a.e.get(this.n, i) || {};
return e.Hb === t && e.jb && (e.Hb = e.jb.innerHTML), e.Hb
}
m.a.e.set(this.n, i, {
Hb: arguments[0]
})
}, m.b("templateSources", m.v), m.b("templateSources.domElement", m.v.n), m.b("templateSources.anonymousTemplate", m.v.qa)
}(), function() {
function e(t, e, i) {
var n;
for (e = m.f.nextSibling(e); t && (n = t) !== e;) t = m.f.nextSibling(n), i(n, t)
}
function i(t, i) {
if (t.length) {
var n = t[0],
r = t[t.length - 1],
o = n.parentNode,
a = m.Q.instance,
s = a.preprocessNode;
if (s) {
if (e(n, r, function(t, e) {
var i = t.previousSibling,
o = s.call(a, t);
o && (t === n && (n = o[0] || e), t === r && (r = o[o.length - 1] || i))
}), t.length = 0, !n) return;
n === r ? t.push(n) : (t.push(n, r), m.a.za(t, o))
}
e(n, r, function(t) {
1 !== t.nodeType && 8 !== t.nodeType || m.Rb(i, t)
}), e(n, r, function(t) {
1 !== t.nodeType && 8 !== t.nodeType || m.M.yc(t, [i])
}), m.a.za(t, o)
}
}
function n(t) {
return t.nodeType ? t : 0 < t.length ? t[0] : null
}
function r(t, e, r, o, s) {
s = s || {};
var l = (t && n(t) || r || {}).ownerDocument,
u = s.templateEngine || a;
if (m.Gb.Oc(r, u, l), r = u.renderTemplate(r, o, s, l), "number" != typeof r.length || 0 < r.length && "number" != typeof r[0].nodeType) throw Error("Template engine must return an array of DOM nodes");
switch (l = !1, e) {
case "replaceChildren":
m.f.da(t, r), l = !0;
break;
case "replaceNode":
m.a.qc(t, r), l = !0;
break;
case "ignoreTargetNode":
break;
default:
throw Error("Unknown renderMode: " + e)
}
return l && (i(r, o), s.afterRender && m.l.w(s.afterRender, null, [r, o.$data])), r
}
function o(t, e, i) {
return m.H(t) ? t() : "function" == typeof t ? t(e, i) : t
}
var a;
m.Db = function(e) {
if (e != t && !(e instanceof m.O)) throw Error("templateEngine must inherit from ko.templateEngine");
a = e
}, m.Ab = function(e, i, s, l, u) {
if (s = s || {}, (s.templateEngine || a) == t) throw Error("Set a template engine before calling renderTemplate");
if (u = u || "replaceChildren", l) {
var c = n(l);
return m.B(function() {
var t = i && i instanceof m.U ? i : new m.U(m.a.c(i)),
a = o(e, t.$data, t),
t = r(l, u, a, t, s);
"replaceNode" == u && (l = t, c = n(l))
}, null, {
wa: function() {
return !c || !m.a.nb(c)
},
i: c && "replaceNode" == u ? c.parentNode : c
})
}
return m.M.wb(function(t) {
m.Ab(e, i, s, t, "replaceNode")
})
}, m.kd = function(e, n, a, s, l) {
function u(t, e) {
i(e, h), a.afterRender && a.afterRender(e, t), h = null
}
function c(t, i) {
h = l.createChildContext(t, a.as, function(t) {
t.$index = i
});
var n = o(e, t, h);
return r(null, "ignoreTargetNode", n, h, a)
}
var h;
return m.B(function() {
var e = m.a.c(n) || [];
"undefined" == typeof e.length && (e = [e]), e = m.a.Ka(e, function(e) {
return a.includeDestroyed || e === t || null === e || !m.a.c(e._destroy)
}), m.l.w(m.a.Bb, null, [s, e, c, a, u])
}, null, {
i: s
})
};
var s = m.a.e.I();
m.d.template = {
init: function(t, e) {
var i = m.a.c(e());
if ("string" == typeof i || i.name) m.f.xa(t);
else {
if ("nodes" in i) {
if (i = i.nodes || [], m.H(i)) throw Error('The "nodes" option must be a plain, non-observable array.')
} else i = m.f.childNodes(t);
i = m.a.jc(i), new m.v.qa(t).nodes(i)
}
return {
controlsDescendantBindings: !0
}
},
update: function(e, i, n, r, o) {
var a, l = i();
i = m.a.c(l), n = !0, r = null, "string" == typeof i ? i = {} : (l = i.name, "if" in i && (n = m.a.c(i["if"])), n && "ifnot" in i && (n = !m.a.c(i.ifnot)), a = m.a.c(i.data)), "foreach" in i ? r = m.kd(l || e, n && i.foreach || [], i, e, o) : n ? (o = "data" in i ? o.createChildContext(a, i.as) : o, r = m.Ab(l || e, o, i, e)) : m.f.xa(e), o = r, (a = m.a.e.get(e, s)) && "function" == typeof a.k && a.k(), m.a.e.set(e, s, o && o.ba() ? o : t)
}
}, m.h.ta.template = function(t) {
return t = m.h.yb(t), 1 == t.length && t[0].unknown || m.h.ad(t, "name") ? null : "This template engine does not support anonymous templates nested within its templates"
}, m.f.Z.template = !0
}(), m.b("setTemplateEngine", m.Db), m.b("renderTemplate", m.Ab), m.a.dc = function(t, e, i) {
if (t.length && e.length) {
var n, r, o, a, s;
for (n = r = 0;
(!i || n < i) && (a = t[r]); ++r) {
for (o = 0; s = e[o]; ++o) if (a.value === s.value) {
a.moved = s.index, s.moved = a.index, e.splice(o, 1), n = o = 0;
break
}
n += o
}
}
}, m.a.ib = function() {
function t(t, e, i, n, r) {
var o, a, s, l, u, c = Math.min,
h = Math.max,
d = [],
p = t.length,
f = e.length,
g = f - p || 1,
v = p + f + 1;
for (o = 0; o <= p; o++) for (l = s, d.push(s = []), u = c(f, o + g), a = h(0, o - 1); a <= u; a++) s[a] = a ? o ? t[o - 1] === e[a - 1] ? l[a - 1] : c(l[a] || v, s[a - 1] || v) + 1 : a + 1 : o + 1;
for (c = [], h = [], g = [], o = p, a = f; o || a;) f = d[o][a] - 1, a && f === d[o][a - 1] ? h.push(c[c.length] = {
status: i,
value: e[--a],
index: a
}) : o && f === d[o - 1][a] ? g.push(c[c.length] = {
status: n,
value: t[--o],
index: o
}) : (--a, --o, r.sparse || c.push({
status: "retained",
value: e[a]
}));
return m.a.dc(g, h, !r.dontLimitMoves && 10 * p), c.reverse()
}
return function(e, i, n) {
return n = "boolean" == typeof n ? {
dontLimitMoves: n
} : n || {}, e = e || [], i = i || [], e.length < i.length ? t(e, i, "added", "deleted", n) : t(i, e, "deleted", "added", n)
}
}(), m.b("utils.compareArrays", m.a.ib), function() {
function e(e, i, n, r, o) {
var a = [],
s = m.B(function() {
var t = i(n, o, m.a.za(a, e)) || [];
0 < a.length && (m.a.qc(a, t), r && m.l.w(r, null, [n, t, o])), a.length = 0, m.a.ra(a, t)
}, null, {
i: e,
wa: function() {
return !m.a.Qb(a)
}
});
return {
ca: a,
B: s.ba() ? s : t
}
}
var i = m.a.e.I(),
n = m.a.e.I();
m.a.Bb = function(r, o, a, s, l) {
function u(t, e) {
w = d[e], _ !== e && (E[t] = w), w.qb(_++), m.a.za(w.ca, r), g.push(w), b.push(w)
}
function c(t, e) {
if (t) for (var i = 0, n = e.length; i < n; i++) e[i] && m.a.q(e[i].ca, function(n) {
t(n, i, e[i].ja)
})
}
o = o || [], s = s || {};
var h = m.a.e.get(r, i) === t,
d = m.a.e.get(r, i) || [],
p = m.a.fb(d, function(t) {
return t.ja
}),
f = m.a.ib(p, o, s.dontLimitMoves),
g = [],
v = 0,
_ = 0,
y = [],
b = [];
o = [];
for (var w, C, x, E = [], p = [], k = 0; C = f[k]; k++) switch (x = C.moved, C.status) {
case "deleted":
x === t && (w = d[v], w.B && (w.B.k(), w.B = t), m.a.za(w.ca, r).length && (s.beforeRemove && (g.push(w), b.push(w), w.ja === n ? w = null : o[k] = w), w && y.push.apply(y, w.ca))), v++;
break;
case "retained":
u(k, v++);
break;
case "added":
x !== t ? u(k, x) : (w = {
ja: C.value,
qb: m.N(_++)
}, g.push(w), b.push(w), h || (p[k] = w))
}
m.a.e.set(r, i, g), c(s.beforeMove, E), m.a.q(y, s.beforeRemove ? m.$ : m.removeNode);
for (var L, k = 0, h = m.f.firstChild(r); w = b[k]; k++) {
for (w.ca || m.a.extend(w, e(r, a, w.ja, l, w.qb)), v = 0; f = w.ca[v]; h = f.nextSibling, L = f, v++) f !== h && m.f.gc(r, f, L);
!w.Wc && l && (l(w.ja, w.ca, w.qb), w.Wc = !0)
}
for (c(s.beforeRemove, o), k = 0; k < o.length; ++k) o[k] && (o[k].ja = n);
c(s.afterMove, E), c(s.afterAdd, p)
}
}(), m.b("utils.setDomNodeChildrenFromArrayMapping", m.a.Bb), m.W = function() {
this.allowTemplateRewriting = !1
}, m.W.prototype = new m.O, m.W.prototype.renderTemplateSource = function(t, e, i, n) {
return (e = (9 > m.a.C ? 0 : t.nodes) ? t.nodes() : null) ? m.a.V(e.cloneNode(!0).childNodes) : (t = t.text(), m.a.ma(t, n))
}, m.W.sb = new m.W, m.Db(m.W.sb), m.b("nativeTemplateEngine", m.W), function() {
m.vb = function() {
var t = this.$c = function() {
if (!o || !o.tmpl) return 0;
try {
if (0 <= o.tmpl.tag.tmpl.open.toString().indexOf("__")) return 2
} catch (t) {}
return 1
}();
this.renderTemplateSource = function(e, i, r, a) {
if (a = a || n, r = r || {}, 2 > t) throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");
var s = e.data("precompiled");
return s || (s = e.text() || "", s = o.template(null, "{{ko_with $item.koBindingContext}}" + s + "{{/ko_with}}"), e.data("precompiled", s)), e = [i.$data], i = o.extend({
koBindingContext: i
}, r.templateOptions), i = o.tmpl(s, e, i), i.appendTo(a.createElement("div")), o.fragments = {}, i
}, this.createJavaScriptEvaluatorBlock = function(t) {
return "{{ko_code ((function() { return " + t + " })()) }}"
}, this.addTemplate = function(t, e) {
n.write("")
}, 0 < t && (o.tmpl.tag.ko_code = {
open: "__.push($1 || '');"
}, o.tmpl.tag.ko_with = {
open: "with($1) {",
close: "} "
})
}, m.vb.prototype = new m.O;
var t = new m.vb;
0 < t.$c && m.Db(t), m.b("jqueryTmplTemplateEngine", m.vb)
}()
})
}()
}(), !
function(t, n) {
"use strict";
function r(t, e) {
if (!t || "object" != typeof t) throw new Error("When calling ko.track, you must pass an object as the first parameter.");
var i;
return c(e) ? (e.deep = e.deep || !1, e.fields = e.fields || Object.getOwnPropertyNames(t), e.lazy = e.lazy || !1, u(t, e.fields, e)) : (i = e || Object.getOwnPropertyNames(t), u(t, i, {})), t
}
function o(t) {
return t.name ? t.name : (t.toString().trim().match(D) || [])[1]
}
function a(t) {
return t && "object" == typeof t && "Object" === o(t.constructor)
}
function s(t, e, i) {
var r = E.isObservable(t),
o = !r && Array.isArray(t),
a = r ? t : o ? E.observableArray(t) : E.observable(t);
return i[e] = function() {
return a
}, (o || r && "push" in a) && f(E, a), {
configurable: !0,
enumerable: !0,
get: a,
set: E.isWriteableObservable(a) ? a : n
}
}
function l(t, e, i) {
function n(t, e) {
return r ? e ? r(t) : r : Array.isArray(t) ? (r = E.observableArray(t), f(E, r), r) : r = E.observable(t)
}
if (E.isObservable(t)) return s(t, e, i);
var r;
return i[e] = function() {
return n(t)
}, {
configurable: !0,
enumerable: !0,
get: function() {
return n(t)()
},
set: function(t) {
n(t, !0)
}
}
}
function u(t, e, i) {
if (e.length) {
var n = h(t, !0),
r = {};
e.forEach(function(e) {
if (!(e in n) && Object.getOwnPropertyDescriptor(t, e).configurable !== !1) {
var o = t[e];
r[e] = (i.lazy ? l : s)(o, e, n), i.deep && a(o) && u(o, Object.keys(o), i)
}
}), Object.defineProperties(t, r)
}
}
function c(t) {
return !!t && "object" == typeof t && t.constructor === Object
}
function h(t, e) {
k || (k = P());
var i = k.get(t);
return !i && e && (i = {}, k.set(t, i)), i
}
function d(t, e) {
if (k) if (1 === arguments.length) k["delete"](t);
else {
var i = h(t, !1);
i && e.forEach(function(t) {
delete i[t]
})
}
}
function p(t, e, i) {
var n = this,
o = {
owner: t,
deferEvaluation: !0
};
if ("function" == typeof i) o.read = i;
else {
if ("value" in i) throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');
if ("function" != typeof i.get) throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');
o.read = i.get, o.write = i.set
}
return t[e] = n.computed(o), r.call(n, t, [e]), t
}
function f(t, e) {
var i = null;
t.computed(function() {
i && (i.dispose(), i = null);
var n = e();
n instanceof Array && (i = m(t, e, n))
})
}
function m(t, e, i) {
var n = g(t, i);
return n.subscribe(e)
}
function g(t, e) {
L || (L = P());
var i = L.get(e);
if (!i) {
i = new t.subscribable, L.set(e, i);
var n = {};
v(e, i, n), _(t, e, i, n)
}
return i
}
function v(t, e, i) {
["pop", "push", "reverse", "shift", "sort", "splice", "unshift"].forEach(function(n) {
var r = t[n];
t[n] = function() {
var t = r.apply(this, arguments);
return i.pause !== !0 && e.notifySubscribers(this), t
}
})
}
function _(t, e, i, n) {
["remove", "removeAll", "destroy", "destroyAll", "replace"].forEach(function(r) {
Object.defineProperty(e, r, {
enumerable: !1,
value: function() {
var o;
n.pause = !0;
try {
o = t.observableArray.fn[r].apply(t.observableArray(e), arguments)
} finally {
n.pause = !1
}
return i.notifySubscribers(e), o
}
})
})
}
function y(t, e) {
if (!t || "object" != typeof t) return null;
var i = h(t, !1);
return i && e in i ? i[e]() : null
}
function b(t, e) {
if (!t || "object" != typeof t) return !1;
var i = h(t, !1);
return !!i && e in i
}
function w(t, e) {
var i = y(t, e);
i && i.valueHasMutated()
}
function C(t) {
t.track = r, t.untrack = d, t.getObservable = y, t.valueHasMutated = w, t.defineProperty = p, t.es5 = {
getAllObservablesForObject: h,
notifyWhenPresentOrFutureArrayValuesMutate: f,
isTracked: b
}
}
function x() {
if ("object" == typeof exports && "object" == typeof module) {
E = e("knockout");
var n = e("../lib/weakmap");
C(E), P = function() {
return new n
}, module.exports = E
} else "function" == typeof i && i.amd ? i("KnockoutES5", ["knockout"], function(e) {
return E = e, C(e), P = function() {
return new t.WeakMap
}, e
}) : "ko" in t && (E = t.ko, C(t.ko), P = function() {
return new t.WeakMap
})
}
var E, k, L, P, D = /^function\s*([^\s(]+)/;
x()
}(this), void
function(t, e, i) {
function n(t, e, i) {
return "function" == typeof e && (i = e, e = r(i).replace(/_$/, "")), u(t, e, {
configurable: !0,
writable: !0,
value: i
})
}
function r(t) {
return "function" != typeof t ? "" : "_name" in t ? t._name : "name" in t ? t.name : c.call(t).match(p)[1]
}
function o(t, e) {
return e._name = t, e
}
function a(t) {
function e(e, r) {
return r || 2 === arguments.length ? n.set(e, r) : (r = n.get(e), r === i && (r = t(e), n.set(e, r))), r
}
var n = new m;
return t || (t = g), e
}
var s = Object.getOwnPropertyNames,
l = "object" == typeof window ? Object.getOwnPropertyNames(window) : [],
u = Object.defineProperty,
c = Function.prototype.toString,
h = Object.create,
d = Object.prototype.hasOwnProperty,
p = /^\n?function\s?(\w*)?_?\(/,
f = function() {
function t() {
var t = a(),
i = {};
this.unlock = function(n) {
var r = p(n);
if (d.call(r, t)) return r[t](i);
var o = h(null, e);
return u(r, t, {
value: function(t) {
return t === i ? o : void 0
}
}), o
}
}
var e = {
value: {
writable: !0,
value: i
}
},
r = h(null),
a = function() {
var t = Math.random().toString(36).slice(2);
return t in r ? a() : r[t] = t
},
c = a(),
p = function(t) {
if (d.call(t, c)) return t[c];
if (!Object.isExtensible(t)) throw new TypeError("Object must be extensible");
var e = h(null);
return u(t, c, {
value: e
}), e
};
return n(Object, o("getOwnPropertyNames", function(t) {
var e, i = Object(t);
if (i !== Window.prototype && "toString" in i && "[object Window]" === i.toString()) try {
e = s(t)
} catch (n) {
e = l
} else e = s(t);
return d.call(t, c) && e.splice(e.indexOf(c), 1), e
})), n(t.prototype, o("get", function(t) {
return this.unlock(t).value
})), n(t.prototype, o("set", function(t, e) {
this.unlock(t).value = e
})), t
}(),
m = function(a) {
function s(e) {
return this === t || null == this || this === s.prototype ? new s(e) : (m(this, new f), void v(this, e))
}
function l(t) {
p(t);
var n = g(this).get(t);
return n === e ? i : n
}
function u(t, n) {
p(t), g(this).set(t, n === i ? e : n)
}
function c(t) {
return p(t), g(this).get(t) !== i
}
function h(t) {
p(t);
var e = g(this),
n = e.get(t) !== i;
return e.set(t, i), n
}
function d() {
return g(this), "[object WeakMap]"
}
var p = function(t) {
if (null == t || "object" != typeof t && "function" != typeof t) throw new TypeError("Invalid WeakMap key")
},
m = function(t, e) {
var i = a.unlock(t);
if (i.value) throw new TypeError("Object is already a WeakMap");
i.value = e
},
g = function(t) {
var e = a.unlock(t).value;
if (!e) throw new TypeError("WeakMap is not generic");
return e
},
v = function(t, e) {
null !== e && "object" == typeof e && "function" == typeof e.forEach && e.forEach(function(i, n) {
i instanceof Array && 2 === i.length && u.call(t, e[n][0], e[n][1])
})
};
l._name = "get", u._name = "set", c._name = "has", d._name = "toString";
var _ = ("" + Object).split("Object"),
y = o("toString", function() {
return _[0] + r(this) + _[1]
});
n(y, y);
var b = {
__proto__: []
}
instanceof Array ?
function(t) {
t.__proto__ = y
} : function(t) {
n(t, y)
};
return b(s), [d, l, u, c, h].forEach(function(t) {
n(s.prototype, t), b(t)
}), s
}(new f),
g = Object.create ?
function() {
return Object.create(null)
} : function() {
return {}
};
"undefined" != typeof module ? module.exports = m : "undefined" != typeof exports ? exports.WeakMap = m : "WeakMap" in t || (t.WeakMap = m), m.createStorage = a, t.WeakMap && (t.WeakMap.createStorage = a)
}(function() {
return this
}()), !
function(t) {
if ("object" == typeof exports && "undefined" != typeof module) module.exports = t();
else if ("function" == typeof i && i.amd) i("markdown-it-sanitizer", [], t);
else {
var e;
e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, e.markdownitSanitizer = t()
}
}(function() {
return function t(i, n, r) {
function o(s, l) {
if (!n[s]) {
if (!i[s]) {
var u = "function" == typeof e && e;
if (!l && u) return u(s, !0);
if (a) return a(s, !0);
var c = new Error("Cannot find module '" + s + "'");
throw c.code = "MODULE_NOT_FOUND", c
}
var h = n[s] = {
exports: {}
};
i[s][0].call(h.exports, function(t) {
var e = i[s][1][t];
return o(e ? e : t)
}, h, h.exports, t, i, n, r)
}
return n[s].exports
}
for (var a = "function" == typeof e && e, s = 0; s < r.length; s++) o(r[s]);
return o
}({
1: [function(t, e, i) {
"use strict";
e.exports = function(t, e) {
function i(t) {
var e = a.match(t);
return e && 1 === e.length && 0 === e[0].index && e[0].lastIndex === t.length ? e[0].url : null
}
function n(t) {
var e = ']*)"(?:\\stitle="([^"<>]*)")?>',
n = RegExp(e, "i"),
r = ']*src="[^"<>]*"[^<>]*)\\s?\\/?>',
o = RegExp(r, "i");
return t = t.replace(/<[^<>]*>?/gi, function(t) {
var e, r, a, l, c;
if (/(^<->|^<-\s|^<3\s)/.test(t)) return t;
if (e = t.match(o)) {
var g = e[1];
if (r = i(g.match(/src="([^"<>]*)"/i)[1]), a = g.match(/alt="([^"<>]*)"/i), a = a && "undefined" != typeof a[1] ? a[1] : "", l = g.match(/title="([^"<>]*)"/i), l = l && "undefined" != typeof l[1] ? l[1] : "", r && /^https?:\/\//i.test(r)) return "" !== h ? '' : ''
}
return c = p.indexOf("a"), e = t.match(n), e && (l = "undefined" != typeof e[2] ? e[2] : "", r = i(e[1]), r && /^(?:https?:\/\/|ftp:\/\/|mailto:|xmpp:)/i.test(r)) ? (d = !0, f[c] += 1, '') : (e = /<\/a>/i.test(t)) ? (d = !0, f[c] -= 1, f[c] < 0 && (m[c] = !0), "") : (e = t.match(/<(br|hr)\s?\/?>/i)) ? "<" + e[1].toLowerCase() + ">" : (e = t.match(/<(\/?)(b|blockquote|code|em|h[1-6]|li|ol(?: start="\d+")?|p|pre|s|sub|sup|strong|ul)>/i), e && !/<\/ol start="\d+"/i.test(t) ? (d = !0, c = p.indexOf(e[2].toLowerCase().split(" ")[0]), "/" === e[1] ? f[c] -= 1 : f[c] += 1, f[c] < 0 && (m[c] = !0), "<" + e[1] + e[2].toLowerCase() + ">") : u === !0 ? "" : s(t))
})
}
function r(t) {
var e, i, r;
for (l = 0; l < p.length; l++) f[l] = 0;
for (l = 0; l < p.length; l++) m[l] = !1;
for (d = !1, i = 0; i < t.tokens.length; i++) if ("html_block" === t.tokens[i].type && (t.tokens[i].content = n(t.tokens[i].content)), "inline" === t.tokens[i].type) for (r = t.tokens[i].children, e = 0; e < r.length; e++)"html_inline" === r[e].type && (r[e].content = n(r[e].content))
}
function o(t) {
function e(t, e) {
var i, n;
return i = "a" === e ? RegExp(']*" title="[^"<>]*" target="_blank">', "g") : "ol" === e ? //g : RegExp("<" + e + ">", "g"), n = RegExp("" + e + ">", "g"), c === !0 ? (t = t.replace(i, ""), t = t.replace(n, "")) : (t = t.replace(i, function(t) {
return s(t)
}), t = t.replace(n, function(t) {
return s(t)
})), t
}
function i(t) {
var i;
for (i = 0; i < p.length; i++) m[i] === !0 && (t = e(t, p[i]));
return t
}
if (d !== !1) {
var n, r;
for (l = 0; l < p.length; l++) 0 !== f[l] && (m[l] = !0);
for (n = 0; n < t.tokens.length; n++) if ("html_block" !== t.tokens[n].type) {
if ("inline" === t.tokens[n].type) for (r = t.tokens[n].children, l = 0; l < r.length; l++)"html_inline" === r[l].type && (r[l].content = i(r[l].content))
} else t.tokens[n].content = i(t.tokens[n].content)
}
}
var a = t.linkify,
s = t.utils.escapeHtml;
e = e ? e : {};
var l, u = "undefined" != typeof e.removeUnknown && e.removeUnknown,
c = "undefined" != typeof e.removeUnbalanced && e.removeUnbalanced,
h = "undefined" != typeof e.imageClass ? e.imageClass : "",
d = !1,
p = ["a", "b", "blockquote", "code", "em", "h1", "h2", "h3", "h4", "h5", "h6", "li", "ol", "p", "pre", "s", "sub", "sup", "strong", "ul"],
f = new Array(p.length),
m = new Array(p.length);
for (l = 0; l < p.length; l++) f[l] = 0;
for (l = 0; l < p.length; l++) m[l] = !1;
t.core.ruler.after("linkify", "sanitize_inline", r), t.core.ruler.after("sanitize_inline", "sanitize_balance", o)
}
}, {}]
}, {}, [1])(1)
}), !
function(t) {
if ("object" == typeof exports && "undefined" != typeof module) module.exports = t();
else if ("function" == typeof i && i.amd) i("markdown-it", [], t);
else {
var e;
e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, e.markdownit = t()
}
}(function() {
var t;
return function i(t, n, r) {
function o(s, l) {
if (!n[s]) {
if (!t[s]) {
var u = "function" == typeof e && e;
if (!l && u) return u(s, !0);
if (a) return a(s, !0);
var c = new Error("Cannot find module '" + s + "'");
throw c.code = "MODULE_NOT_FOUND", c
}
var h = n[s] = {
exports: {}
};
t[s][0].call(h.exports, function(e) {
var i = t[s][1][e];
return o(i ? i : e)
}, h, h.exports, i, t, n, r)
}
return n[s].exports
}
for (var a = "function" == typeof e && e, s = 0; s < r.length; s++) o(r[s]);
return o
}({
1: [function(t, e, i) {
"use strict";
e.exports = t("entities/maps/entities.json")
}, {
"entities/maps/entities.json": 53
}],
2: [function(t, e, i) {
"use strict";
e.exports = ["address", "article", "aside", "base", "basefont", "blockquote", "body", "caption", "center", "col", "colgroup", "dd", "details", "dialog", "dir", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "head", "header", "hr", "html", "iframe", "legend", "li", "link", "main", "menu", "menuitem", "meta", "nav", "noframes", "ol", "optgroup", "option", "p", "param", "pre", "section", "source", "title", "summary", "table", "tbody", "td", "tfoot", "th", "thead", "title", "tr", "track", "ul"]
}, {}],
3: [function(t, e, i) {
"use strict";
var n = "[a-zA-Z_:][a-zA-Z0-9:._-]*",
r = "[^\"'=<>`\\x00-\\x20]+",
o = "'[^']*'",
a = '"[^"]*"',
s = "(?:" + r + "|" + o + "|" + a + ")",
l = "(?:\\s+" + n + "(?:\\s*=\\s*" + s + ")?)",
u = "<[A-Za-z][A-Za-z0-9\\-]*" + l + "*\\s*\\/?>",
c = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",
h = "|",
d = "<[?].*?[?]>",
p = "]*>",
f = "",
m = new RegExp("^(?:" + u + "|" + c + "|" + h + "|" + d + "|" + p + "|" + f + ")"),
g = new RegExp("^(?:" + u + "|" + c + ")");
e.exports.HTML_TAG_RE = m, e.exports.HTML_OPEN_CLOSE_TAG_RE = g
}, {}],
4: [function(t, e, i) {
"use strict";
function n(t) {
return Object.prototype.toString.call(t)
}
function r(t) {
return "[object String]" === n(t)
}
function o(t, e) {
return w.call(t, e)
}
function a(t) {
var e = Array.prototype.slice.call(arguments, 1);
return e.forEach(function(e) {
if (e) {
if ("object" != typeof e) throw new TypeError(e + "must be object");
Object.keys(e).forEach(function(i) {
t[i] = e[i]
})
}
}), t
}
function s(t, e, i) {
return [].concat(t.slice(0, e), i, t.slice(e + 1))
}
function l(t) {
return !(t >= 55296 && t <= 57343 || t >= 64976 && t <= 65007 || 65535 === (65535 & t) || 65534 === (65535 & t) || t >= 0 && t <= 8 || 11 === t || t >= 14 && t <= 31 || t >= 127 && t <= 159 || t > 1114111)
}
function u(t) {
if (t > 65535) {
t -= 65536;
var e = 55296 + (t >> 10),
i = 56320 + (1023 & t);
return String.fromCharCode(e, i)
}
return String.fromCharCode(t)
}
function c(t, e) {
var i = 0;
return o(L, e) ? L[e] : 35 === e.charCodeAt(0) && k.test(e) && (i = "x" === e[1].toLowerCase() ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), l(i)) ? u(i) : t
}
function h(t) {
return t.indexOf("\\") < 0 ? t : t.replace(C, "$1")
}
function d(t) {
return t.indexOf("\\") < 0 && t.indexOf("&") < 0 ? t : t.replace(E, function(t, e, i) {
return e ? e : c(t, i)
})
}
function p(t) {
return T[t]
}
function f(t) {
return P.test(t) ? t.replace(D, p) : t
}
function m(t) {
return t.replace(S, "\\$&")
}
function g(t) {
switch (t) {
case 9:
case 32:
return !0
}
return !1
}
function v(t) {
if (t >= 8192 && t <= 8202) return !0;
switch (t) {
case 9:
case 10:
case 11:
case 12:
case 13:
case 32:
case 160:
case 5760:
case 8239:
case 8287:
case 12288:
return !0
}
return !1
}
function _(t) {
return M.test(t)
}
function y(t) {
switch (t) {
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 58:
case 59:
case 60:
case 61:
case 62:
case 63:
case 64:
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 123:
case 124:
case 125:
case 126:
return !0;
default:
return !1
}
}
function b(t) {
return t.trim().replace(/\s+/g, " ").toUpperCase()
}
var w = Object.prototype.hasOwnProperty,
C = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,
x = /&([a-z#][a-z0-9]{1,31});/gi,
E = new RegExp(C.source + "|" + x.source, "gi"),
k = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,
L = t("./entities"),
P = /[&<>"]/,
D = /[&<>"]/g,
T = {
"&": "&",
"<": "<",
">": ">",
'"': """
},
S = /[.?*+^$[\]\\(){}|-]/g,
M = t("uc.micro/categories/P/regex");
i.lib = {}, i.lib.mdurl = t("mdurl"), i.lib.ucmicro = t("uc.micro"), i.assign = a, i.isString = r, i.has = o, i.unescapeMd = h, i.unescapeAll = d, i.isValidEntityCode = l, i.fromCodePoint = u, i.escapeHtml = f, i.arrayReplaceAt = s, i.isSpace = g, i.isWhiteSpace = v, i.isMdAsciiPunct = y, i.isPunctChar = _, i.escapeRE = m, i.normalizeReference = b
}, {
"./entities": 1,
mdurl: 59,
"uc.micro": 65,
"uc.micro/categories/P/regex": 63
}],
5: [function(t, e, i) {
"use strict";
i.parseLinkLabel = t("./parse_link_label"), i.parseLinkDestination = t("./parse_link_destination"), i.parseLinkTitle = t("./parse_link_title")
}, {
"./parse_link_destination": 6,
"./parse_link_label": 7,
"./parse_link_title": 8
}],
6: [function(t, e, i) {
"use strict";
var n = t("../common/utils").isSpace,
r = t("../common/utils").unescapeAll;
e.exports = function(t, e, i) {
var o, a, s = 0,
l = e,
u = {
ok: !1,
pos: 0,
lines: 0,
str: ""
};
if (60 === t.charCodeAt(e)) {
for (e++; e < i;) {
if (o = t.charCodeAt(e), 10 === o || n(o)) return u;
if (62 === o) return u.pos = e + 1, u.str = r(t.slice(l + 1, e)), u.ok = !0, u;
92 === o && e + 1 < i ? e += 2 : e++
}
return u
}
for (a = 0; e < i && (o = t.charCodeAt(e), 32 !== o) && !(o < 32 || 127 === o);) if (92 === o && e + 1 < i) e += 2;
else {
if (40 === o && (a++, a > 1)) break;
if (41 === o && (a--, a < 0)) break;
e++
}
return l === e ? u : (u.str = r(t.slice(l, e)), u.lines = s, u.pos = e, u.ok = !0, u)
}
}, {
"../common/utils": 4
}],
7: [function(t, e, i) {
"use strict";
e.exports = function(t, e, i) {
var n, r, o, a, s = -1,
l = t.posMax,
u = t.pos;
for (t.pos = e + 1, n = 1; t.pos < l;) {
if (o = t.src.charCodeAt(t.pos), 93 === o && (n--, 0 === n)) {
r = !0;
break
}
if (a = t.pos, t.md.inline.skipToken(t), 91 === o) if (a === t.pos - 1) n++;
else if (i) return t.pos = u, -1
}
return r && (s = t.pos), t.pos = u, s
}
}, {}],
8: [function(t, e, i) {
"use strict";
var n = t("../common/utils").unescapeAll;
e.exports = function(t, e, i) {
var r, o, a = 0,
s = e,
l = {
ok: !1,
pos: 0,
lines: 0,
str: ""
};
if (e >= i) return l;
if (o = t.charCodeAt(e), 34 !== o && 39 !== o && 40 !== o) return l;
for (e++, 40 === o && (o = 41); e < i;) {
if (r = t.charCodeAt(e), r === o) return l.pos = e + 1, l.lines = a, l.str = n(t.slice(s + 1, e)), l.ok = !0, l;
10 === r ? a++ : 92 === r && e + 1 < i && (e++, 10 === t.charCodeAt(e) && a++), e++
}
return l
}
}, {
"../common/utils": 4
}],
9: [function(t, e, i) {
"use strict";
function n(t) {
var e = t.trim().toLowerCase();
return !v.test(e) || !! _.test(e)
}
function r(t) {
var e = f.parse(t, !0);
if (e.hostname && (!e.protocol || y.indexOf(e.protocol) >= 0)) try {
e.hostname = m.toASCII(e.hostname)
} catch (i) {}
return f.encode(f.format(e))
}
function o(t) {
var e = f.parse(t, !0);
if (e.hostname && (!e.protocol || y.indexOf(e.protocol) >= 0)) try {
e.hostname = m.toUnicode(e.hostname)
} catch (i) {}
return f.decode(f.format(e))
}
function a(t, e) {
return this instanceof a ? (e || s.isString(t) || (e = t || {}, t = "default"), this.inline = new d, this.block = new h, this.core = new c, this.renderer = new u, this.linkify = new p, this.validateLink = n, this.normalizeLink = r, this.normalizeLinkText = o, this.utils = s, this.helpers = l, this.options = {}, this.configure(t), void(e && this.set(e))) : new a(t, e)
}
var s = t("./common/utils"),
l = t("./helpers"),
u = t("./renderer"),
c = t("./parser_core"),
h = t("./parser_block"),
d = t("./parser_inline"),
p = t("linkify-it"),
f = t("mdurl"),
m = t("punycode"),
g = {
"default": t("./presets/default"),
zero: t("./presets/zero"),
commonmark: t("./presets/commonmark")
},
v = /^(vbscript|javascript|file|data):/,
_ = /^data:image\/(gif|png|jpeg|webp);/,
y = ["http:", "https:", "mailto:"];
a.prototype.set = function(t) {
return s.assign(this.options, t), this
}, a.prototype.configure = function(t) {
var e, i = this;
if (s.isString(t) && (e = t, t = g[e], !t)) throw new Error('Wrong `markdown-it` preset "' + e + '", check name');
if (!t) throw new Error("Wrong `markdown-it` preset, can't be empty");
return t.options && i.set(t.options), t.components && Object.keys(t.components).forEach(function(e) {
t.components[e].rules && i[e].ruler.enableOnly(t.components[e].rules), t.components[e].rules2 && i[e].ruler2.enableOnly(t.components[e].rules2)
}), this
}, a.prototype.enable = function(t, e) {
var i = [];
Array.isArray(t) || (t = [t]), ["core", "block", "inline"].forEach(function(e) {
i = i.concat(this[e].ruler.enable(t, !0))
}, this), i = i.concat(this.inline.ruler2.enable(t, !0));
var n = t.filter(function(t) {
return i.indexOf(t) < 0
});
if (n.length && !e) throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + n);
return this
}, a.prototype.disable = function(t, e) {
var i = [];
Array.isArray(t) || (t = [t]), ["core", "block", "inline"].forEach(function(e) {
i = i.concat(this[e].ruler.disable(t, !0))
}, this), i = i.concat(this.inline.ruler2.disable(t, !0));
var n = t.filter(function(t) {
return i.indexOf(t) < 0
});
if (n.length && !e) throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + n);
return this
}, a.prototype.use = function(t) {
var e = [this].concat(Array.prototype.slice.call(arguments, 1));
return t.apply(t, e), this
}, a.prototype.parse = function(t, e) {
var i = new this.core.State(t, this, e);
return this.core.process(i), i.tokens
}, a.prototype.render = function(t, e) {
return e = e || {}, this.renderer.render(this.parse(t, e), this.options, e)
}, a.prototype.parseInline = function(t, e) {
var i = new this.core.State(t, this, e);
return i.inlineMode = !0, this.core.process(i), i.tokens
}, a.prototype.renderInline = function(t, e) {
return e = e || {}, this.renderer.render(this.parseInline(t, e), this.options, e)
}, e.exports = a
}, {
"./common/utils": 4,
"./helpers": 5,
"./parser_block": 10,
"./parser_core": 11,
"./parser_inline": 12,
"./presets/commonmark": 13,
"./presets/default": 14,
"./presets/zero": 15,
"./renderer": 16,
"linkify-it": 54,
mdurl: 59,
punycode: 52
}],
10: [function(t, e, i) {
"use strict";
function n() {
this.ruler = new r;
for (var t = 0; t < o.length; t++) this.ruler.push(o[t][0], o[t][1], {
alt: (o[t][2] || []).slice()
})
}
var r = t("./ruler"),
o = [
["table", t("./rules_block/table"), ["paragraph", "reference"]],
["code", t("./rules_block/code")],
["fence", t("./rules_block/fence"), ["paragraph", "reference", "blockquote", "list"]],
["blockquote", t("./rules_block/blockquote"), ["paragraph", "reference", "list"]],
["hr", t("./rules_block/hr"), ["paragraph", "reference", "blockquote", "list"]],
["list", t("./rules_block/list"), ["paragraph", "reference", "blockquote"]],
["reference", t("./rules_block/reference")],
["heading", t("./rules_block/heading"), ["paragraph", "reference", "blockquote"]],
["lheading", t("./rules_block/lheading")],
["html_block", t("./rules_block/html_block"), ["paragraph", "reference", "blockquote"]],
["paragraph", t("./rules_block/paragraph")]
];
n.prototype.tokenize = function(t, e, i) {
for (var n, r, o = this.ruler.getRules(""), a = o.length, s = e, l = !1, u = t.md.options.maxNesting; s < i && (t.line = s = t.skipEmptyLines(s), !(s >= i)) && !(t.sCount[s] < t.blkIndent);) {
if (t.level >= u) {
t.line = i;
break
}
for (r = 0; r < a && !(n = o[r](t, s, i, !1)); r++);
if (t.tight = !l, t.isEmpty(t.line - 1) && (l = !0), s = t.line, s < i && t.isEmpty(s)) {
if (l = !0, s++, s < i && "list" === t.parentType && t.isEmpty(s)) break;
t.line = s
}
}
}, n.prototype.parse = function(t, e, i, n) {
var r;
t && (r = new this.State(t, e, i, n), this.tokenize(r, r.line, r.lineMax))
}, n.prototype.State = t("./rules_block/state_block"), e.exports = n
}, {
"./ruler": 17,
"./rules_block/blockquote": 18,
"./rules_block/code": 19,
"./rules_block/fence": 20,
"./rules_block/heading": 21,
"./rules_block/hr": 22,
"./rules_block/html_block": 23,
"./rules_block/lheading": 24,
"./rules_block/list": 25,
"./rules_block/paragraph": 26,
"./rules_block/reference": 27,
"./rules_block/state_block": 28,
"./rules_block/table": 29
}],
11: [function(t, e, i) {
"use strict";
function n() {
this.ruler = new r;
for (var t = 0; t < o.length; t++) this.ruler.push(o[t][0], o[t][1])
}
var r = t("./ruler"),
o = [
["normalize", t("./rules_core/normalize")],
["block", t("./rules_core/block")],
["inline", t("./rules_core/inline")],
["linkify", t("./rules_core/linkify")],
["replacements", t("./rules_core/replacements")],
["smartquotes", t("./rules_core/smartquotes")]
];
n.prototype.process = function(t) {
var e, i, n;
for (n = this.ruler.getRules(""), e = 0, i = n.length; e < i; e++) n[e](t)
}, n.prototype.State = t("./rules_core/state_core"), e.exports = n
}, {
"./ruler": 17,
"./rules_core/block": 30,
"./rules_core/inline": 31,
"./rules_core/linkify": 32,
"./rules_core/normalize": 33,
"./rules_core/replacements": 34,
"./rules_core/smartquotes": 35,
"./rules_core/state_core": 36
}],
12: [function(t, e, i) {
"use strict";
function n() {
var t;
for (this.ruler = new r, t = 0; t < o.length; t++) this.ruler.push(o[t][0], o[t][1]);
for (this.ruler2 = new r, t = 0; t < a.length; t++) this.ruler2.push(a[t][0], a[t][1])
}
var r = t("./ruler"),
o = [
["text", t("./rules_inline/text")],
["newline", t("./rules_inline/newline")],
["escape", t("./rules_inline/escape")],
["backticks", t("./rules_inline/backticks")],
["strikethrough", t("./rules_inline/strikethrough").tokenize],
["emphasis", t("./rules_inline/emphasis").tokenize],
["link", t("./rules_inline/link")],
["image", t("./rules_inline/image")],
["autolink", t("./rules_inline/autolink")],
["html_inline", t("./rules_inline/html_inline")],
["entity", t("./rules_inline/entity")]
],
a = [
["balance_pairs", t("./rules_inline/balance_pairs")],
["strikethrough", t("./rules_inline/strikethrough").postProcess],
["emphasis", t("./rules_inline/emphasis").postProcess],
["text_collapse", t("./rules_inline/text_collapse")]
];
n.prototype.skipToken = function(t) {
var e, i, n = t.pos,
r = this.ruler.getRules(""),
o = r.length,
a = t.md.options.maxNesting,
s = t.cache;
if ("undefined" != typeof s[n]) return void(t.pos = s[n]);
if (t.level < a) for (i = 0; i < o && (t.level++, e = r[i](t, !0), t.level--, !e); i++);
else t.pos = t.posMax;
e || t.pos++, s[n] = t.pos
}, n.prototype.tokenize = function(t) {
for (var e, i, n = this.ruler.getRules(""), r = n.length, o = t.posMax, a = t.md.options.maxNesting; t.pos < o;) {
if (t.level < a) for (i = 0; i < r && !(e = n[i](t, !1)); i++);
if (e) {
if (t.pos >= o) break
} else t.pending += t.src[t.pos++]
}
t.pending && t.pushPending()
}, n.prototype.parse = function(t, e, i, n) {
var r, o, a, s = new this.State(t, e, i, n);
for (this.tokenize(s), o = this.ruler2.getRules(""), a = o.length, r = 0; r < a; r++) o[r](s)
}, n.prototype.State = t("./rules_inline/state_inline"), e.exports = n
}, {
"./ruler": 17,
"./rules_inline/autolink": 37,
"./rules_inline/backticks": 38,
"./rules_inline/balance_pairs": 39,
"./rules_inline/emphasis": 40,
"./rules_inline/entity": 41,
"./rules_inline/escape": 42,
"./rules_inline/html_inline": 43,
"./rules_inline/image": 44,
"./rules_inline/link": 45,
"./rules_inline/newline": 46,
"./rules_inline/state_inline": 47,
"./rules_inline/strikethrough": 48,
"./rules_inline/text": 49,
"./rules_inline/text_collapse": 50
}],
13: [function(t, e, i) {
"use strict";
e.exports = {
options: {
html: !0,
xhtmlOut: !0,
breaks: !1,
langPrefix: "language-",
linkify: !1,
typographer: !1,
quotes: "“”‘’",
highlight: null,
maxNesting: 20
},
components: {
core: {
rules: ["normalize", "block", "inline"]
},
block: {
rules: ["blockquote", "code", "fence", "heading", "hr", "html_block", "lheading", "list", "reference", "paragraph"]
},
inline: {
rules: ["autolink", "backticks", "emphasis", "entity", "escape", "html_inline", "image", "link", "newline", "text"],
rules2: ["balance_pairs", "emphasis", "text_collapse"]
}
}
}
}, {}],
14: [function(t, e, i) {
"use strict";
e.exports = {
options: {
html: !1,
xhtmlOut: !1,
breaks: !1,
langPrefix: "language-",
linkify: !1,
typographer: !1,
quotes: "“”‘’",
highlight: null,
maxNesting: 100
},
components: {
core: {},
block: {},
inline: {}
}
}
}, {}],
15: [function(t, e, i) {
"use strict";
e.exports = {
options: {
html: !1,
xhtmlOut: !1,
breaks: !1,
langPrefix: "language-",
linkify: !1,
typographer: !1,
quotes: "“”‘’",
highlight: null,
maxNesting: 20
},
components: {
core: {
rules: ["normalize", "block", "inline"]
},
block: {
rules: ["paragraph"]
},
inline: {
rules: ["text"],
rules2: ["balance_pairs", "text_collapse"]
}
}
}
}, {}],
16: [function(t, e, i) {
"use strict";
function n() {
this.rules = r({}, s)
}
var r = t("./common/utils").assign,
o = t("./common/utils").unescapeAll,
a = t("./common/utils").escapeHtml,
s = {};
s.code_inline = function(t, e, i, n, r) {
var o = t[e],
s = r.renderAttrs(o);
return "" + a(t[e].content) + ""
}, s.code_block = function(t, e, i, n, r) {
var o = t[e],
s = r.renderAttrs(o);
return "
';
s(e, t, this)
}, h.create = function(t) {
var e = new h(t);
return e.show(t.container), e
};
var d = new i,
p = [1, 2, 3, 5, 10, 20, 30, 50, 100, 200, 300, 500, 1e3, 2e3, 3e3, 5e3, 1e4, 2e4, 3e4, 5e4, 1e5, 2e5, 3e5, 5e5, 1e6, 2e6, 3e6, 5e6, 1e7, 2e7, 3e7, 5e7];
return h
}), i("ViewModels/UserInterfaceControl", ["Cesium/Core/defined", "Cesium/Core/defineProperties", "Cesium/Core/DeveloperError", "KnockoutES5"], function(t, e, i, n) {
"use strict";
var r = function(e) {
if (!t(e)) throw new i("terria is required");
this._terria = e, this.name = "Unnamed Control", this.text = void 0, this.svgIcon = void 0, this.svgHeight = void 0, this.svgWidth = void 0, this.cssClass = void 0, this.isActive = !1, n.track(this, ["name", "svgIcon", "svgHeight", "svgWidth", "cssClass", "isActive"])
};
return e(r.prototype, {
terria: {
get: function() {
return this._terria
}
},
hasText: {
get: function() {
return t(this.text) && "string" == typeof this.text
}
}
}), r.prototype.activate = function() {
throw new i("activate must be implemented in the derived class.")
}, r
}), i("ViewModels/NavigationControl", ["ViewModels/UserInterfaceControl"], function(t) {
"use strict";
var e = function(e) {
t.apply(this, arguments)
};
return e.prototype = Object.create(t.prototype), e
}), i("SvgPaths/svgReset", [], function() {
"use strict";
return "M 7.5,0 C 3.375,0 0,3.375 0,7.5 0,11.625 3.375,15 7.5,15 c 3.46875,0 6.375,-2.4375 7.21875,-5.625 l -1.96875,0 C 12,11.53125 9.9375,13.125 7.5,13.125 4.40625,13.125 1.875,10.59375 1.875,7.5 1.875,4.40625 4.40625,1.875 7.5,1.875 c 1.59375,0 2.90625,0.65625 3.9375,1.6875 l -3,3 6.5625,0 L 15,0 12.75,2.25 C 11.4375,0.84375 9.5625,0 7.5,0 z"
}), i("ViewModels/ResetViewNavigationControl", ["Cesium/Core/defined", "Cesium/Scene/Camera", "Cesium/Core/Rectangle", "Cesium/Core/Cartographic", "ViewModels/NavigationControl", "SvgPaths/svgReset"], function(t, e, i, n, r, o) {
"use strict";
var a = function(t) {
r.apply(this, arguments), this.name = "Reset View", this.svgIcon = o, this.svgHeight = 15, this.svgWidth = 15, this.cssClass = "navigation-control-icon-reset"
};
return a.prototype = Object.create(r.prototype), a.prototype.resetView = function() {
var r = this.terria.scene,
o = r.screenSpaceCameraController;
if (o.enableInputs) {
this.isActive = !0;
var a = r.camera;
if (t(this.terria.trackedEntity)) {
var s = this.terria.trackedEntity;
this.terria.trackedEntity = void 0, this.terria.trackedEntity = s
} else if (this.terria.options.defaultResetView) {
if (this.terria.options.defaultResetView && this.terria.options.defaultResetView instanceof n) a.flyTo({
destination: r.globe.ellipsoid.cartographicToCartesian(this.terria.options.defaultResetView)
});
else if (this.terria.options.defaultResetView && this.terria.options.defaultResetView instanceof i) try {
i.validate(this.terria.options.defaultResetView), a.flyTo({
destination: this.terria.options.defaultResetView
})
} catch (l) {
console.log("Cesium-navigation/ResetViewNavigationControl: options.defaultResetView Cesium rectangle is invalid!")
}
} else "function" == typeof a.flyHome ? a.flyHome(1) : a.flyTo({
destination: e.DEFAULT_VIEW_RECTANGLE,
duration: 1
});
this.isActive = !1
}
}, a.prototype.activate = function() {
this.resetView()
}, a
}), i("Core/Utils", ["Cesium/Core/defined", "Cesium/Core/Ray", "Cesium/Core/Cartesian3", "Cesium/Core/Cartographic", "Cesium/Core/ReferenceFrame", "Cesium/Scene/SceneMode"], function(t, e, i, n, r, o) {
"use strict";
var a = {},
s = new n,
l = new e;
return a.getCameraFocus = function(e, n, r) {
var a = e.scene,
u = a.camera;
if (a.mode != o.MORPHING && (t(r) || (r = new i), t(e.trackedEntity) ? r = e.trackedEntity.position.getValue(e.clock.currentTime, r) : (l.origin = u.positionWC, l.direction = u.directionWC, r = a.globe.pick(l, a, r)), t(r))) return a.mode == o.SCENE2D || a.mode == o.COLUMBUS_VIEW ? (r = u.worldToCameraCoordinatesPoint(r, r), n && (r = a.globe.ellipsoid.cartographicToCartesian(a.mapProjection.unproject(r, s), r))) : n || (r = u.worldToCameraCoordinatesPoint(r, r)), r
}, a
}), i("ViewModels/ZoomNavigationControl", ["Cesium/Core/defined", "Cesium/Core/Ray", "Cesium/Core/IntersectionTests", "Cesium/Core/Cartesian3", "Cesium/Scene/SceneMode", "ViewModels/NavigationControl", "Core/Utils"], function(t, e, i, n, r, o, a) {
"use strict";
var s = function(t, e) {
o.apply(this, arguments), this.name = "Zoom " + (e ? "In" : "Out"), this.text = e ? "+" : "-", this.cssClass = "navigation-control-icon-zoom-" + (e ? "in" : "out"), this.relativeAmount = 2, e && (this.relativeAmount = 1 / this.relativeAmount)
};
s.prototype.relativeAmount = 1, s.prototype = Object.create(o.prototype), s.prototype.activate = function() {
this.zoom(this.relativeAmount)
};
var l = new n;
return s.prototype.zoom = function(o) {
if (this.isActive = !0, t(this.terria)) {
var s = this.terria.scene,
u = s.screenSpaceCameraController;
if (!u.enableInputs || !u.enableZoom) return;
var c, h = s.camera;
switch (s.mode) {
case r.MORPHING:
break;
case r.SCENE2D:
h.zoomIn(h.positionCartographic.height * (1 - this.relativeAmount));
break;
default:
var d;
if (d = t(this.terria.trackedEntity) ? new n : a.getCameraFocus(this.terria, !1), t(d)) c = {
direction: h.direction,
up: h.up
};
else {
var p = new e(h.worldToCameraCoordinatesPoint(s.globe.ellipsoid.cartographicToCartesian(h.positionCartographic)), h.directionWC);
d = i.grazingAltitudeLocation(p, s.globe.ellipsoid), c = {
heading: h.heading,
pitch: h.pitch,
roll: h.roll
}
}
var f = n.subtract(h.position, d, l),
m = n.multiplyByScalar(f, o, f),
g = n.add(d, m, d);
t(this.terria.trackedEntity) || s.mode == r.COLUMBUS_VIEW ? h.position = g : h.flyTo({
destination: g,
orientation: c,
duration: .5,
convert: !1
})
}
}
this.isActive = !1
}, s
}), i("SvgPaths/svgCompassOuterRing", [], function() {
"use strict";
return "m 66.5625,0 0,15.15625 3.71875,0 0,-10.40625 5.5,10.40625 4.375,0 0,-15.15625 -3.71875,0 0,10.40625 L 70.9375,0 66.5625,0 z M 72.5,20.21875 c -28.867432,0 -52.28125,23.407738 -52.28125,52.28125 0,28.87351 23.413818,52.3125 52.28125,52.3125 28.86743,0 52.28125,-23.43899 52.28125,-52.3125 0,-28.873512 -23.41382,-52.28125 -52.28125,-52.28125 z m 0,1.75 c 13.842515,0 26.368948,5.558092 35.5,14.5625 l -11.03125,11 0.625,0.625 11.03125,-11 c 8.9199,9.108762 14.4375,21.579143 14.4375,35.34375 0,13.764606 -5.5176,26.22729 -14.4375,35.34375 l -11.03125,-11 -0.625,0.625 11.03125,11 c -9.130866,9.01087 -21.658601,14.59375 -35.5,14.59375 -13.801622,0 -26.321058,-5.53481 -35.4375,-14.5 l 11.125,-11.09375 c 6.277989,6.12179 14.857796,9.90625 24.3125,9.90625 19.241896,0 34.875,-15.629154 34.875,-34.875 0,-19.245847 -15.633104,-34.84375 -34.875,-34.84375 -9.454704,0 -18.034511,3.760884 -24.3125,9.875 L 37.0625,36.4375 C 46.179178,27.478444 58.696991,21.96875 72.5,21.96875 z m -0.875,0.84375 0,13.9375 1.75,0 0,-13.9375 -1.75,0 z M 36.46875,37.0625 47.5625,48.15625 C 41.429794,54.436565 37.65625,63.027539 37.65625,72.5 c 0,9.472461 3.773544,18.055746 9.90625,24.34375 L 36.46875,107.9375 c -8.96721,-9.1247 -14.5,-21.624886 -14.5,-35.4375 0,-13.812615 5.53279,-26.320526 14.5,-35.4375 z M 72.5,39.40625 c 18.297686,0 33.125,14.791695 33.125,33.09375 0,18.302054 -14.827314,33.125 -33.125,33.125 -18.297687,0 -33.09375,-14.822946 -33.09375,-33.125 0,-18.302056 14.796063,-33.09375 33.09375,-33.09375 z M 22.84375,71.625 l 0,1.75 13.96875,0 0,-1.75 -13.96875,0 z m 85.5625,0 0,1.75 14,0 0,-1.75 -14,0 z M 71.75,108.25 l 0,13.9375 1.71875,0 0,-13.9375 -1.71875,0 z"
}), i("SvgPaths/svgCompassGyro", [], function() {
"use strict";
return "m 72.71875,54.375 c -0.476702,0 -0.908208,0.245402 -1.21875,0.5625 -0.310542,0.317098 -0.551189,0.701933 -0.78125,1.1875 -0.172018,0.363062 -0.319101,0.791709 -0.46875,1.25 -6.91615,1.075544 -12.313231,6.656514 -13,13.625 -0.327516,0.117495 -0.661877,0.244642 -0.9375,0.375 -0.485434,0.22959 -0.901634,0.471239 -1.21875,0.78125 -0.317116,0.310011 -0.5625,0.742111 -0.5625,1.21875 l 0.03125,0 c 0,0.476639 0.245384,0.877489 0.5625,1.1875 0.317116,0.310011 0.702066,0.58291 1.1875,0.8125 0.35554,0.168155 0.771616,0.32165 1.21875,0.46875 1.370803,6.10004 6.420817,10.834127 12.71875,11.8125 0.146999,0.447079 0.30025,0.863113 0.46875,1.21875 0.230061,0.485567 0.470708,0.870402 0.78125,1.1875 0.310542,0.317098 0.742048,0.5625 1.21875,0.5625 0.476702,0 0.876958,-0.245402 1.1875,-0.5625 0.310542,-0.317098 0.582439,-0.701933 0.8125,-1.1875 0.172018,-0.363062 0.319101,-0.791709 0.46875,-1.25 6.249045,-1.017063 11.256351,-5.7184 12.625,-11.78125 0.447134,-0.1471 0.86321,-0.300595 1.21875,-0.46875 0.485434,-0.22959 0.901633,-0.502489 1.21875,-0.8125 0.317117,-0.310011 0.5625,-0.710861 0.5625,-1.1875 l -0.03125,0 c 0,-0.476639 -0.245383,-0.908739 -0.5625,-1.21875 C 89.901633,71.846239 89.516684,71.60459 89.03125,71.375 88.755626,71.244642 88.456123,71.117495 88.125,71 87.439949,64.078341 82.072807,58.503735 75.21875,57.375 c -0.15044,-0.461669 -0.326927,-0.884711 -0.5,-1.25 -0.230061,-0.485567 -0.501958,-0.870402 -0.8125,-1.1875 -0.310542,-0.317098 -0.710798,-0.5625 -1.1875,-0.5625 z m -0.0625,1.40625 c 0.03595,-0.01283 0.05968,0 0.0625,0 0.0056,0 0.04321,-0.02233 0.1875,0.125 0.144288,0.147334 0.34336,0.447188 0.53125,0.84375 0.06385,0.134761 0.123901,0.309578 0.1875,0.46875 -0.320353,-0.01957 -0.643524,-0.0625 -0.96875,-0.0625 -0.289073,0 -0.558569,0.04702 -0.84375,0.0625 C 71.8761,57.059578 71.936151,56.884761 72,56.75 c 0.18789,-0.396562 0.355712,-0.696416 0.5,-0.84375 0.07214,-0.07367 0.120304,-0.112167 0.15625,-0.125 z m 0,2.40625 c 0.448007,0 0.906196,0.05436 1.34375,0.09375 0.177011,0.592256 0.347655,1.271044 0.5,2.03125 0.475097,2.370753 0.807525,5.463852 0.9375,8.9375 -0.906869,-0.02852 -1.834463,-0.0625 -2.78125,-0.0625 -0.92298,0 -1.802327,0.03537 -2.6875,0.0625 0.138529,-3.473648 0.493653,-6.566747 0.96875,-8.9375 0.154684,-0.771878 0.320019,-1.463985 0.5,-2.0625 0.405568,-0.03377 0.804291,-0.0625 1.21875,-0.0625 z m -2.71875,0.28125 c -0.129732,0.498888 -0.259782,0.987558 -0.375,1.5625 -0.498513,2.487595 -0.838088,5.693299 -0.96875,9.25 -3.21363,0.15162 -6.119596,0.480068 -8.40625,0.9375 -0.682394,0.136509 -1.275579,0.279657 -1.84375,0.4375 0.799068,-6.135482 5.504716,-11.036454 11.59375,-12.1875 z M 75.5,58.5 c 6.043169,1.18408 10.705093,6.052712 11.5,12.15625 -0.569435,-0.155806 -1.200273,-0.302525 -1.875,-0.4375 -2.262525,-0.452605 -5.108535,-0.783809 -8.28125,-0.9375 -0.130662,-3.556701 -0.470237,-6.762405 -0.96875,-9.25 C 75.761959,59.467174 75.626981,58.990925 75.5,58.5 z m -2.84375,12.09375 c 0.959338,0 1.895843,0.03282 2.8125,0.0625 C 75.48165,71.267751 75.5,71.871028 75.5,72.5 c 0,1.228616 -0.01449,2.438313 -0.0625,3.59375 -0.897358,0.0284 -1.811972,0.0625 -2.75,0.0625 -0.927373,0 -1.831062,-0.03473 -2.71875,-0.0625 -0.05109,-1.155437 -0.0625,-2.365134 -0.0625,-3.59375 0,-0.628972 0.01741,-1.232249 0.03125,-1.84375 0.895269,-0.02827 1.783025,-0.0625 2.71875,-0.0625 z M 68.5625,70.6875 c -0.01243,0.60601 -0.03125,1.189946 -0.03125,1.8125 0,1.22431 0.01541,2.407837 0.0625,3.5625 -3.125243,-0.150329 -5.92077,-0.471558 -8.09375,-0.90625 -0.784983,-0.157031 -1.511491,-0.316471 -2.125,-0.5 -0.107878,-0.704096 -0.1875,-1.422089 -0.1875,-2.15625 0,-0.115714 0.02849,-0.228688 0.03125,-0.34375 0.643106,-0.20284 1.389577,-0.390377 2.25,-0.5625 2.166953,-0.433487 4.97905,-0.75541 8.09375,-0.90625 z m 8.3125,0.03125 c 3.075121,0.15271 5.824455,0.446046 7.96875,0.875 0.857478,0.171534 1.630962,0.360416 2.28125,0.5625 0.0027,0.114659 0,0.228443 0,0.34375 0,0.735827 -0.07914,1.450633 -0.1875,2.15625 -0.598568,0.180148 -1.29077,0.34562 -2.0625,0.5 -2.158064,0.431708 -4.932088,0.754666 -8.03125,0.90625 0.04709,-1.154663 0.0625,-2.33819 0.0625,-3.5625 0,-0.611824 -0.01924,-1.185379 -0.03125,-1.78125 z M 57.15625,72.5625 c 0.0023,0.572772 0.06082,1.131112 0.125,1.6875 -0.125327,-0.05123 -0.266577,-0.10497 -0.375,-0.15625 -0.396499,-0.187528 -0.665288,-0.387337 -0.8125,-0.53125 -0.147212,-0.143913 -0.15625,-0.182756 -0.15625,-0.1875 0,-0.0047 -0.02221,-0.07484 0.125,-0.21875 0.147212,-0.143913 0.447251,-0.312472 0.84375,-0.5 0.07123,-0.03369 0.171867,-0.06006 0.25,-0.09375 z m 31.03125,0 c 0.08201,0.03503 0.175941,0.05872 0.25,0.09375 0.396499,0.187528 0.665288,0.356087 0.8125,0.5 0.14725,0.14391 0.15625,0.21405 0.15625,0.21875 0,0.0047 -0.009,0.04359 -0.15625,0.1875 -0.147212,0.143913 -0.416001,0.343722 -0.8125,0.53125 -0.09755,0.04613 -0.233314,0.07889 -0.34375,0.125 0.06214,-0.546289 0.09144,-1.094215 0.09375,-1.65625 z m -29.5,3.625 c 0.479308,0.123125 0.983064,0.234089 1.53125,0.34375 2.301781,0.460458 5.229421,0.787224 8.46875,0.9375 0.167006,2.84339 0.46081,5.433176 0.875,7.5 0.115218,0.574942 0.245268,1.063612 0.375,1.5625 -5.463677,-1.028179 -9.833074,-5.091831 -11.25,-10.34375 z m 27.96875,0 C 85.247546,81.408945 80.919274,85.442932 75.5,86.5 c 0.126981,-0.490925 0.261959,-0.967174 0.375,-1.53125 0.41419,-2.066824 0.707994,-4.65661 0.875,-7.5 3.204493,-0.15162 6.088346,-0.480068 8.375,-0.9375 0.548186,-0.109661 1.051942,-0.220625 1.53125,-0.34375 z M 70.0625,77.53125 c 0.865391,0.02589 1.723666,0.03125 2.625,0.03125 0.912062,0 1.782843,-0.0048 2.65625,-0.03125 -0.165173,2.736408 -0.453252,5.207651 -0.84375,7.15625 -0.152345,0.760206 -0.322989,1.438994 -0.5,2.03125 -0.437447,0.03919 -0.895856,0.0625 -1.34375,0.0625 -0.414943,0 -0.812719,-0.02881 -1.21875,-0.0625 -0.177011,-0.592256 -0.347655,-1.271044 -0.5,-2.03125 -0.390498,-1.948599 -0.700644,-4.419842 -0.875,-7.15625 z m 1.75,10.28125 c 0.284911,0.01545 0.554954,0.03125 0.84375,0.03125 0.325029,0 0.648588,-0.01171 0.96875,-0.03125 -0.05999,0.148763 -0.127309,0.31046 -0.1875,0.4375 -0.18789,0.396562 -0.386962,0.696416 -0.53125,0.84375 -0.144288,0.147334 -0.181857,0.125 -0.1875,0.125 -0.0056,0 -0.07446,0.02233 -0.21875,-0.125 C 72.355712,88.946416 72.18789,88.646562 72,88.25 71.939809,88.12296 71.872486,87.961263 71.8125,87.8125 z"
}), i("SvgPaths/svgCompassRotationMarker", [], function() {
"use strict";
return "M 72.46875,22.03125 C 59.505873,22.050338 46.521615,27.004287 36.6875,36.875 L 47.84375,47.96875 C 61.521556,34.240041 83.442603,34.227389 97.125,47.90625 l 11.125,-11.125 C 98.401629,26.935424 85.431627,22.012162 72.46875,22.03125 z"
}), i("ViewModels/NavigationViewModel", ["Cesium/Core/defined", "Cesium/Core/Math", "Cesium/Core/getTimestamp", "Cesium/Core/EventHelper", "Cesium/Core/Transforms", "Cesium/Scene/SceneMode", "Cesium/Core/Cartesian2", "Cesium/Core/Cartesian3", "Cesium/Core/Matrix4", "Cesium/Core/BoundingSphere", "Cesium/Core/HeadingPitchRange", "KnockoutES5", "Core/loadView", "ViewModels/ResetViewNavigationControl", "ViewModels/ZoomNavigationControl", "SvgPaths/svgCompassOuterRing", "SvgPaths/svgCompassGyro", "SvgPaths/svgCompassRotationMarker", "Core/Utils"], function(t, e, i, n, r, o, a, s, l, u, c, h, d, p, f, m, g, v, _) {
"use strict";
function y(n, u, c) {
function h(t, i) {
var r = Math.atan2(-t.y, t.x);
n.orbitCursorAngle = e.zeroToTwoPi(r - e.PI_OVER_TWO);
var o = a.magnitude(t),
s = i / 2,
l = Math.min(o / s, 1),
u = .5 * l * l + .5;
n.orbitCursorOpacity = u
}
var d = n.terria.scene,
p = d.screenSpaceCameraController;
if (d.mode != o.MORPHING && p.enableInputs) {
switch (d.mode) {
case o.COLUMBUS_VIEW:
if (p.enableLook) break;
if (!p.enableTranslate || !p.enableTilt) return;
break;
case o.SCENE3D:
if (p.enableLook) break;
if (!p.enableTilt || !p.enableRotate) return;
break;
case o.SCENE2D:
if (!p.enableTranslate) return
}
document.removeEventListener("mousemove", n.orbitMouseMoveFunction, !1), document.removeEventListener("mouseup", n.orbitMouseUpFunction, !1), t(n.orbitTickFunction) && n.terria.clock.onTick.removeEventListener(n.orbitTickFunction), n.orbitMouseMoveFunction = void 0, n.orbitMouseUpFunction = void 0, n.orbitTickFunction = void 0, n.isOrbiting = !0, n.orbitLastTimestamp = i();
var f = d.camera;
if (t(n.terria.trackedEntity)) n.orbitFrame = void 0, n.orbitIsLook = !1;
else {
var m = _.getCameraFocus(n.terria, !0, k);
t(m) ? (n.orbitFrame = r.eastNorthUpToFixedFrame(m, d.globe.ellipsoid, E), n.orbitIsLook = !1) : (n.orbitFrame = r.eastNorthUpToFixedFrame(f.positionWC, d.globe.ellipsoid, E), n.orbitIsLook = !0)
}
n.orbitTickFunction = function(r) {
var a, u = i(),
c = u - n.orbitLastTimestamp,
h = 2.5 * (n.orbitCursorOpacity - .5) / 1e3,
p = c * h,
m = n.orbitCursorAngle + e.PI_OVER_TWO,
g = Math.cos(m) * p,
v = Math.sin(m) * p;
t(n.orbitFrame) && (a = l.clone(f.transform, x), f.lookAtTransform(n.orbitFrame)), d.mode == o.SCENE2D ? f.move(new s(g, v, 0), Math.max(d.canvas.clientWidth, d.canvas.clientHeight) / 100 * f.positionCartographic.height * p) : n.orbitIsLook ? (f.look(s.UNIT_Z, -g), f.look(f.right, -v)) : (f.rotateLeft(g), f.rotateUp(v)), t(n.orbitFrame) && f.lookAtTransform(a), n.orbitLastTimestamp = u
}, n.orbitMouseMoveFunction = function(t) {
var e = u.getBoundingClientRect(),
i = new a((e.right - e.left) / 2, (e.bottom - e.top) / 2),
n = new a(t.clientX - e.left, t.clientY - e.top),
r = a.subtract(n, i, C);
h(r, e.width)
}, n.orbitMouseUpFunction = function(e) {
n.isOrbiting = !1, document.removeEventListener("mousemove", n.orbitMouseMoveFunction, !1), document.removeEventListener("mouseup", n.orbitMouseUpFunction, !1), t(n.orbitTickFunction) && n.terria.clock.onTick.removeEventListener(n.orbitTickFunction), n.orbitMouseMoveFunction = void 0, n.orbitMouseUpFunction = void 0, n.orbitTickFunction = void 0
}, document.addEventListener("mousemove", n.orbitMouseMoveFunction, !1), document.addEventListener("mouseup", n.orbitMouseUpFunction, !1), n.terria.clock.onTick.addEventListener(n.orbitTickFunction), h(c, u.getBoundingClientRect().width)
}
}
function b(i, n, s) {
var u = i.terria.scene,
c = u.camera,
h = u.screenSpaceCameraController;
if (u.mode != o.MORPHING && u.mode != o.SCENE2D && h.enableInputs && (h.enableLook || u.mode != o.COLUMBUS_VIEW && (u.mode != o.SCENE3D || h.enableRotate))) {
if (document.removeEventListener("mousemove", i.rotateMouseMoveFunction, !1), document.removeEventListener("mouseup", i.rotateMouseUpFunction, !1), i.rotateMouseMoveFunction = void 0, i.rotateMouseUpFunction = void 0, i.isRotating = !0, i.rotateInitialCursorAngle = Math.atan2(-s.y, s.x), t(i.terria.trackedEntity)) i.rotateFrame = void 0, i.rotateIsLook = !1;
else {
var d = _.getCameraFocus(i.terria, !0, k);
t(d) && (u.mode != o.COLUMBUS_VIEW || h.enableLook || h.enableTranslate) ? (i.rotateFrame = r.eastNorthUpToFixedFrame(d, u.globe.ellipsoid, E), i.rotateIsLook = !1) : (i.rotateFrame = r.eastNorthUpToFixedFrame(c.positionWC, u.globe.ellipsoid, E), i.rotateIsLook = !0)
}
var p;
t(i.rotateFrame) && (p = l.clone(c.transform, x), c.lookAtTransform(i.rotateFrame)), i.rotateInitialCameraAngle = -c.heading, t(i.rotateFrame) && c.lookAtTransform(p), i.rotateMouseMoveFunction = function(r) {
var o, s = n.getBoundingClientRect(),
u = new a((s.right - s.left) / 2, (s.bottom - s.top) / 2),
c = new a(r.clientX - s.left, r.clientY - s.top),
h = a.subtract(c, u, C),
d = Math.atan2(-h.y, h.x),
p = d - i.rotateInitialCursorAngle,
f = e.zeroToTwoPi(i.rotateInitialCameraAngle - p),
m = i.terria.scene.camera;
t(i.rotateFrame) && (o = l.clone(m.transform, x), m.lookAtTransform(i.rotateFrame));
var g = -m.heading;
m.rotateRight(f - g), t(i.rotateFrame) && m.lookAtTransform(o)
}, i.rotateMouseUpFunction = function(t) {
i.isRotating = !1, document.removeEventListener("mousemove", i.rotateMouseMoveFunction, !1), document.removeEventListener("mouseup", i.rotateMouseUpFunction, !1), i.rotateMouseMoveFunction = void 0, i.rotateMouseUpFunction = void 0
}, document.addEventListener("mousemove", i.rotateMouseMoveFunction, !1), document.addEventListener("mouseup", i.rotateMouseUpFunction, !1)
}
}
var w = function(e) {
function i() {
t(r.terria) ? (r._unsubcribeFromPostRender && (r._unsubcribeFromPostRender(), r._unsubcribeFromPostRender = void 0), r.showCompass = !0, r._unsubcribeFromPostRender = r.terria.scene.postRender.addEventListener(function() {
r.heading = r.terria.scene.camera.heading
})) : (r._unsubcribeFromPostRender && (r._unsubcribeFromPostRender(), r._unsubcribeFromPostRender = void 0), r.showCompass = !1)
}
this.terria = e.terria, this.eventHelper = new n, this.controls = e.controls, t(this.controls) || (this.controls = [new f(this.terria, (!0)), new p(this.terria), new f(this.terria, (!1))]), this.svgCompassOuterRing = m, this.svgCompassGyro = g, this.svgCompassRotationMarker = v, this.showCompass = t(this.terria), this.heading = this.showCompass ? this.terria.scene.camera.heading : 0, this.isOrbiting = !1, this.orbitCursorAngle = 0, this.orbitCursorOpacity = 0, this.orbitLastTimestamp = 0, this.orbitFrame = void 0, this.orbitIsLook = !1, this.orbitMouseMoveFunction = void 0, this.orbitMouseUpFunction = void 0, this.isRotating = !1, this.rotateInitialCursorAngle = void 0, this.rotateFrame = void 0, this.rotateIsLook = !1, this.rotateMouseMoveFunction = void 0, this.rotateMouseUpFunction = void 0, this._unsubcribeFromPostRender = void 0, h.track(this, ["controls", "showCompass", "heading", "isOrbiting", "orbitCursorAngle", "isRotating"]);
var r = this;
this.eventHelper.add(this.terria.afterWidgetChanged, i, this), i()
};
w.prototype.destroy = function() {
this.eventHelper.removeAll()
}, w.prototype.show = function(t) {
var e = '
' + "
";
d(e, t, this)
}, w.prototype.add = function(t) {
this.controls.push(t)
}, w.prototype.remove = function(t) {
this.controls.remove(t)
}, w.prototype.isLastControl = function(t) {
return t === this.controls[this.controls.length - 1]
};
var C = new a;
w.prototype.handleMouseDown = function(t, e) {
var i = this.terria.scene;
if (i.mode == o.MORPHING) return !0;
var n = e.currentTarget,
r = e.currentTarget.getBoundingClientRect(),
s = r.width / 2,
l = new a((r.right - r.left) / 2, (r.bottom - r.top) / 2),
u = new a(e.clientX - r.left, e.clientY - r.top),
c = a.subtract(u, l, C),
h = a.magnitude(c),
d = h / s,
p = 145,
f = 50;
if (d < f / p) y(this, n, c);
else {
if (!(d < 1)) return !0;
b(this, n, c)
}
};
var x = new l,
E = new l,
k = new s;
return w.prototype.handleDoubleClick = function(i, n) {
var r = i.terria.scene,
a = r.camera,
l = r.screenSpaceCameraController;
if (r.mode == o.MORPHING || !l.enableInputs) return !0;
if (r.mode != o.COLUMBUS_VIEW || l.enableTranslate) {
if (r.mode == o.SCENE3D || r.mode == o.COLUMBUS_VIEW) {
if (!l.enableLook) return;
if (r.mode == o.SCENE3D && !l.enableRotate) return
}
var h = _.getCameraFocus(i.terria, !0, k);
if (!t(h)) return void this.controls[1].resetView();
var d = r.globe.ellipsoid.cartographicToCartesian(a.positionCartographic, new s),
p = r.globe.ellipsoid.geodeticSurfaceNormal(h),
f = new u(h, 0);
a.flyToBoundingSphere(f, {
offset: new c(0, e.PI_OVER_TWO - s.angleBetween(p, a.directionWC), s.distance(d, h)),
duration: 1.5
})
}
}, w.create = function(t) {
var e = new w(t);
return e.show(t.container), e
}, w
}), i("CesiumNavigation", ["Cesium/Core/defined", "Cesium/Core/defineProperties", "Cesium/Core/Event", "KnockoutES5", "Core/registerKnockoutBindings", "ViewModels/DistanceLegendViewModel", "ViewModels/NavigationViewModel"], function(t, e, i, n, r, o, a) {
"use strict";
function s(e, n) {
if (!t(e)) throw new DeveloperError("CesiumWidget or Viewer is required.");
var s = t(e.cesiumWidget) ? e.cesiumWidget : e,
l = document.createElement("div");
l.className = "cesium-widget-cesiumNavigationContainer", s.container.appendChild(l), this.terria = e, this.terria.options = n, this.terria.afterWidgetChanged = new i, this.terria.beforeWidgetChanged = new i, this.container = l, this.navigationDiv = document.createElement("div"), this.navigationDiv.setAttribute("id", "navigationDiv"), this.distanceLegendDiv = document.createElement("div"), this.navigationDiv.setAttribute("id", "distanceLegendDiv"), l.appendChild(this.navigationDiv), l.appendChild(this.distanceLegendDiv), r(), this.distanceLegendViewModel = o.create({
container: this.distanceLegendDiv,
terria: this.terria,
mapElement: l
}), this.navigationViewModel = a.create({
container: this.navigationDiv,
terria: this.terria
})
}
var l = function(t) {
s.apply(this, arguments), this._onDestroyListeners = []
};
return l.prototype.distanceLegendViewModel = void 0, l.prototype.navigationViewModel = void 0, l.prototype.navigationDiv = void 0, l.prototype.distanceLegendDiv = void 0, l.prototype.terria = void 0, l.prototype.container = void 0, l.prototype._onDestroyListeners = void 0, l.prototype.destroy = function() {
t(this.navigationViewModel) && this.navigationViewModel.destroy(), t(this.distanceLegendViewModel) && this.distanceLegendViewModel.destroy(), t(this.navigationDiv) && this.navigationDiv.parentNode.removeChild(this.navigationDiv), delete this.navigationDiv, t(this.distanceLegendDiv) && this.distanceLegendDiv.parentNode.removeChild(this.distanceLegendDiv), delete this.distanceLegendDiv, t(this.container) && this.container.parentNode.removeChild(this.container), delete this.container;
for (var e = 0; e < this._onDestroyListeners.length; e++) this._onDestroyListeners[e]()
}, l.prototype.addOnDestroyListener = function(t) {
"function" == typeof t && this._onDestroyListeners.push(t)
}, l
}), i("dummy/require-less/less/dummy", [], function() {}), i("viewerCesiumNavigationMixin", ["Cesium/Core/defined", "Cesium/Core/defineProperties", "Cesium/Core/DeveloperError", "CesiumNavigation", "dummy/require-less/less/dummy"], function(t, e, i, n) {
"use strict";
function r(n, r) {
if (!t(n)) throw new i("viewer is required.");
var a = o(n, r);
a.addOnDestroyListener(function(t) {
return function() {
delete t.cesiumNavigation
}
}(n)), e(n, {
cesiumNavigation: {
configurable: !0,
get: function() {
return n.cesiumWidget.cesiumNavigation
}
}
})
}
r.mixinWidget = function(t, e) {
return o.apply(void 0, arguments)
};
var o = function(i, r) {
var o = new n(i, r),
a = t(i.cesiumWidget) ? i.cesiumWidget : i;
return e(a, {
cesiumNavigation: {
configurable: !0,
get: function() {
return o
}
}
}), o.addOnDestroyListener(function(t) {
return function() {
delete t.cesiumNavigation
}
}(a)), o
};
return r
}), function(t) {
var e = document,
i = "appendChild",
n = "styleSheet",
r = e.createElement("style");
r.type = "text/css", e.getElementsByTagName("head")[0][i](r), r[n] ? r[n].cssText = t : r[i](e.createTextNode(t))
}(".full-window{position:absolute;top:0;left:0;right:0;bottom:0;margin:0;overflow:hidden;padding:0;-webkit-transition:left .25s ease-out;-moz-transition:left .25s ease-out;-ms-transition:left .25s ease-out;-o-transition:left .25s ease-out;transition:left .25s ease-out}.transparent-to-input{pointer-events:none}.opaque-to-input{pointer-events:auto}.clickable{cursor:pointer}.markdown a:hover,.markdown u,a:hover{text-decoration:underline}.modal,.modal-background{top:0;left:0;bottom:0;right:0}.modal-background{pointer-events:auto;background-color:rgba(0,0,0,.5);z-index:1000;position:fixed}.modal{position:absolute;margin:auto;background-color:#2f353c;max-height:100%;max-width:100%;font-family:'Roboto',sans-serif;color:#fff}.modal-header{background-color:rgba(0,0,0,.2);border-bottom:1px solid rgba(100,100,100,.6);font-size:15px;line-height:40px;margin:0}.modal-header h1{font-size:15px;color:#fff;margin-left:15px}.modal-content{margin-left:15px;margin-right:15px;margin-bottom:15px;padding-top:15px;overflow:auto}.modal-close-button{position:absolute;right:15px;cursor:pointer;font-size:18px;color:#fff}#ui{z-index:2100}@media print{.full-window{position:initial}}.markdown img{max-width:100%}.markdown svg{max-height:100%}.markdown fieldset,.markdown input,.markdown select,.markdown textarea{font-family:inherit;font-size:1rem;box-sizing:border-box;margin-top:0;margin-bottom:0}.markdown label{vertical-align:middle}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5,.markdown h6{font-family:inherit;font-weight:700;line-height:1.25;margin-top:1em;margin-bottom:.5em}.markdown h1{font-size:2rem}.markdown h2{font-size:1.5rem}.markdown h3{font-size:1.25rem}.markdown h4{font-size:1rem}.markdown h5{font-size:.875rem}.markdown h6{font-size:.75rem}.markdown dl,.markdown ol,.markdown p,.markdown ul{margin-top:0;margin-bottom:1rem}.markdown strong{font-weight:700}.markdown em{font-style:italic}.markdown small{font-size:80%}.markdown mark{color:#000;background:#ff0}.markdown s{text-decoration:line-through}.markdown ol{list-style:decimal inside}.markdown ul{list-style:disc inside}.markdown code,.markdown pre,.markdown samp{font-family:monospace;font-size:inherit}.markdown pre{margin-top:0;margin-bottom:1rem;overflow-x:scroll}.markdown a{color:#68adfe;text-decoration:none}.markdown code,.markdown pre{background-color:transparent;border-radius:3px}.markdown hr{border:0;border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:rgba(0,0,0,.125)}.markdown .left-align{text-align:left}.markdown .center{text-align:center}.markdown .right-align{text-align:right}.markdown .justify{text-align:justify}.markdown .truncate{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.markdown ol.upper-roman{list-style-type:upper-roman}.markdown ol.lower-alpha{list-style-type:lower-alpha}.markdown ul.circle{list-style-type:circle}.markdown ul.square{list-style-type:square}.markdown .list-reset{list-style:none;padding-left:0}.floating,.floating-horizontal,.floating-vertical{pointer-events:auto;position:absolute;border-radius:15px;background-color:rgba(47,53,60,.8)}.floating-horizontal{padding-left:5px;padding-right:5px}.floating-vertical{padding-top:5px;padding-bottom:5px}@media print{.floating{display:none}}.distance-legend{pointer-events:auto;position:absolute;border-radius:15px;background-color:rgba(47,53,60,.8);padding-left:5px;padding-right:5px;right:25px;bottom:30px;height:30px;width:125px;border:1px solid rgba(255,255,255,.1);box-sizing:content-box}.distance-legend-label{display:inline-block;font-size:13px;font-weight:lighter;line-height:30px;color:#ffffff;text-shadow: 5px 2px 6px #000;width:125px;text-align:center}.distance-legend-scale-bar{border-left:1px solid #fff;border-right:1px solid #fff;border-bottom:1px solid #fff;position:absolute;height:10px;top:15px}@media print{.distance-legend{display:none}}@media screen and (max-width:700px),screen and (max-height:420px){.distance-legend{display:none}}.navigation-controls{position:absolute;right:30px;top:210px;width:30px;border:1px solid rgba(255,255,255,.1);font-weight:300;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.navigation-control{cursor:pointer;border-bottom:1px solid #555}.naviagation-control:active{color:#fff}.navigation-control-last{cursor:pointer;border-bottom:0}.navigation-control-icon-zoom-in{padding-bottom:4px}.navigation-control-icon-zoom-in,.navigation-control-icon-zoom-out{position:relative;text-align:center;font-size:20px;color:#fff}.navigation-control-icon-reset{position:relative;left:10px;width:10px;height:10px;fill:rgba(255,255,255,.8);padding-top:6px;padding-bottom:6px;box-sizing:content-box}.compass,.compass-outer-ring{position:absolute;width:95px;height:95px}.compass{pointer-events:auto;right:0;overflow:hidden;top:100px}.compass-outer-ring{top:0;fill:rgba(255,255,255,.5)}.compass-outer-ring-background{position:absolute;top:14px;left:14px;width:44px;height:44px;border-radius:44px;border:12px solid rgba(47,53,60,.8);box-sizing:content-box}.compass-gyro{pointer-events:none;position:absolute;top:0;width:95px;height:95px;fill:#ccc}.compass-gyro-active,.compass-gyro-background:hover+.compass-gyro{fill:#68adfe}.compass-gyro-background{position:absolute;top:30px;left:30px;width:33px;height:33px;border-radius:33px;background-color:rgba(47,53,60,.8);border:1px solid rgba(255,255,255,.2);box-sizing:content-box}.compass-rotation-marker{position:absolute;top:0;width:95px;height:95px;fill:#68adfe}@media screen and (max-width:700px),screen and (max-height:420px){.compass,.navigation-controls{display:none}}@media print{.compass,.navigation-controls{display:none}}"), i("Cesium/Core/defined", function() {
return Cesium.defined
}), i("Cesium/Core/defineProperties", function() {
return Cesium.defineProperties
}), i("Cesium/Core/defaultValue", function() {
return Cesium.defaultValue
}), i("Cesium/Core/Event", function() {
return Cesium.Event
}), i("Cesium/Widgets/getElement", function() {
return Cesium.getElement
}), i("Cesium/Widgets/SvgPathBindingHandler", function() {
return Cesium.SvgPathBindingHandler
}), i("Cesium/Core/Ray", function() {
return Cesium.Ray
}), i("Cesium/Core/Cartesian3", function() {
return Cesium.Cartesian3
}), i("Cesium/Core/Cartographic", function() {
return Cesium.Cartographic
}), i("Cesium/Core/ReferenceFrame", function() {
return Cesium.ReferenceFrame
}), i("Cesium/Scene/SceneMode", function() {
return Cesium.SceneMode
}), i("Cesium/Core/DeveloperError", function() {
return Cesium.DeveloperError
}), i("Cesium/Core/EllipsoidGeodesic", function() {
return Cesium.EllipsoidGeodesic
}), i("Cesium/Core/Cartesian2", function() {
return Cesium.Cartesian2
}), i("Cesium/Core/getTimestamp", function() {
return Cesium.getTimestamp
}), i("Cesium/Core/EventHelper", function() {
return Cesium.EventHelper
}), i("Cesium/Core/Math", function() {
return Cesium.Math
}), i("Cesium/Core/Transforms", function() {
return Cesium.Transforms
}), i("Cesium/Core/Matrix4", function() {
return Cesium.Matrix4
}), i("Cesium/Core/BoundingSphere", function() {
return Cesium.BoundingSphere
}), i("Cesium/Core/HeadingPitchRange", function() {
return Cesium.HeadingPitchRange
}), i("Cesium/Scene/Camera", function() {
return Cesium.Camera
}), i("Cesium/Core/Rectangle", function() {
return Cesium.Rectangle
}), i("Cesium/Core/IntersectionTests", function() {
return Cesium.IntersectionTests
}), e("viewerCesiumNavigationMixin")
}), function(t, e) {
"function" == typeof define && define.amd ? define([], e) : "object" == typeof module && module.exports ? module.exports = e() : t.pointconvert = e();
}(this, function() {
var t = 52.35987755982988,
e = 3.141592653589793,
i = 6378245,
n = .006693421622965943,
r = function(t) {
var e = Number(t[0]),
i = Number(t[1]),
n = 52.35987755982988,
r = e - .0065,
o = i - .006,
a = Math.sqrt(r * r + o * o) - 2e-5 * Math.sin(o * n),
s = Math.atan2(o, r) - 3e-6 * Math.cos(r * n),
l = a * Math.cos(s),
u = a * Math.sin(s);
return l = Number(l.toFixed(6)), u = Number(u.toFixed(6)), [l, u]
},
o = function(e) {
var i = Number(e[0]),
n = Number(e[1]),
r = Math.sqrt(i * i + n * n) + 2e-5 * Math.sin(n * t),
o = Math.atan2(n, i) + 3e-6 * Math.cos(i * t),
a = r * Math.cos(o) + .0065,
s = r * Math.sin(o) + .006;
return a = Number(a.toFixed(6)), s = Number(s.toFixed(6)), [a, s]
},
a = function(t) {
var r = Number(t[0]),
o = Number(t[1]);
if (d(r, o)) return [r, o];
var a = c(r - 105, o - 35),
s = h(r - 105, o - 35),
l = o / 180 * e,
u = Math.sin(l);
u = 1 - n * u * u;
var p = Math.sqrt(u);
a = 180 * a / (i * (1 - n) / (u * p) * e), s = 180 * s / (i / p * Math.cos(l) * e);
var f = o + a,
m = r + s;
return m = Number(m.toFixed(6)), f = Number(f.toFixed(6)), [m, f]
},
s = function(t) {
var r = Number(t[0]),
o = Number(t[1]);
if (d(r, o)) return [r, o];
var a = c(r - 105, o - 35),
s = h(r - 105, o - 35),
l = o / 180 * e,
u = Math.sin(l);
u = 1 - n * u * u;
var p = Math.sqrt(u);
a = 180 * a / (i * (1 - n) / (u * p) * e), s = 180 * s / (i / p * Math.cos(l) * e), mglat = o + a, mglng = r + s;
var f = 2 * r - mglng,
m = 2 * o - mglat;
return f = Number(f.toFixed(6)), m = Number(m.toFixed(6)), [f, m]
},
l = function(t) {
return s(r(t))
},
u = function(t) {
return o(a(t))
},
c = function(t, i) {
var n = -100 + 2 * t + 3 * i + .2 * i * i + .1 * t * i + .2 * Math.sqrt(Math.abs(t));
return n += 2 * (20 * Math.sin(6 * t * e) + 20 * Math.sin(2 * t * e)) / 3, n += 2 * (20 * Math.sin(i * e) + 40 * Math.sin(i / 3 * e)) / 3, n += 2 * (160 * Math.sin(i / 12 * e) + 320 * Math.sin(i * e / 30)) / 3
},
h = function(t, i) {
var n = 300 + t + 2 * i + .1 * t * t + .1 * t * i + .1 * Math.sqrt(Math.abs(t));
return n += 2 * (20 * Math.sin(6 * t * e) + 20 * Math.sin(2 * t * e)) / 3, n += 2 * (20 * Math.sin(t * e) + 40 * Math.sin(t / 3 * e)) / 3, n += 2 * (150 * Math.sin(t / 12 * e) + 300 * Math.sin(t / 30 * e)) / 3
},
d = function(t, e) {
return t < 72.004 || t > 137.8347 || e < .8293 || e > 55.8271 || !1
},
p = function(t) {
var i = Number(t[0]),
n = Number(t[1]),
r = 20037508.34 * i / 180,
o = Math.log(Math.tan((90 + n) * e / 360)) / (e / 180);
return o = 20037508.34 * o / 180, r = Number(r.toFixed(2)), o = Number(o.toFixed(2)), [r, o]
},
f = function(t) {
var i = Number(t[0]),
n = Number(t[1]),
r = i / 20037508.34 * 180,
o = n / 20037508.34 * 180;
return o = 180 / e * (2 * Math.atan(Math.exp(o * e / 180)) - e / 2), r = Number(r.toFixed(6)), o = Number(o.toFixed(6)), [r, o]
};
return {
jwd2mct: p,
mct2jwd: f,
bd2gcj: r,
gcj2bd: o,
bd2wgs: l,
wgs2bd: u,
wgs2gcj: a,
gcj2wgs: s
}
}), function(t, e) {
"object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e(t.L = {})
}(this, function(t) {
"use strict";
function e(t) {
var e, i, n, r;
for (i = 1, n = arguments.length; i < n; i++) {
r = arguments[i];
for (e in r) t[e] = r[e]
}
return t
}
function i(t, e) {
var i = Array.prototype.slice;
if (t.bind) return t.bind.apply(t, i.call(arguments, 1));
var n = i.call(arguments, 2);
return function() {
return t.apply(e, n.length ? n.concat(i.call(arguments)) : arguments)
}
}
function n(t) {
return t._leaflet_id = t._leaflet_id || ++Wt, t._leaflet_id
}
function r(t, e, i) {
var n, r, o, a;
return a = function() {
n = !1, r && (o.apply(i, r), r = !1)
}, o = function() {
n ? r = arguments : (t.apply(i, arguments), setTimeout(a, e), n = !0)
}
}
function o(t, e, i) {
var n = e[1],
r = e[0],
o = n - r;
return t === n && i ? t : ((t - r) % o + o) % o + r
}
function a() {
return !1
}
function s(t, e) {
var i = Math.pow(10, e || 5);
return Math.round(t * i) / i
}
function l(t) {
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
}
function u(t) {
return l(t).split(/\s+/)
}
function c(t, e) {
t.hasOwnProperty("options") || (t.options = t.options ? Vt(t.options) : {});
for (var i in e) t.options[i] = e[i];
return t.options
}
function h(t, e, i) {
var n = [];
for (var r in t) n.push(encodeURIComponent(i ? r.toUpperCase() : r) + "=" + encodeURIComponent(t[r]));
return (e && e.indexOf("?") !== -1 ? "&" : "?") + n.join("&")
}
function d(t, e) {
if (null != t && null != e) return t.replace(Zt, function(t, i) {
var n = e[i];
if (void 0 === n) throw new Error("No value provided for variable " + t);
return "function" == typeof n && (n = n(e)), n
})
}
function p(t, e) {
for (var i = 0; i < t.length; i++) if (t[i] === e) return i;
return -1
}
function f(t) {
return window["webkit" + t] || window["moz" + t] || window["ms" + t]
}
function m(t) {
var e = +new Date,
i = Math.max(0, 16 - (e - Jt));
return Jt = e + i, window.setTimeout(t, i)
}
function g(t, e, n) {
return n && Kt === m ? void t.call(e) : Kt.call(window, i(t, e))
}
function v(t) {
t && Yt.call(window, t)
}
function _() {}
function y(t) {
if (L && L.Mixin) {
t = Gt(t) ? t : [t];
for (var e = 0; e < t.length; e++) t[e] === L.Mixin.Events && console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", (new Error).stack)
}
}
function b(t, e, i) {
this.x = i ? Math.round(t) : t, this.y = i ? Math.round(e) : e
}
function w(t, e, i) {
return t instanceof b ? t : Gt(t) ? new b(t[0], t[1]) : void 0 === t || null === t ? t : "object" == typeof t && "x" in t && "y" in t ? new b(t.x, t.y) : new b(t, e, i)
}
function C(t, e) {
if (t) for (var i = e ? [t, e] : t, n = 0, r = i.length; n < r; n++) this.extend(i[n])
}
function x(t, e) {
return !t || t instanceof C ? t : new C(t, e)
}
function E(t, e) {
if (t) for (var i = e ? [t, e] : t, n = 0, r = i.length; n < r; n++) this.extend(i[n])
}
function k(t, e) {
return t instanceof E ? t : new E(t, e)
}
function P(t, e, i) {
if (isNaN(t) || isNaN(e)) throw new Error("Invalid LatLng object: (" + t + ", " + e + ")");
this.lat = +t, this.lng = +e, void 0 !== i && (this.alt = +i)
}
function D(t, e, i) {
return t instanceof P ? t : Gt(t) && "object" != typeof t[0] ? 3 === t.length ? new P(t[0], t[1], t[2]) : 2 === t.length ? new P(t[0], t[1]) : null : void 0 === t || null === t ? t : "object" == typeof t && "lat" in t ? new P(t.lat, "lng" in t ? t.lng : t.lon, t.alt) : void 0 === e ? null : new P(t, e, i)
}
function T(t, e, i, n) {
return Gt(t) ? (this._a = t[0], this._b = t[1], this._c = t[2], void(this._d = t[3])) : (this._a = t, this._b = e, this._c = i, void(this._d = n))
}
function S(t, e, i, n) {
return new T(t, e, i, n)
}
function M(t) {
return document.createElementNS("http://www.w3.org/2000/svg", t)
}
function A(t) {
return navigator.userAgent.toLowerCase().indexOf(t) >= 0
}
function O(t, e, i, n) {
return "touchstart" === e ? I(t, i, n) : "touchmove" === e ? U(t, i, n) : "touchend" === e && H(t, i, n), this
}
function N(t, e, i) {
var n = t["_leaflet_" + e + i];
return "touchstart" === e ? t.removeEventListener(He, n, !1) : "touchmove" === e ? t.removeEventListener(qe, n, !1) : "touchend" === e && (t.removeEventListener(je, n, !1), t.removeEventListener(Ve, n, !1)), this
}
function I(t, e, n) {
var r = i(function(t) {
if ("mouse" !== t.pointerType && t.pointerType !== t.MSPOINTER_TYPE_MOUSE && t.pointerType !== t.MSPOINTER_TYPE_MOUSE) {
if (!(We.indexOf(t.target.tagName) < 0)) return;
Y(t)
}
B(t, e)
});
t["_leaflet_touchstart" + n] = r, t.addEventListener(He, r, !1), Ge || (document.documentElement.addEventListener(He, R, !0), document.documentElement.addEventListener(qe, F, !0), document.documentElement.addEventListener(je, z, !0), document.documentElement.addEventListener(Ve, z, !0), Ge = !0)
}
function R(t) {
Ze[t.pointerId] = t, $e++
}
function F(t) {
Ze[t.pointerId] && (Ze[t.pointerId] = t)
}
function z(t) {
delete Ze[t.pointerId], $e--
}
function B(t, e) {
t.touches = [];
for (var i in Ze) t.touches.push(Ze[i]);
t.changedTouches = [t], e(t)
}
function U(t, e, i) {
var n = function(t) {
(t.pointerType !== t.MSPOINTER_TYPE_MOUSE && "mouse" !== t.pointerType || 0 !== t.buttons) && B(t, e)
};
t["_leaflet_touchmove" + i] = n, t.addEventListener(qe, n, !1)
}
function H(t, e, i) {
var n = function(t) {
B(t, e)
};
t["_leaflet_touchend" + i] = n, t.addEventListener(je, n, !1), t.addEventListener(Ve, n, !1)
}
function q(t, e, i) {
function n(t) {
var e;
if (Ae) {
if (!pe || "mouse" === t.pointerType) return;
e = $e
} else e = t.touches.length;
if (!(e > 1)) {
var i = Date.now(),
n = i - (o || i);
a = t.touches ? t.touches[0] : t, s = n > 0 && n <= l, o = i
}
}
function r(t) {
if (s && !a.cancelBubble) {
if (Ae) {
if (!pe || "mouse" === t.pointerType) return;
var i, n, r = {};
for (n in a) i = a[n], r[n] = i && i.bind ? i.bind(a) : i;
a = r
}
a.type = "dblclick", e(a), o = null
}
}
var o, a, s = !1,
l = 250;
return t[Ye + Je + i] = n, t[Ye + Ke + i] = r, t[Ye + "dblclick" + i] = e, t.addEventListener(Je, n, !1), t.addEventListener(Ke, r, !1), t.addEventListener("dblclick", e, !1), this
}
function j(t, e) {
var i = t[Ye + Je + e],
n = t[Ye + Ke + e],
r = t[Ye + "dblclick" + e];
return t.removeEventListener(Je, i, !1), t.removeEventListener(Ke, n, !1), pe || t.removeEventListener("dblclick", r, !1), this
}
function V(t, e, i, n) {
if ("object" == typeof e) for (var r in e) Z(t, r, e[r], i);
else {
e = u(e);
for (var o = 0, a = e.length; o < a; o++) Z(t, e[o], i, n)
}
return this
}
function W(t, e, i, n) {
if ("object" == typeof e) for (var r in e) G(t, r, e[r], i);
else if (e) {
e = u(e);
for (var o = 0, a = e.length; o < a; o++) G(t, e[o], i, n)
} else {
for (var s in t[Xe]) G(t, s, t[Xe][s]);
delete t[Xe]
}
return this
}
function Z(t, e, i, r) {
var o = e + n(i) + (r ? "_" + n(r) : "");
if (t[Xe] && t[Xe][o]) return this;
var a = function(e) {
return i.call(r || t, e || window.event)
},
s = a;
Ae && 0 === e.indexOf("touch") ? O(t, e, a, o) : !Oe || "dblclick" !== e || !q || Ae && _e ? "addEventListener" in t ? "mousewheel" === e ? t.addEventListener("onwheel" in t ? "wheel" : "mousewheel", a, !1) : "mouseenter" === e || "mouseleave" === e ? (a = function(e) {
e = e || window.event, nt(t, e) && s(e)
}, t.addEventListener("mouseenter" === e ? "mouseover" : "mouseout", a, !1)) : ("click" === e && me && (a = function(t) {
rt(t, s)
}), t.addEventListener(e, a, !1)) : "attachEvent" in t && t.attachEvent("on" + e, a) : q(t, a, o), t[Xe] = t[Xe] || {}, t[Xe][o] = a
}
function G(t, e, i, r) {
var o = e + n(i) + (r ? "_" + n(r) : ""),
a = t[Xe] && t[Xe][o];
return a ? (Ae && 0 === e.indexOf("touch") ? N(t, e, o) : Oe && "dblclick" === e && j ? j(t, o) : "removeEventListener" in t ? "mousewheel" === e ? t.removeEventListener("onwheel" in t ? "wheel" : "mousewheel", a, !1) : t.removeEventListener("mouseenter" === e ? "mouseover" : "mouseleave" === e ? "mouseout" : e, a, !1) : "detachEvent" in t && t.detachEvent("on" + e, a), void(t[Xe][o] = null)) : this
}
function $(t) {
return t.stopPropagation ? t.stopPropagation() : t.originalEvent ? t.originalEvent._stopped = !0 : t.cancelBubble = !0, it(t), this
}
function J(t) {
return Z(t, "mousewheel", $), this
}
function K(t) {
return V(t, "mousedown touchstart dblclick", $), Z(t, "click", et), this
}
function Y(t) {
return t.preventDefault ? t.preventDefault() : t.returnValue = !1, this
}
function X(t) {
return Y(t), $(t), this
}
function Q(t, e) {
if (!e) return new b(t.clientX, t.clientY);
var i = e.getBoundingClientRect();
return new b(t.clientX - i.left - e.clientLeft, t.clientY - i.top - e.clientTop)
}
function tt(t) {
return pe ? t.wheelDeltaY / 2 : t.deltaY && 0 === t.deltaMode ? -t.deltaY / Qe : t.deltaY && 1 === t.deltaMode ? 20 * -t.deltaY : t.deltaY && 2 === t.deltaMode ? 60 * -t.deltaY : t.deltaX || t.deltaZ ? 0 : t.wheelDelta ? (t.wheelDeltaY || t.wheelDelta) / 2 : t.detail && Math.abs(t.detail) < 32765 ? 20 * -t.detail : t.detail ? t.detail / -32765 * 60 : 0
}
function et(t) {
ti[t.type] = !0
}
function it(t) {
var e = ti[t.type];
return ti[t.type] = !1, e
}
function nt(t, e) {
var i = e.relatedTarget;
if (!i) return !0;
try {
for (; i && i !== t;) i = i.parentNode
} catch (n) {
return !1
}
return i !== t
}
function rt(t, e) {
var i = t.timeStamp || t.originalEvent && t.originalEvent.timeStamp,
n = re && i - re;
return n && n > 100 && n < 500 || t.target._simulatedClick && !t._simulated ? void X(t) : (re = i, void e(t))
}
function ot(t) {
return "string" == typeof t ? document.getElementById(t) : t
}
function at(t, e) {
var i = t.style[e] || t.currentStyle && t.currentStyle[e];
if ((!i || "auto" === i) && document.defaultView) {
var n = document.defaultView.getComputedStyle(t, null);
i = n ? n[e] : null
}
return "auto" === i ? null : i
}
function st(t, e, i) {
var n = document.createElement(t);
return n.className = e || "", i && i.appendChild(n), n
}
function lt(t) {
var e = t.parentNode;
e && e.removeChild(t)
}
function ut(t) {
for (; t.firstChild;) t.removeChild(t.firstChild)
}
function ct(t) {
var e = t.parentNode;
e.lastChild !== t && e.appendChild(t)
}
function ht(t) {
var e = t.parentNode;
e.firstChild !== t && e.insertBefore(t, e.firstChild)
}
function dt(t, e) {
if (void 0 !== t.classList) return t.classList.contains(e);
var i = gt(t);
return i.length > 0 && new RegExp("(^|\\s)" + e + "(\\s|$)").test(i)
}
function pt(t, e) {
if (void 0 !== t.classList) for (var i = u(e), n = 0, r = i.length; n < r; n++) t.classList.add(i[n]);
else if (!dt(t, e)) {
var o = gt(t);
mt(t, (o ? o + " " : "") + e)
}
}
function ft(t, e) {
void 0 !== t.classList ? t.classList.remove(e) : mt(t, l((" " + gt(t) + " ").replace(" " + e + " ", " ")))
}
function mt(t, e) {
void 0 === t.className.baseVal ? t.className = e : t.className.baseVal = e
}
function gt(t) {
return void 0 === t.className.baseVal ? t.className : t.className.baseVal
}
function vt(t, e) {
"opacity" in t.style ? t.style.opacity = e : "filter" in t.style && _t(t, e)
}
function _t(t, e) {
var i = !1,
n = "DXImageTransform.Microsoft.Alpha";
try {
i = t.filters.item(n)
} catch (r) {
if (1 === e) return
}
e = Math.round(100 * e), i ? (i.Enabled = 100 !== e, i.Opacity = e) : t.style.filter += " progid:" + n + "(opacity=" + e + ")"
}
function yt(t) {
for (var e = document.documentElement.style, i = 0; i < t.length; i++) if (t[i] in e) return t[i];
return !1
}
function bt(t, e, i) {
var n = e || new b(0, 0);
t.style[ii] = (Ee ? "translate(" + n.x + "px," + n.y + "px)" : "translate3d(" + n.x + "px," + n.y + "px,0)") + (i ? " scale(" + i + ")" : "")
}
function wt(t, e) {
t._leaflet_pos = e, Pe ? bt(t, e) : (t.style.left = e.x + "px", t.style.top = e.y + "px")
}
function Ct(t) {
return t._leaflet_pos || new b(0, 0)
}
function xt() {
V(window, "dragstart", Y)
}
function Et() {
W(window, "dragstart", Y)
}
function kt(t) {
for (; t.tabIndex === -1;) t = t.parentNode;
t.style && (Lt(), ai = t, si = t.style.outline, t.style.outline = "none", V(window, "keydown", Lt))
}
function Lt() {
ai && (ai.style.outline = si, ai = void 0, si = void 0, W(window, "keydown", Lt))
}
function Pt(t, e) {
if (!e || !t.length) return t.slice();
var i = e * e;
return t = At(t, i), t = St(t, i)
}
function Dt(t, e, i) {
return Math.sqrt(Ft(t, e, i, !0))
}
function Tt(t, e, i) {
return Ft(t, e, i)
}
function St(t, e) {
var i = t.length,
n = typeof Uint8Array != void 0 + "" ? Uint8Array : Array,
r = new n(i);
r[0] = r[i - 1] = 1, Mt(t, r, e, 0, i - 1);
var o, a = [];
for (o = 0; o < i; o++) r[o] && a.push(t[o]);
return a
}
function Mt(t, e, i, n, r) {
var o, a, s, l = 0;
for (a = n + 1; a <= r - 1; a++) s = Ft(t[a], t[n], t[r], !0), s > l && (o = a, l = s);
l > i && (e[o] = 1, Mt(t, e, i, n, o), Mt(t, e, i, o, r))
}
function At(t, e) {
for (var i = [t[0]], n = 1, r = 0, o = t.length; n < o; n++) Rt(t[n], t[r]) > e && (i.push(t[n]), r = n);
return r < o - 1 && i.push(t[o - 1]), i
}
function Ot(t, e, i, n, r) {
var o, a, s, l = n ? li : It(t, i),
u = It(e, i);
for (li = u;;) {
if (!(l | u)) return [t, e];
if (l & u) return !1;
o = l || u, a = Nt(t, e, o, i, r), s = It(a, i), o === l ? (t = a, l = s) : (e = a, u = s)
}
}
function Nt(t, e, i, n, r) {
var o, a, s = e.x - t.x,
l = e.y - t.y,
u = n.min,
c = n.max;
return 8 & i ? (o = t.x + s * (c.y - t.y) / l, a = c.y) : 4 & i ? (o = t.x + s * (u.y - t.y) / l, a = u.y) : 2 & i ? (o = c.x, a = t.y + l * (c.x - t.x) / s) : 1 & i && (o = u.x, a = t.y + l * (u.x - t.x) / s), new b(o, a, r)
}
function It(t, e) {
var i = 0;
return t.x < e.min.x ? i |= 1 : t.x > e.max.x && (i |= 2), t.y < e.min.y ? i |= 4 : t.y > e.max.y && (i |= 8), i
}
function Rt(t, e) {
var i = e.x - t.x,
n = e.y - t.y;
return i * i + n * n
}
function Ft(t, e, i, n) {
var r, o = e.x,
a = e.y,
s = i.x - o,
l = i.y - a,
u = s * s + l * l;
return u > 0 && (r = ((t.x - o) * s + (t.y - a) * l) / u, r > 1 ? (o = i.x, a = i.y) : r > 0 && (o += s * r, a += l * r)), s = t.x - o, l = t.y - a, n ? s * s + l * l : new b(o, a)
}
function zt(t) {
return !Gt(t[0]) || "object" != typeof t[0][0] && "undefined" != typeof t[0][0]
}
function Bt(t) {
return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."), zt(t)
}
function Ut(t, e, i) {
var n, r, o, a, s, l, u, c, h, d = [1, 4, 2, 8];
for (r = 0, u = t.length; r < u; r++) t[r]._code = It(t[r], e);
for (a = 0; a < 4; a++) {
for (c = d[a], n = [], r = 0, u = t.length, o = u - 1; r < u; o = r++) s = t[r], l = t[o], s._code & c ? l._code & c || (h = Nt(l, s, c, e, i), h._code = It(h, e), n.push(h)) : (l._code & c && (h = Nt(l, s, c, e, i), h._code = It(h, e), n.push(h)), n.push(s));
t = n
}
return t
}
function Ht() {
return window.L = gi, this
}
var qt = "1.2.0+HEAD.1ac320b",
jt = Object.freeze;
Object.freeze = function(t) {
return t
};
var Vt = Object.create ||
function() {
function t() {}
return function(e) {
return t.prototype = e, new t
}
}(), Wt = 0, Zt = /\{ *([\w_\-]+) *\}/g, Gt = Array.isArray ||
function(t) {
return "[object Array]" === Object.prototype.toString.call(t)
}, $t = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", Jt = 0, Kt = window.requestAnimationFrame || f("RequestAnimationFrame") || m, Yt = window.cancelAnimationFrame || f("CancelAnimationFrame") || f("CancelRequestAnimationFrame") ||
function(t) {
window.clearTimeout(t)
}, Xt = (Object.freeze || Object)({
freeze: jt,
extend: e,
create: Vt,
bind: i,
lastId: Wt,
stamp: n,
throttle: r,
wrapNum: o,
falseFn: a,
formatNum: s,
trim: l,
splitWords: u,
setOptions: c,
getParamString: h,
template: d,
isArray: Gt,
indexOf: p,
emptyImageUrl: $t,
requestFn: Kt,
cancelFn: Yt,
requestAnimFrame: g,
cancelAnimFrame: v
});
_.extend = function(t) {
var i = function() {
this.initialize && this.initialize.apply(this, arguments), this.callInitHooks()
},
n = i.__super__ = this.prototype,
r = Vt(n);
r.constructor = i, i.prototype = r;
for (var o in this) this.hasOwnProperty(o) && "prototype" !== o && "__super__" !== o && (i[o] = this[o]);
return t.statics && (e(i, t.statics), delete t.statics), t.includes && (y(t.includes), e.apply(null, [r].concat(t.includes)), delete t.includes), r.options && (t.options = e(Vt(r.options), t.options)), e(r, t), r._initHooks = [], r.callInitHooks = function() {
if (!this._initHooksCalled) {
n.callInitHooks && n.callInitHooks.call(this), this._initHooksCalled = !0;
for (var t = 0, e = r._initHooks.length; t < e; t++) r._initHooks[t].call(this)
}
}, i
}, _.include = function(t) {
return e(this.prototype, t), this
}, _.mergeOptions = function(t) {
return e(this.prototype.options, t), this
}, _.addInitHook = function(t) {
var e = Array.prototype.slice.call(arguments, 1),
i = "function" == typeof t ? t : function() {
this[t].apply(this, e)
};
return this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(i), this
};
var Qt = {
on: function(t, e, i) {
if ("object" == typeof t) for (var n in t) this._on(n, t[n], e);
else {
t = u(t);
for (var r = 0, o = t.length; r < o; r++) this._on(t[r], e, i)
}
return this
},
off: function(t, e, i) {
if (t) if ("object" == typeof t) for (var n in t) this._off(n, t[n], e);
else {
t = u(t);
for (var r = 0, o = t.length; r < o; r++) this._off(t[r], e, i)
} else delete this._events;
return this
},
_on: function(t, e, i) {
this._events = this._events || {};
var n = this._events[t];
n || (n = [], this._events[t] = n), i === this && (i = void 0);
for (var r = {
fn: e,
ctx: i
}, o = n, a = 0, s = o.length; a < s; a++) if (o[a].fn === e && o[a].ctx === i) return;
o.push(r)
},
_off: function(t, e, i) {
var n, r, o;
if (this._events && (n = this._events[t])) {
if (!e) {
for (r = 0, o = n.length; r < o; r++) n[r].fn = a;
return void delete this._events[t]
}
if (i === this && (i = void 0), n) for (r = 0, o = n.length; r < o; r++) {
var s = n[r];
if (s.ctx === i && s.fn === e) return s.fn = a, this._firingCount && (this._events[t] = n = n.slice()), void n.splice(r, 1)
}
}
},
fire: function(t, i, n) {
if (!this.listens(t, n)) return this;
var r = e({}, i, {
type: t,
target: this
});
if (this._events) {
var o = this._events[t];
if (o) {
this._firingCount = this._firingCount + 1 || 1;
for (var a = 0, s = o.length; a < s; a++) {
var l = o[a];
l.fn.call(l.ctx || this, r)
}
this._firingCount--
}
}
return n && this._propagateEvent(r), this
},
listens: function(t, e) {
var i = this._events && this._events[t];
if (i && i.length) return !0;
if (e) for (var n in this._eventParents) if (this._eventParents[n].listens(t, e)) return !0;
return !1
},
once: function(t, e, n) {
if ("object" == typeof t) {
for (var r in t) this.once(r, t[r], e);
return this
}
var o = i(function() {
this.off(t, e, n).off(t, o, n)
}, this);
return this.on(t, e, n).on(t, o, n)
},
addEventParent: function(t) {
return this._eventParents = this._eventParents || {}, this._eventParents[n(t)] = t, this
},
removeEventParent: function(t) {
return this._eventParents && delete this._eventParents[n(t)], this
},
_propagateEvent: function(t) {
for (var i in this._eventParents) this._eventParents[i].fire(t.type, e({
layer: t.target
}, t), !0)
}
};
Qt.addEventListener = Qt.on, Qt.removeEventListener = Qt.clearAllEventListeners = Qt.off, Qt.addOneTimeEventListener = Qt.once, Qt.fireEvent = Qt.fire, Qt.hasEventListeners = Qt.listens;
var te = _.extend(Qt);
b.prototype = {
clone: function() {
return new b(this.x, this.y)
},
add: function(t) {
return this.clone()._add(w(t))
},
_add: function(t) {
return this.x += t.x, this.y += t.y, this
},
subtract: function(t) {
return this.clone()._subtract(w(t))
},
_subtract: function(t) {
return this.x -= t.x, this.y -= t.y, this
},
divideBy: function(t) {
return this.clone()._divideBy(t)
},
_divideBy: function(t) {
return this.x /= t, this.y /= t, this
},
multiplyBy: function(t) {
return this.clone()._multiplyBy(t)
},
_multiplyBy: function(t) {
return this.x *= t, this.y *= t, this
},
scaleBy: function(t) {
return new b(this.x * t.x, this.y * t.y)
},
unscaleBy: function(t) {
return new b(this.x / t.x, this.y / t.y)
},
round: function() {
return this.clone()._round()
},
_round: function() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this
},
floor: function() {
return this.clone()._floor()
},
_floor: function() {
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
},
ceil: function() {
return this.clone()._ceil()
},
_ceil: function() {
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this
},
distanceTo: function(t) {
t = w(t);
var e = t.x - this.x,
i = t.y - this.y;
return Math.sqrt(e * e + i * i)
},
equals: function(t) {
return t = w(t), t.x === this.x && t.y === this.y
},
contains: function(t) {
return t = w(t), Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y)
},
toString: function() {
return "Point(" + s(this.x) + ", " + s(this.y) + ")"
}
}, C.prototype = {
extend: function(t) {
return t = w(t), this.min || this.max ? (this.min.x = Math.min(t.x, this.min.x), this.max.x = Math.max(t.x, this.max.x), this.min.y = Math.min(t.y, this.min.y), this.max.y = Math.max(t.y, this.max.y)) : (this.min = t.clone(), this.max = t.clone()), this
},
getCenter: function(t) {
return new b((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, t)
},
getBottomLeft: function() {
return new b(this.min.x, this.max.y)
},
getTopRight: function() {
return new b(this.max.x, this.min.y)
},
getTopLeft: function() {
return this.min
},
getBottomRight: function() {
return this.max
},
getSize: function() {
return this.max.subtract(this.min)
},
contains: function(t) {
var e, i;
return t = "number" == typeof t[0] || t instanceof b ? w(t) : x(t), t instanceof C ? (e = t.min, i = t.max) : e = i = t, e.x >= this.min.x && i.x <= this.max.x && e.y >= this.min.y && i.y <= this.max.y
},
intersects: function(t) {
t = x(t);
var e = this.min,
i = this.max,
n = t.min,
r = t.max,
o = r.x >= e.x && n.x <= i.x,
a = r.y >= e.y && n.y <= i.y;
return o && a
},
overlaps: function(t) {
t = x(t);
var e = this.min,
i = this.max,
n = t.min,
r = t.max,
o = r.x > e.x && n.x < i.x,
a = r.y > e.y && n.y < i.y;
return o && a
},
isValid: function() {
return !(!this.min || !this.max)
}
}, E.prototype = {
extend: function(t) {
var e, i, n = this._southWest,
r = this._northEast;
if (t instanceof P) e = t, i = t;
else {
if (!(t instanceof E)) return t ? this.extend(D(t) || k(t)) : this;
if (e = t._southWest, i = t._northEast, !e || !i) return this
}
return n || r ? (n.lat = Math.min(e.lat, n.lat), n.lng = Math.min(e.lng, n.lng), r.lat = Math.max(i.lat, r.lat), r.lng = Math.max(i.lng, r.lng)) : (this._southWest = new P(e.lat, e.lng), this._northEast = new P(i.lat, i.lng)), this
},
pad: function(t) {
var e = this._southWest,
i = this._northEast,
n = Math.abs(e.lat - i.lat) * t,
r = Math.abs(e.lng - i.lng) * t;
return new E(new P(e.lat - n, e.lng - r), new P(i.lat + n, i.lng + r))
},
getCenter: function() {
return new P((this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2)
},
getSouthWest: function() {
return this._southWest
},
getNorthEast: function() {
return this._northEast
},
getNorthWest: function() {
return new P(this.getNorth(), this.getWest())
},
getSouthEast: function() {
return new P(this.getSouth(), this.getEast())
},
getWest: function() {
return this._southWest.lng
},
getSouth: function() {
return this._southWest.lat
},
getEast: function() {
return this._northEast.lng
},
getNorth: function() {
return this._northEast.lat
},
contains: function(t) {
t = "number" == typeof t[0] || t instanceof P || "lat" in t ? D(t) : k(t);
var e, i, n = this._southWest,
r = this._northEast;
return t instanceof E ? (e = t.getSouthWest(), i = t.getNorthEast()) : e = i = t, e.lat >= n.lat && i.lat <= r.lat && e.lng >= n.lng && i.lng <= r.lng
},
intersects: function(t) {
t = k(t);
var e = this._southWest,
i = this._northEast,
n = t.getSouthWest(),
r = t.getNorthEast(),
o = r.lat >= e.lat && n.lat <= i.lat,
a = r.lng >= e.lng && n.lng <= i.lng;
return o && a
},
overlaps: function(t) {
t = k(t);
var e = this._southWest,
i = this._northEast,
n = t.getSouthWest(),
r = t.getNorthEast(),
o = r.lat > e.lat && n.lat < i.lat,
a = r.lng > e.lng && n.lng < i.lng;
return o && a
},
toBBoxString: function() {
return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",")
},
equals: function(t, e) {
return !!t && (t = k(t), this._southWest.equals(t.getSouthWest(), e) && this._northEast.equals(t.getNorthEast(), e))
},
isValid: function() {
return !(!this._southWest || !this._northEast)
}
}, P.prototype = {
equals: function(t, e) {
if (!t) return !1;
t = D(t);
var i = Math.max(Math.abs(this.lat - t.lat), Math.abs(this.lng - t.lng));
return i <= (void 0 === e ? 1e-9 : e)
},
toString: function(t) {
return "LatLng(" + s(this.lat, t) + ", " + s(this.lng, t) + ")"
},
distanceTo: function(t) {
return ie.distance(this, D(t))
},
wrap: function() {
return ie.wrapLatLng(this)
},
toBounds: function(t) {
var e = 180 * t / 40075017,
i = e / Math.cos(Math.PI / 180 * this.lat);
return k([this.lat - e, this.lng - i], [this.lat + e, this.lng + i])
},
clone: function() {
return new P(this.lat, this.lng, this.alt)
}
};
var ee = {
latLngToPoint: function(t, e) {
var i = this.projection.project(t),
n = this.scale(e);
return this.transformation._transform(i, n)
},
pointToLatLng: function(t, e) {
var i = this.scale(e),
n = this.transformation.untransform(t, i);
return this.projection.unproject(n)
},
project: function(t) {
return this.projection.project(t)
},
unproject: function(t) {
return this.projection.unproject(t)
},
scale: function(t) {
return 256 * Math.pow(2, t)
},
zoom: function(t) {
return Math.log(t / 256) / Math.LN2
},
getProjectedBounds: function(t) {
if (this.infinite) return null;
var e = this.projection.bounds,
i = this.scale(t),
n = this.transformation.transform(e.min, i),
r = this.transformation.transform(e.max, i);
return new C(n, r)
},
infinite: !1,
wrapLatLng: function(t) {
var e = this.wrapLng ? o(t.lng, this.wrapLng, !0) : t.lng,
i = this.wrapLat ? o(t.lat, this.wrapLat, !0) : t.lat,
n = t.alt;
return new P(i, e, n)
},
wrapLatLngBounds: function(t) {
var e = t.getCenter(),
i = this.wrapLatLng(e),
n = e.lat - i.lat,
r = e.lng - i.lng;
if (0 === n && 0 === r) return t;
var o = t.getSouthWest(),
a = t.getNorthEast(),
s = new P(o.lat - n, o.lng - r),
l = new P(a.lat - n, a.lng - r);
return new E(s, l)
}
},
ie = e({}, ee, {
wrapLng: [-180, 180],
R: 6371e3,
distance: function(t, e) {
var i = Math.PI / 180,
n = t.lat * i,
r = e.lat * i,
o = Math.sin(n) * Math.sin(r) + Math.cos(n) * Math.cos(r) * Math.cos((e.lng - t.lng) * i);
return this.R * Math.acos(Math.min(o, 1))
}
}),
ne = {
R: 6378137,
MAX_LATITUDE: 85.0511287798,
project: function(t) {
var e = Math.PI / 180,
i = this.MAX_LATITUDE,
n = Math.max(Math.min(i, t.lat), -i),
r = Math.sin(n * e);
return new b(this.R * t.lng * e, this.R * Math.log((1 + r) / (1 - r)) / 2)
},
unproject: function(t) {
var e = 180 / Math.PI;
return new P((2 * Math.atan(Math.exp(t.y / this.R)) - Math.PI / 2) * e, t.x * e / this.R)
},
bounds: function() {
var t = 6378137 * Math.PI;
return new C([-t, -t], [t, t])
}()
};
T.prototype = {
transform: function(t, e) {
return this._transform(t.clone(), e)
},
_transform: function(t, e) {
return e = e || 1, t.x = e * (this._a * t.x + this._b), t.y = e * (this._c * t.y + this._d), t
},
untransform: function(t, e) {
return e = e || 1, new b((t.x / e - this._b) / this._a, (t.y / e - this._d) / this._c)
}
};
var re, oe, ae, se, le = e({}, ie, {
code: "EPSG:3857",
projection: ne,
transformation: function() {
var t = .5 / (Math.PI * ne.R);
return S(t, .5, -t, .5)
}()
}),
ue = e({}, le, {
code: "EPSG:900913"
}),
ce = document.documentElement.style,
he = "ActiveXObject" in window,
de = he && !document.addEventListener,
pe = "msLaunchUri" in navigator && !("documentMode" in document),
fe = A("webkit"),
me = A("android"),
ge = A("android 2") || A("android 3"),
ve = !! window.opera,
_e = A("chrome"),
ye = A("gecko") && !fe && !ve && !he,
be = !_e && A("safari"),
we = A("phantom"),
Ce = "OTransition" in ce,
xe = 0 === navigator.platform.indexOf("Win"),
Ee = he && "transition" in ce,
ke = "WebKitCSSMatrix" in window && "m11" in new window.WebKitCSSMatrix && !ge,
Le = "MozPerspective" in ce,
Pe = !window.L_DISABLE_3D && (Ee || ke || Le) && !Ce && !we,
De = "undefined" != typeof orientation || A("mobile"),
Te = De && fe,
Se = De && ke,
Me = !window.PointerEvent && window.MSPointerEvent,
Ae = !(!window.PointerEvent && !Me),
Oe = !window.L_NO_TOUCH && (Ae || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch),
Ne = De && ve,
Ie = De && ye,
Re = (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1,
Fe = function() {
return !!document.createElement("canvas").getContext
}(),
ze = !(!document.createElementNS || !M("svg").createSVGRect),
Be = !ze &&
function() {
try {
var t = document.createElement("div");
t.innerHTML = '';
var e = t.firstChild;
return e.style.behavior = "url(#default#VML)", e && "object" == typeof e.adj
} catch (i) {
return !1
}
}(), Ue = (Object.freeze || Object)({
ie: he,
ielt9: de,
edge: pe,
webkit: fe,
android: me,
android23: ge,
opera: ve,
chrome: _e,
gecko: ye,
safari: be,
phantom: we,
opera12: Ce,
win: xe,
ie3d: Ee,
webkit3d: ke,
gecko3d: Le,
any3d: Pe,
mobile: De,
mobileWebkit: Te,
mobileWebkit3d: Se,
msPointer: Me,
pointer: Ae,
touch: Oe,
mobileOpera: Ne,
mobileGecko: Ie,
retina: Re,
canvas: Fe,
svg: ze,
vml: Be
}), He = Me ? "MSPointerDown" : "pointerdown", qe = Me ? "MSPointerMove" : "pointermove", je = Me ? "MSPointerUp" : "pointerup", Ve = Me ? "MSPointerCancel" : "pointercancel", We = ["INPUT", "SELECT", "OPTION"], Ze = {}, Ge = !1, $e = 0, Je = Me ? "MSPointerDown" : Ae ? "pointerdown" : "touchstart", Ke = Me ? "MSPointerUp" : Ae ? "pointerup" : "touchend", Ye = "_leaflet_", Xe = "_leaflet_events", Qe = xe && _e ? 2 * window.devicePixelRatio : ye ? window.devicePixelRatio : 1, ti = {}, ei = (Object.freeze || Object)({
on: V,
off: W,
stopPropagation: $,
disableScrollPropagation: J,
disableClickPropagation: K,
preventDefault: Y,
stop: X,
getMousePosition: Q,
getWheelDelta: tt,
fakeStop: et,
skipped: it,
isExternalTarget: nt,
addListener: V,
removeListener: W
}), ii = yt(["transform", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]), ni = yt(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]), ri = "webkitTransition" === ni || "OTransition" === ni ? ni + "End" : "transitionend";
if ("onselectstart" in document) oe = function() {
V(window, "selectstart", Y)
}, ae = function() {
W(window, "selectstart", Y)
};
else {
var oi = yt(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
oe = function() {
if (oi) {
var t = document.documentElement.style;
se = t[oi], t[oi] = "none"
}
}, ae = function() {
oi && (document.documentElement.style[oi] = se, se = void 0)
}
}
var ai, si, li, ui = (Object.freeze || Object)({
TRANSFORM: ii,
TRANSITION: ni,
TRANSITION_END: ri,
get: ot,
getStyle: at,
create: st,
remove: lt,
empty: ut,
toFront: ct,
toBack: ht,
hasClass: dt,
addClass: pt,
removeClass: ft,
setClass: mt,
getClass: gt,
setOpacity: vt,
testProp: yt,
setTransform: bt,
setPosition: wt,
getPosition: Ct,
disableTextSelection: oe,
enableTextSelection: ae,
disableImageDrag: xt,
enableImageDrag: Et,
preventOutline: kt,
restoreOutline: Lt
}),
ci = te.extend({
run: function(t, e, i, n) {
this.stop(), this._el = t, this._inProgress = !0, this._duration = i || .25, this._easeOutPower = 1 / Math.max(n || .5, .2), this._startPos = Ct(t), this._offset = e.subtract(this._startPos), this._startTime = +new Date, this.fire("start"), this._animate()
},
stop: function() {
this._inProgress && (this._step(!0), this._complete())
},
_animate: function() {
this._animId = g(this._animate, this), this._step()
},
_step: function(t) {
var e = +new Date - this._startTime,
i = 1e3 * this._duration;
e < i ? this._runFrame(this._easeOut(e / i), t) : (this._runFrame(1), this._complete())
},
_runFrame: function(t, e) {
var i = this._startPos.add(this._offset.multiplyBy(t));
e && i._round(), wt(this._el, i), this.fire("step")
},
_complete: function() {
v(this._animId), this._inProgress = !1, this.fire("end")
},
_easeOut: function(t) {
return 1 - Math.pow(1 - t, this._easeOutPower)
}
}),
hi = ((Object.freeze || Object)({
simplify: Pt,
pointToSegmentDistance: Dt,
closestPointOnSegment: Tt,
clipSegment: Ot,
_getEdgeIntersection: Nt,
_getBitCode: It,
_sqClosestPointOnSegment: Ft,
isFlat: zt,
_flat: Bt
}), (Object.freeze || Object)({
clipPolygon: Ut
}), {
project: function(t) {
return new b(t.lng, t.lat)
},
unproject: function(t) {
return new P(t.y, t.x)
},
bounds: new C([-180, -90], [180, 90])
}),
di = {
R: 6378137,
R_MINOR: 6356752.314245179,
bounds: new C([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),
project: function(t) {
var e = Math.PI / 180,
i = this.R,
n = t.lat * e,
r = this.R_MINOR / i,
o = Math.sqrt(1 - r * r),
a = o * Math.sin(n),
s = Math.tan(Math.PI / 4 - n / 2) / Math.pow((1 - a) / (1 + a), o / 2);
return n = -i * Math.log(Math.max(s, 1e-10)), new b(t.lng * e * i, n)
},
unproject: function(t) {
for (var e, i = 180 / Math.PI, n = this.R, r = this.R_MINOR / n, o = Math.sqrt(1 - r * r), a = Math.exp(-t.y / n), s = Math.PI / 2 - 2 * Math.atan(a), l = 0, u = .1; l < 15 && Math.abs(u) > 1e-7; l++) e = o * Math.sin(s), e = Math.pow((1 - e) / (1 + e), o / 2), u = Math.PI / 2 - 2 * Math.atan(a * e) - s, s += u;
return new P(s * i, t.x * i / n)
}
},
pi = ((Object.freeze || Object)({
LonLat: hi,
Mercator: di,
SphericalMercator: ne
}), e({}, ie, {
code: "EPSG:3395",
projection: di,
transformation: function() {
var t = .5 / (Math.PI * di.R);
return S(t, .5, -t, .5)
}()
})),
fi = e({}, ie, {
code: "EPSG:4326",
projection: hi,
transformation: S(1 / 180, 1, -1 / 180, .5)
}),
mi = e({}, ee, {
projection: hi,
transformation: S(1, 0, -1, 0),
scale: function(t) {
return Math.pow(2, t)
},
zoom: function(t) {
return Math.log(t) / Math.LN2
},
distance: function(t, e) {
var i = e.lng - t.lng,
n = e.lat - t.lat;
return Math.sqrt(i * i + n * n)
},
infinite: !0
});
ee.Earth = ie, ee.EPSG3395 = pi, ee.EPSG3857 = le, ee.EPSG900913 = ue, ee.EPSG4326 = fi, ee.Simple = mi;
var gi = window.L;
window.L = t, Object.freeze = jt, t.version = qt, t.noConflict = Ht, t.Browser = Ue, t.Evented = te, t.Util = Xt, t.Class = _, t.extend = e, t.bind = i, t.stamp = n, t.setOptions = c, t.DomEvent = ei, t.DomUtil = ui, t.PosAnimation = ci, t.Point = b, t.point = w, t.Bounds = C, t.bounds = x, t.Transformation = T, t.transformation = S, t.LatLng = P, t.latLng = D, t.LatLngBounds = E, t.latLngBounds = k, t.CRS = ee
}), function(t, e) {
"object" == typeof exports && "undefined" != typeof module ? e(exports, require("leaflet")) : "function" == typeof define && define.amd ? define(["exports", "leaflet"], e) : e((t.L = t.L || {}, t.L.esri = t.L.esri || {}), t.L)
}(this, function(t, e) {
"use strict";
function i(t) {
var e = "";
t.f = t.f || "json";
for (var i in t) if (t.hasOwnProperty(i)) {
var n, r = t[i],
o = Object.prototype.toString.call(r);
e.length && (e += "&"), n = "[object Array]" === o ? "[object Object]" === Object.prototype.toString.call(r[0]) ? JSON.stringify(r) : r.join(",") : "[object Object]" === o ? JSON.stringify(r) : "[object Date]" === o ? r.valueOf() : r, e += encodeURIComponent(i) + "=" + encodeURIComponent(n)
}
return e
}
function n(t, i) {
var n = new window.XMLHttpRequest;
return n.onerror = function(r) {
n.onreadystatechange = e.Util.falseFn, t.call(i, {
error: {
code: 500,
message: "XMLHttpRequest error"
}
}, null)
}, n.onreadystatechange = function() {
var r, o;
if (4 === n.readyState) {
try {
r = JSON.parse(n.responseText)
} catch (a) {
r = null, o = {
code: 500,
message: "Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."
}
}!o && r.error && (o = r.error, r = null), n.onerror = e.Util.falseFn, t.call(i, o, r)
}
}, n.ontimeout = function() {
this.onerror()
}, n
}
function r(t, e, r, o) {
var a = n(r, o);
return a.open("POST", t), "undefined" != typeof o && null !== o && "undefined" != typeof o.options && (a.timeout = o.options.timeout), a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), a.send(i(e)), a
}
function o(t, e, r, o) {
var a = n(r, o);
return a.open("GET", t + "?" + i(e), !0), "undefined" != typeof o && null !== o && "undefined" != typeof o.options && (a.timeout = o.options.timeout), a.send(null), a
}
function a(t, e, r, o) {
var a = i(e),
l = n(r, o),
u = (t + "?" + a).length;
if (u <= 2e3 && q.cors ? l.open("GET", t + "?" + a) : u > 2e3 && q.cors && (l.open("POST", t), l.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")), "undefined" != typeof o && null !== o && "undefined" != typeof o.options && (l.timeout = o.options.timeout), u <= 2e3 && q.cors) l.send(null);
else {
if (!(u > 2e3 && q.cors)) return u <= 2e3 && !q.cors ? s(t, e, r, o) : void S("a request to " + t + " was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html");
l.send(a)
}
return l
}
function s(t, n, r, o) {
window._EsriLeafletCallbacks = window._EsriLeafletCallbacks || {};
var a = "c" + V;
n.callback = "window._EsriLeafletCallbacks." + a, window._EsriLeafletCallbacks[a] = function(t) {
if (window._EsriLeafletCallbacks[a] !== !0) {
var e, i = Object.prototype.toString.call(t);
"[object Object]" !== i && "[object Array]" !== i && (e = {
error: {
code: 500,
message: "Expected array or object as JSONP response"
}
}, t = null), !e && t.error && (e = t, t = null), r.call(o, e, t), window._EsriLeafletCallbacks[a] = !0
}
};
var s = e.DomUtil.create("script", null, document.body);
return s.type = "text/javascript", s.src = t + "?" + i(n), s.id = a, V++, {
id: a,
url: s.src,
abort: function() {
window._EsriLeafletCallbacks._callback[a]({
code: 0,
message: "Request aborted."
})
}
}
}
function l(t, e) {
for (var i = 0; i < t.length; i++) if (t[i] !== e[i]) return !1;
return !0
}
function u(t) {
return l(t[0], t[t.length - 1]) || t.push(t[0]), t
}
function c(t) {
var e, i = 0,
n = 0,
r = t.length,
o = t[n];
for (n; n < r - 1; n++) e = t[n + 1], i += (e[0] - o[0]) * (e[1] + o[1]), o = e;
return i >= 0
}
function h(t, e, i, n) {
var r = (n[0] - i[0]) * (t[1] - i[1]) - (n[1] - i[1]) * (t[0] - i[0]),
o = (e[0] - t[0]) * (t[1] - i[1]) - (e[1] - t[1]) * (t[0] - i[0]),
a = (n[1] - i[1]) * (e[0] - t[0]) - (n[0] - i[0]) * (e[1] - t[1]);
if (0 !== a) {
var s = r / a,
l = o / a;
if (s >= 0 && s <= 1 && l >= 0 && l <= 1) return !0
}
return !1
}
function d(t, e) {
for (var i = 0; i < t.length - 1; i++) for (var n = 0; n < e.length - 1; n++) if (h(t[i], t[i + 1], e[n], e[n + 1])) return !0;
return !1
}
function p(t, e) {
for (var i = !1, n = -1, r = t.length, o = r - 1; ++n < r; o = n)(t[n][1] <= e[1] && e[1] < t[o][1] || t[o][1] <= e[1] && e[1] < t[n][1]) && e[0] < (t[o][0] - t[n][0]) * (e[1] - t[n][1]) / (t[o][1] - t[n][1]) + t[n][0] && (i = !i);
return i
}
function f(t, e) {
var i = d(t, e),
n = p(t, e[0]);
return !(i || !n)
}
function m(t) {
for (var e, i, n, r = [], o = [], a = 0; a < t.length; a++) {
var s = u(t[a].slice(0));
if (!(s.length < 4)) if (c(s)) {
var l = [s];
r.push(l)
} else o.push(s)
}
for (var h = []; o.length;) {
n = o.pop();
var p = !1;
for (e = r.length - 1; e >= 0; e--) if (i = r[e][0], f(i, n)) {
r[e].push(n), p = !0;
break
}
p || h.push(n)
}
for (; h.length;) {
n = h.pop();
var m = !1;
for (e = r.length - 1; e >= 0; e--) if (i = r[e][0], d(i, n)) {
r[e].push(n), m = !0;
break
}
m || r.push([n.reverse()])
}
return 1 === r.length ? {
type: "Polygon",
coordinates: r[0]
} : {
type: "MultiPolygon",
coordinates: r
}
}
function g(t) {
var e = [],
i = t.slice(0),
n = u(i.shift().slice(0));
if (n.length >= 4) {
c(n) || n.reverse(), e.push(n);
for (var r = 0; r < i.length; r++) {
var o = u(i[r].slice(0));
o.length >= 4 && (c(o) && o.reverse(), e.push(o))
}
}
return e
}
function v(t) {
for (var e = [], i = 0; i < t.length; i++) for (var n = g(t[i]), r = n.length - 1; r >= 0; r--) {
var o = n[r].slice(0);
e.push(o)
}
return e
}
function _(t) {
var e = {};
for (var i in t) t.hasOwnProperty(i) && (e[i] = t[i]);
return e
}
function y(t, e) {
var i = {};
return "number" == typeof t.x && "number" == typeof t.y && (i.type = "Point", i.coordinates = [t.x, t.y]), t.points && (i.type = "MultiPoint", i.coordinates = t.points.slice(0)), t.paths && (1 === t.paths.length ? (i.type = "LineString", i.coordinates = t.paths[0].slice(0)) : (i.type = "MultiLineString", i.coordinates = t.paths.slice(0))), t.rings && (i = m(t.rings.slice(0))), (t.geometry || t.attributes) && (i.type = "Feature", i.geometry = t.geometry ? y(t.geometry) : null, i.properties = t.attributes ? _(t.attributes) : null, t.attributes && (i.id = t.attributes[e] || t.attributes.OBJECTID || t.attributes.FID)), i
}
function b(t, e) {
e = e || "OBJECTID";
var i, n = {
wkid: 4326
},
r = {};
switch (t.type) {
case "Point":
r.x = t.coordinates[0], r.y = t.coordinates[1], r.spatialReference = n;
break;
case "MultiPoint":
r.points = t.coordinates.slice(0), r.spatialReference = n;
break;
case "LineString":
r.paths = [t.coordinates.slice(0)], r.spatialReference = n;
break;
case "MultiLineString":
r.paths = t.coordinates.slice(0), r.spatialReference = n;
break;
case "Polygon":
r.rings = g(t.coordinates.slice(0)), r.spatialReference = n;
break;
case "MultiPolygon":
r.rings = v(t.coordinates.slice(0)), r.spatialReference = n;
break;
case "Feature":
t.geometry && (r.geometry = b(t.geometry, e)), r.attributes = t.properties ? _(t.properties) : {}, t.id && (r.attributes[e] = t.id);
break;
case "FeatureCollection":
for (r = [], i = 0; i < t.features.length; i++) r.push(b(t.features[i], e));
break;
case "GeometryCollection":
for (r = [], i = 0; i < t.geometries.length; i++) r.push(b(t.geometries[i], e))
}
return r
}
function w(t, e) {
return b(t, e)
}
function C(t, e) {
return y(t, e)
}
function x(t) {
var e = {};
for (var i in t) t.hasOwnProperty(i) && (e[i] = t[i]);
return e
}
function E(t) {
if ("NaN" !== t.xmin && "NaN" !== t.ymin && "NaN" !== t.xmax && "NaN" !== t.ymax) {
var i = e.latLng(t.ymin, t.xmin),
n = e.latLng(t.ymax, t.xmax);
return e.latLngBounds(i, n)
}
return null
}
function k(t) {
return t = e.latLngBounds(t), {
xmin: t.getSouthWest().lng,
ymin: t.getSouthWest().lat,
xmax: t.getNorthEast().lng,
ymax: t.getNorthEast().lat,
spatialReference: {
wkid: 4326
}
}
}
function L(t, e) {
var i, n = t.features || t.results,
r = n.length;
if (e) i = e;
else if (t.objectIdFieldName) i = t.objectIdFieldName;
else if (t.fields) {
for (var o = 0; o <= t.fields.length - 1; o++) if ("esriFieldTypeOID" === t.fields[o].type) {
i = t.fields[o].name;
break
}
} else if (r) for (var a in n[0].attributes) if (a.match(/^(OBJECTID|FID|OID|ID)$/i)) {
i = a;
break
}
var s = {
type: "FeatureCollection",
features: []
};
if (r) for (var l = n.length - 1; l >= 0; l--) {
var u = C(n[l], i);
s.features.push(u)
}
return s
}
function P(t) {
return t = e.Util.trim(t), "/" !== t[t.length - 1] && (t += "/"), t
}
function D(t) {
return /^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i.test(t)
}
function T(t) {
var e;
switch (t) {
case "Point":
e = "esriGeometryPoint";
break;
case "MultiPoint":
e = "esriGeometryMultipoint";
break;
case "LineString":
e = "esriGeometryPolyline";
break;
case "MultiLineString":
e = "esriGeometryPolyline";
break;
case "Polygon":
e = "esriGeometryPolygon";
break;
case "MultiPolygon":
e = "esriGeometryPolygon"
}
return e
}
function S() {
console && console.warn && console.warn.apply(console, arguments)
}
function M(t) {
return t.getSize().x - j.attributionWidthOffset + "px"
}
function A(t) {
if (t.attributionControl && !t.attributionControl._esriAttributionAdded) {
t.attributionControl.setPrefix('Leaflet | Powered by Esri');
var i = document.createElement("style");
i.type = "text/css", i.innerHTML = ".esri-truncated-attribution:hover {white-space: normal;}", document.getElementsByTagName("head")[0].appendChild(i), e.DomUtil.addClass(t.attributionControl._container, "esri-truncated-attribution:hover");
var n = document.createElement("style");
n.type = "text/css", n.innerHTML = ".esri-truncated-attribution {vertical-align: -3px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: inline-block;transition: 0s white-space;transition-delay: 1s;max-width: " + M(t) + ";}", document.getElementsByTagName("head")[0].appendChild(n), e.DomUtil.addClass(t.attributionControl._container, "esri-truncated-attribution"), t.on("resize", function(e) {
t.attributionControl._container.style.maxWidth = M(e.target)
}), t.attributionControl._esriAttributionAdded = !0
}
}
function O(t, i) {
s(t, {}, e.Util.bind(function(t, n) {
if (!t) {
i._esriAttributions = [];
for (var r = 0; r < n.contributors.length; r++) for (var o = n.contributors[r], a = 0; a < o.coverageAreas.length; a++) {
var s = o.coverageAreas[a],
l = e.latLng(s.bbox[0], s.bbox[1]),
u = e.latLng(s.bbox[2], s.bbox[3]);
i._esriAttributions.push({
attribution: o.attribution,
score: s.score,
bounds: e.latLngBounds(l, u),
minZoom: s.zoomMin,
maxZoom: s.zoomMax
})
}
i._esriAttributions.sort(function(t, e) {
return e.score - t.score
});
var c = {
target: i
};
N(c)
}
}, this))
}
function N(t) {
var i = t.target,
n = i._esriAttributions;
if (i && i.attributionControl && n) {
for (var r = "", o = i.getBounds(), a = e.latLngBounds(o.getSouthWest().wrap(), o.getNorthEast().wrap()), s = i.getZoom(), l = 0; l < n.length; l++) {
var u = n[l],
c = u.attribution;
!r.match(c) && u.bounds.intersects(a) && s >= u.minZoom && s <= u.maxZoom && (r += ", " + c)
}
r = r.substr(2);
var h = i.attributionControl._container.querySelector(".esri-dynamic-attribution");
h.innerHTML = r, h.style.maxWidth = M(i), i.fire("attributionupdated", {
attribution: r
})
}
}
function I(t) {
return new $(t)
}
function R(t) {
return new J(t)
}
function F(t) {
return new K(t)
}
function z(t) {
return new Y(t)
}
var B = ("default" in e ? e["default"] : e, "2.0.8"),
U = window.XMLHttpRequest && "withCredentials" in new window.XMLHttpRequest,
H = "" === document.documentElement.style.pointerEvents,
q = {
cors: U,
pointerEvents: H
},
j = {
attributionWidthOffset: 55
},
V = 0,
W = q.cors ? o : s;
W.CORS = o, W.JSONP = s;
var Z = {
request: a,
get: W,
post: r
},
G = {
shallowClone: x,
warn: S,
cleanUrl: P,
isArcgisOnline: D,
geojsonTypeToArcGIS: T,
responseToFeatureCollection: L,
geojsonToArcGIS: w,
arcgisToGeoJSON: C,
boundsToExtent: k,
extentToBounds: E,
calcAttributionWidth: M,
setEsriAttribution: A,
_getAttributionData: O,
_updateMapAttribution: N
},
$ = e.Class.extend({
options: {
proxy: !1,
useCors: U
},
generateSetter: function(t, i) {
return e.Util.bind(function(e) {
return this.params[t] = e, this
}, i)
},
initialize: function(t) {
if (t.request && t.options ? (this._service = t, e.Util.setOptions(this, t.options)) : (e.Util.setOptions(this, t), this.options.url = P(t.url)), this.params = e.Util.extend({}, this.params || {}), this.setters) for (var i in this.setters) {
var n = this.setters[i];
this[i] = this.generateSetter(n, this)
}
},
token: function(t) {
return this._service ? this._service.authenticate(t) : this.params.token = t, this
},
request: function(t, e) {
return this._service ? this._service.request(this.path, this.params, t, e) : this._request("request", this.path, this.params, t, e)
},
_request: function(t, e, i, n, r) {
var o = this.options.proxy ? this.options.proxy + "?" + this.options.url + e : this.options.url + e;
return "get" !== t && "request" !== t || this.options.useCors ? Z[t](o, i, n, r) : Z.get.JSONP(o, i, n, r)
}
}),
J = $.extend({
setters: {
offset: "resultOffset",
limit: "resultRecordCount",
fields: "outFields",
precision: "geometryPrecision",
featureIds: "objectIds",
returnGeometry: "returnGeometry",
token: "token"
},
path: "query",
params: {
returnGeometry: !0,
where: "1=1",
outSr: 4326,
outFields: "*"
},
within: function(t) {
return this._setGeometry(t), this.params.spatialRel = "esriSpatialRelContains", this
},
intersects: function(t) {
return this._setGeometry(t), this.params.spatialRel = "esriSpatialRelIntersects", this
},
contains: function(t) {
return this._setGeometry(t), this.params.spatialRel = "esriSpatialRelWithin", this
},
crosses: function(t) {
return this._setGeometry(t), this.params.spatialRel = "esriSpatialRelCrosses", this
},
touches: function(t) {
return this._setGeometry(t), this.params.spatialRel = "esriSpatialRelTouches", this
},
overlaps: function(t) {
return this._setGeometry(t), this.params.spatialRel = "esriSpatialRelOverlaps", this
},
bboxIntersects: function(t) {
return this._setGeometry(t), this.params.spatialRel = "esriSpatialRelEnvelopeIntersects", this
},
indexIntersects: function(t) {
return this._setGeometry(t), this.params.spatialRel = "esriSpatialRelIndexIntersects", this
},
nearby: function(t, i) {
return t = e.latLng(t), this.params.geometry = [t.lng, t.lat], this.params.geometryType = "esriGeometryPoint", this.params.spatialRel = "esriSpatialRelIntersects", this.params.units = "esriSRUnit_Meter", this.params.distance = i, this.params.inSr = 4326, this
},
where: function(t) {
return this.params.where = t, this
},
between: function(t, e) {
return this.params.time = [t.valueOf(), e.valueOf()], this
},
simplify: function(t, e) {
var i = Math.abs(t.getBounds().getWest() - t.getBounds().getEast());
return this.params.maxAllowableOffset = i / t.getSize().y * e, this
},
orderBy: function(t, e) {
return e = e || "ASC", this.params.orderByFields = this.params.orderByFields ? this.params.orderByFields + "," : "", this.params.orderByFields += [t, e].join(" "), this
},
run: function(t, e) {
return this._cleanParams(), this.options.isModern || D(this.options.url) ? (this.params.f = "geojson", this.request(function(i, n) {
this._trapSQLerrors(i), t.call(e, i, n, n)
}, this)) : this.request(function(i, n) {
this._trapSQLerrors(i), t.call(e, i, n && L(n), n)
}, this)
},
count: function(t, e) {
return this._cleanParams(), this.params.returnCountOnly = !0, this.request(function(e, i) {
t.call(this, e, i && i.count, i)
}, e)
},
ids: function(t, e) {
return this._cleanParams(), this.params.returnIdsOnly = !0, this.request(function(e, i) {
t.call(this, e, i && i.objectIds, i)
}, e)
},
bounds: function(t, e) {
return this._cleanParams(), this.params.returnExtentOnly = !0, this.request(function(i, n) {
n && n.extent && E(n.extent) ? t.call(e, i, E(n.extent), n) : (i = {
message: "Invalid Bounds"
}, t.call(e, i, null, n))
}, e)
},
pixelSize: function(t) {
var i = e.point(t);
return this.params.pixelSize = [i.x, i.y], this
},
layer: function(t) {
return this.path = t + "/query", this
},
_trapSQLerrors: function(t) {
t && "400" === t.code && S("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")
},
_cleanParams: function() {
delete this.params.returnIdsOnly, delete this.params.returnExtentOnly, delete this.params.returnCountOnly
},
_setGeometry: function(t) {
return this.params.inSr = 4326, t instanceof e.LatLngBounds ? (this.params.geometry = k(t), void(this.params.geometryType = "esriGeometryEnvelope")) : (t.getLatLng && (t = t.getLatLng()), t instanceof e.LatLng && (t = {
type: "Point",
coordinates: [t.lng, t.lat]
}), t instanceof e.GeoJSON && (t = t.getLayers()[0].feature.geometry, this.params.geometry = w(t), this.params.geometryType = T(t.type)), t.toGeoJSON && (t = t.toGeoJSON()), "Feature" === t.type && (t = t.geometry), "Point" === t.type || "LineString" === t.type || "Polygon" === t.type || "MultiPolygon" === t.type ? (this.params.geometry = w(t), void(this.params.geometryType = T(t.type))) : void S("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object"))
}
}),
K = $.extend({
setters: {
contains: "contains",
text: "searchText",
fields: "searchFields",
spatialReference: "sr",
sr: "sr",
layers: "layers",
returnGeometry: "returnGeometry",
maxAllowableOffset: "maxAllowableOffset",
precision: "geometryPrecision",
dynamicLayers: "dynamicLayers",
returnZ: "returnZ",
returnM: "returnM",
gdbVersion: "gdbVersion",
token: "token"
},
path: "find",
params: {
sr: 4326,
contains: !0,
returnGeometry: !0,
returnZ: !0,
returnM: !1
},
layerDefs: function(t, e) {
return this.params.layerDefs = this.params.layerDefs ? this.params.layerDefs + ";" : "", this.params.layerDefs += [t, e].join(":"), this
},
simplify: function(t, e) {
var i = Math.abs(t.getBounds().getWest() - t.getBounds().getEast());
return this.params.maxAllowableOffset = i / t.getSize().y * e, this
},
run: function(t, e) {
return this.request(function(i, n) {
t.call(e, i, n && L(n), n)
}, e)
}
}),
Y = $.extend({
path: "identify",
between: function(t, e) {
return this.params.time = [t.valueOf(), e.valueOf()], this
}
});
t.VERSION = B, t.Support = q, t.options = j, t.Util = G, t.get = W, t.post = r, t.request = a, t.Task = $, t.task = I, t.Query = J, t.query = R, t.Find = K, t.find = F, t.Identify = Y, t.identify = z
});
var mars3d = {
version: "1.1",
name: "Cesium三维地图框架",
author: "木遥(QQ:346819890)"
},
scope = "undefined" != typeof window ? window : "undefined" != typeof self ? self : {};
scope.mars3d = mars3d, function(t, e) {
"use strict";
function i(t) {
return "complete" === t.readyState || "loaded" === t.readyState
}
function n(t, i, n) {
var r = e.createElement("link");
r.rel = "stylesheet", a(r, n, "css"), r.async = !0, r.href = t, h.appendChild(r)
}
function r(t, i, n) {
var r = e.createElement("script");
r.charset = "utf-8", a(r, n, "js"), r.async = !i.sync, r.src = t, h.appendChild(r)
}
function o(t, e) {
var i;
t.sheet && (i = !0), setTimeout(function() {
i ? e() : o(t, e)
}, 20)
}
function a(t, e, n) {
function r() {
t.onload = t.onreadystatechange = null, t = null, e()
}
var a = "onload" in t,
s = "css" === n;
return !s || !d && a ? void(a ? (t.onload = r, t.onerror = function() {
t.onerror = null, "css" == n ? console.error("该css文件不存在:" + t.href) : console.error("该js文件不存在:" + t.src), r()
}) : t.onreadystatechange = function() {
i(t) && r()
}) : void setTimeout(function() {
o(t, e)
}, 1)
}
function s(t, e, i, o) {
function a() {
var i = e.indexOf(t);
i > -1 && e.splice(i, 1), 0 === e.length && o()
}
return t ? void(c.test(t) ? n(t, i, a) : r(t, i, a)) : void setTimeout(function() {
a()
})
}
function l(t, e, i) {
var n = function() {
i && i()
};
if (t = Array.prototype.slice.call(t || []), 0 === t.length) return void n();
for (var r = 0, o = t.length; r < o; r++) s(t[r], t, e, n)
}
function u(e, n) {
if (i(e)) n();
else {
var r = 1500,
o = !1;
t.addEventListener("load", function() {
o || (n(), o = !0)
}), setTimeout(function() {
o || (n(), o = !0)
}, r)
}
}
var c = new RegExp("\\.css"),
h = e.head || e.getElementsByTagName("head")[0],
d = +navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i, "$1") < 536,
p = {
async: function(t, i) {
u(e, function() {
l(t, {}, i)
})
},
sync: function(t, i) {
u(e, function() {
l(t, {
sync: !0
}, i)
})
}
};
return t.Loader = p, p
}(window, document), mars3d.widget = function() {
function t(t, e, i) {
y = t, e = e || {}, x = i || "", C = [], _ = e.defaultOptions || {
windowOptions: {
position: "rt",
maxmin: !1,
resize: !0
},
autoDisable: !0,
disableOhter: !0
}, v = e.version, "time" == v && (v = (new Date).getTime());
var r = e.widgetsAtStart;
if (r && r.length > 0) for (var o = 0; o < r.length; o++) {
var a = r[o];
a.hasOwnProperty("uri") && "" != a.uri ? a.hasOwnProperty("visible") && !a.visible || (a.autoDisable = !1, a.openAtStart = !0, a._nodebug = !0, n(a), C.push(a)) : console.log("widget未配置uri:" + JSON.stringify(a))
}
// var s = e["debugger"];
if (s) {
var l = '
widget测试栏
';
$("body").append(l)
}
if (r = e.widgets, r && r.length > 0) for (var o = 0; o < r.length; o++) {
var a = r[o];
if ("group" == a.type) {
for (var l = '
', u = 0; u < a.children.length; u++) {
var h = a.children[u];
n(h), l += "
", s && !a._nodebug && $("#widget-testbar").append(l)
} else {
if (n(a), s && !a._nodebug) {
var l = ' ";
$("#widget-testbar").append(l)
}
if (!a.hasOwnProperty("uri") || "" == a.uri) {
console.log("widget未配置uri:" + JSON.stringify(a));
continue
}
C.push(a)
}
}
for (var o = 0; o < C.length; o++) {
var a = C[o];
a.openAtStart && E.push(a)
}
$(window).resize(function() {
for (var t = 0; t < C.length; t++) {
var e = C[t];
e._class && e._class.indexResize()
}
}), c()
}
function e() {
return i(_.windowOptions)
}
function i(t, e) {
if (null == t || "object" != typeof t) return t;
if (t.constructor != Object && t.constructor != Array) return t;
if (t.constructor == Date || t.constructor == RegExp || t.constructor == Function || t.constructor == String || t.constructor == Number || t.constructor == Boolean) return new t.constructor(t);
e = e || new t.constructor;
for (var n in t) e[n] = "undefined" == typeof e[n] ? i(t[n], null) : e[n];
return e
}
function n(t) {
if (_) for (var e in _)"windowOptions" == e || t.hasOwnProperty(e) || (t[e] = _[e]);
t.path = p(x + t.uri), t.name = t.name || t.label
}
function r(e, i) {
null == y && e.viewer && t(e.viewer), "string" == typeof e && (e = {
uri: e
}, null != i && (e.disableOhter = !i));
for (var r, o = 0; o < C.length; o++) {
var a = C[o];
if (e.uri == a.uri || a.id && e.uri == a.id) {
r = a;
for (var s in e)"uri" != s && (r[s] = e[s]);
break
}
}
return null == r && (n(e), r = e, C.push(e)), r.disableOhter && (r.reStart ? u() : u(r.uri)), r._class ? r._class.activateBase() : (E.push(r), 1 == E.length && c()), r
}
function o(t) {
for (var e = 0; e < C.length; e++) {
var i = C[e];
if (t == i.uri || t == i.id) return i
}
}
function a(t) {
var e = o(t);
return e ? e._class : null
}
function s(t) {
var e = a(t);
return null != e && e.isActivate
}
function l(t) {
for (var e = 0; e < C.length; e++) {
var i = C[e];
if (i._class && (t == i.uri || t == i.id)) {
i._class.disableBase();
break
}
}
}
function u(t) {
for (var e = 0; e < C.length; e++) {
var i = C[e];
i.autoDisable && (!t || t != i.uri && t != i.id) && i._class && i._class.disableBase()
}
}
function c() {
if (0 != E.length) {
if (w) return void setTimeout(c, 500);
w = !0, b = E[0];
var t = b.uri;
v && (t += t.indexOf("?") == -1 ? "?time=" + v : "&time=" + v), Loader.async([x + t], function() {
w = !1, E.shift(), c()
})
}
}
function h(t) {
if (null != b) return b._class = new t(b, y), b._class.activateBase(), b._class;
for (var e = d(), i = 0; i < C.length; i++) {
var n = C[i];
if (e.endsWith(n.uri)) return n._class = new t(n, y), n._class.activateBase(), n._class
}
}
function d() {
for (var t, e = document.scripts, i = e.length - 1; i >= 0; i--) if (t = e[i].src, null != t && "" != t && t.indexOf("widgets") != -1) return t;
return ""
}
function p(t) {
var e = t.lastIndexOf("/");
return t.substring(0, e + 1)
}
function f() {
$("#widget-testbar").remove()
}
function m() {
return v
}
function g() {
return x
}
var v, _, y, b, w, C = [],
x = "",
E = [];
return {
init: t,
isActivate: s,
activate: r,
disable: l,
disableAll: u,
getWidget: o,
getClass: a,
removeDebugeBar: f,
bindClass: h,
getDefWindowOptions: e,
getCacheVersion: m,
getBasePath: g
}
}(),
Cesium.defineProperties(ArcTileImageryProvider.prototype, {
url: {
get: function() {
return this._url
}
},
token: {
get: function() {
return this._token
}
},
proxy: {
get: function() {
return this._proxy
}
},
tileWidth: {
get: function() {
if (!this._ready) throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");
return this._tileWidth
}
},
tileHeight: {
get: function() {
if (!this._ready) throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");
return this._tileHeight
}
},
maximumLevel: {
get: function() {
if (!this._ready) throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");
return this._maximumLevel
}
},
minimumLevel: {
get: function() {
if (!this._ready) throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");
return 0
}
},
tilingScheme: {
get: function() {
if (!this._ready) throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");
return this._tilingScheme
}
},
rectangle: {
get: function() {
if (!this._ready) throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");
return this._rectangle
}
},
tileDiscardPolicy: {
get: function() {
if (!this._ready) throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");
return this._tileDiscardPolicy
}
},
errorEvent: {
get: function() {
return this._errorEvent
}
},
ready: {
get: function() {
return this._ready
}
},
readyPromise: {
get: function() {
return this._readyPromise.promise
}
},
credit: {
get: function() {
return this._credit
}
},
usingPrecachedTiles: {
get: function() {
return this._useTiles
}
},
hasAlphaChannel: {
get: function() {
return !0
}
},
layers: {
get: function() {
return this._layers
}
}
}), ArcTileImageryProvider.prototype.getTileCredits = function(t, e, i) {}, ArcTileImageryProvider.prototype.padLeft0 = function(t, e) {
t = String(t);
for (var i = t.length; i < e;) t = "0" + t, i++;
return t
}, ArcTileImageryProvider.prototype.requestImage = function(t, e, i) {
if (!this._ready) throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");
var n = "L" + this.padLeft0(i.toString(), 2),
r = "R" + this.padLeft0(e.toString(16), 8),
o = "C" + this.padLeft0(t.toString(16), 8);
this._isUpper && (n = n.toUpperCase(), r = r.toUpperCase(), o = o.toUpperCase());
var a = this._url + n + "/" + r + "/" + o + this._imgType;
return Cesium.ImageryProvider.loadImage(this, a)
}, mars3d.latlng = function() {
function t(t, e) {
var i, n = t.pick(e);
if (t.pickPositionSupported && Cesium.defined(n) && (i = t.pickPosition(e))) {
var r = t.globe.ellipsoid.cartesianToCartographic(i);
if (r.height > 0) return i
}
var o = t.camera.getPickRay(e);
return i = t.globe.pick(o, t)
}
function e(t, e) {
var n = t.scene,
r = i(n),
o = r;
if (!o) {
var a = n.globe,
s = n.camera.positionCartographic.clone(),
l = a.getHeight(s);
s.height = l || 0, o = Cesium.Ellipsoid.WGS84.cartographicToCartesian(s)
}
var u = Cesium.Cartographic.fromCartesian(o),
c = {};
return c.y = Number(Cesium.Math.toDegrees(u.latitude).toFixed(6)), c.x = Number(Cesium.Math.toDegrees(u.longitude).toFixed(6)), c.z = Number(u.height.toFixed(1)), e && (c = mars3d.map.point2wgs(c)), c
}
function i(t) {
const e = t.canvas, i = new Cesium.Cartesian2(e.clientWidth / 2, e.clientHeight / 2), n = t.camera.getPickRay(i), r = t.globe.pick(n, t);
return r || t.camera.pickEllipsoid(i)
}
function n(t, e) {
var i = {
xmin: 70,
xmax: 140,
ymin: 0,
ymax: 55
},
n = t.scene,
r = n.globe.ellipsoid,
o = n.canvas,
a = t.camera.pickEllipsoid(new Cesium.Cartesian2(0, 0), r);
if (a) {
var s = r.cartesianToCartographic(a);
i.xmin = Cesium.Math.toDegrees(s.longitude), i.ymax = Cesium.Math.toDegrees(s.latitude)
} else {
for (var l, u = o.width / 2, c = o.height / 2, h = 0; h <= c; h += 10) {
var d = h <= u ? h : u;
if (l = t.camera.pickEllipsoid(new Cesium.Cartesian2(d, h), r)) break
}
if (l) {
var s = r.cartesianToCartographic(l);
i.xmin = Cesium.Math.toDegrees(s.longitude), i.ymax = Cesium.Math.toDegrees(s.latitude)
}
}
var p = t.camera.pickEllipsoid(new Cesium.Cartesian2(o.width, o.height), r);
if (p) {
var f = r.cartesianToCartographic(p);
i.xmax = Cesium.Math.toDegrees(f.longitude), i.ymin = Cesium.Math.toDegrees(f.latitude)
} else {
for (var m, u = o.width / 2, c = o.height / 2, h = o.height; h >= c; h -= 10) {
var d = h >= u ? h : u;
if (m = t.camera.pickEllipsoid(new Cesium.Cartesian2(d, h), r)) break
}
if (m) {
var f = r.cartesianToCartographic(m);
i.xmax = Cesium.Math.toDegrees(f.longitude), i.ymin = Cesium.Math.toDegrees(f.latitude)
}
}
if (e) {
var g = mars3d.map.point2wgs({
x: i.xmin,
y: i.ymin
});
i.xmin = g.x, i.ymin = g.y;
var v = mars3d.map.point2wgs({
x: i.xmax,
y: i.ymax
});
i.xmax = v.x, i.ymax = v.y
}
return i
}
function r(t, e) {
var i = t.camera,
n = i.positionCartographic,
r = {};
return r.y = Number(Cesium.Math.toDegrees(n.latitude).toFixed(6)), r.x = Number(Cesium.Math.toDegrees(n.longitude).toFixed(6)), r.z = Number(n.height.toFixed(1)), r.heading = Number(Cesium.Math.toDegrees(i.heading).toFixed(1)), r.pitch = Number(Cesium.Math.toDegrees(i.pitch).toFixed(1)), r.roll = Number(Cesium.Math.toDegrees(i.roll).toFixed(1)), e && (r = mars3d.map.point2wgs(r)), r
}
return {
getCurrentMousePosition: t,
getCenter: e,
getExtent: n,
getCameraView: r
}
}(), mars3d.layer = function() {
function t(e, i, n, r) {
var o;
switch (e.url && (n && (e.url = e.url.replace("$serverURL$", n)), e.url = e.url.replace("$hostname$", location.hostname).replace("$host$", location.host)), e.type) {
case "group":
if (e.layers && e.layers.length > 0) {
for (var a = [], s = 0; s < e.layers.length; s++) {
var l = t(e.layers[s], i, n);
null != l && a.push(l)
}
e._layers = a, o = new mars3d.GroupLayer(e, i)
}
break;
case "www_bing":
case "www_osm":
case "www_google":
case "www_gaode":
case "www_tdt":
case "arcgis_cache":
case "arcgis":
case "arcgis_tile":
case "wmts":
case "tms":
case "wms":
case "xyz":
case "tile":
case "single":
case "image":
case "custom_tilecoord":
case "custom_grid":
o = new mars3d.TileLayer(e, i);
break;
case "custom_graticule":
o = new mars3d.GraticuleLayer(e, i);
break;
case "3dtiles":
o = new mars3d.Tiles3dLayer(e, i);
break;
case "gltf":
o = new mars3d.GltfLayer(e, i);
break;
case "arcgis_dynamic":
o = new mars3d.ArcFeatureLayer(e, i);
break;
case "geojson":
o = new mars3d.GeoJsonLayer(e, i)
}
if (r) {
var u = r(e, i, o);
u && (o = u)
}
return null == o ? "group" != e.type && console.log("配置中的图层未处理:" + JSON.stringify(e)) : e._layer = o, o
}
function e(t, e) {
t.url && (e && (t.url = t.url.replace("$serverURL$", e)), t.url = t.url.replace("$hostname$", location.hostname).replace("$host$", location.host));
var i = {};
for (var n in t) {
var r = t[n];
if (null != r) switch (n) {
default:
i[n] = r;
break;
case "crs":
"4326" == r || "EPSG4326" == r.toUpperCase() ? i.tilingScheme = new Cesium.GeographicTilingScheme({
numberOfLevelZeroTilesX: t.numberOfLevelZeroTilesX || 2,
numberOfLevelZeroTilesY: t.numberOfLevelZeroTilesY || 1
}) : i.tilingScheme = new Cesium.WebMercatorTilingScheme({
numberOfLevelZeroTilesX: t.numberOfLevelZeroTilesX || 1,
numberOfLevelZeroTilesY: t.numberOfLevelZeroTilesY || 1
});
break;
case "proxy":
i.proxy = new Cesium.DefaultProxy(r);
break;
case "rectangle":
i.rectangle = Cesium.Rectangle.fromDegrees(r.xmin, r.ymin, r.xmax, r.ymax)
}
}
var o;
switch (i.type) {
case "single":
case "image":
o = new Cesium.SingleTileImageryProvider(i);
break;
case "xyz":
case "tile":
o = new Cesium.UrlTemplateImageryProvider(i);
break;
case "wms":
o = new Cesium.WebMapServiceImageryProvider(i);
break;
case "tms":
i.url || (i.url = Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")), o = new Cesium.createTileMapServiceImageryProvider(i);
break;
case "wmts":
o = new Cesium.WebMapTileServiceImageryProvider(i);
break;
case "arcgis":
case "arcgis_tile":
o = new Cesium.ArcGisMapServerImageryProvider(i);
break;
case "arcgis_cache":
o = new ArcTileImageryProvider(i);
break;
case "www_tdt":
var a;
switch (i.layer) {
default:
case "vec_d":
a = "vec";
break;
case "vec_z":
a = "cva";
break;
case "img_d":
a = "img";
break;
case "img_z":
a = "cia";
break;
case "ter_d":
a = "ter";
break;
case "ter_z":
a = "cta"
}
var s = 18;
if ("4326" == t.crs) {
for (var l = new Array(s), u = 0; u <= s; u++) l[u] = (u + 1).toString();
o = new Cesium.WebMapTileServiceImageryProvider({
url: "http://t{s}.tianditu.com/" + a + "_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer=" + a + "&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles",
layer: a,
style: "default",
format: "tiles",
tileMatrixSetID: "c",
subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"],
tileMatrixLabels: l,
tilingScheme: new Cesium.GeographicTilingScheme,
maximumLevel: s,
proxy: i.proxy
})
} else {
for (var l = new Array(s), u = 0; u <= s; u++) l[u] = u.toString();
o = new Cesium.WebMapTileServiceImageryProvider({
url: "http://t{s}.tianditu.com/" + a + "_w/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer=" + a + "&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles",
layer: a,
style: "default",
format: "tiles",
tileMatrixSetID: "w",
subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"],
tileMatrixLabels: l,
tilingScheme: new Cesium.WebMercatorTilingScheme,
maximumLevel: s,
proxy: i.proxy
})
}
break;
case "www_gaode":
var c;
switch (i.layer) {
case "vec":
default:
c = "http://" + (i.bigfont ? "wprd" : "webrd") + "0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}";
break;
case "img_d":
c = "http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}";
break;
case "img_z":
c = "http://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8";
break;
case "time":
var h = (new Date).getTime();
c = "http://tm.amap.com/trafficengine/mapabc/traffictile?v=1.0&;t=1&x={x}&y={y}&z={z}&&t=" + h
}
o = new Cesium.UrlTemplateImageryProvider({
url: c,
subdomains: ["1", "2", "3", "4"],
maximumLevel: 18,
proxy: i.proxy
});
break;
case "www_google":
var c;
switch (i.layer) {
case "vec":
default:
c = "http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile";
break;
case "img_d":
c = "http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&gl=CN&x={x}&y={y}&z={z}&s=Gali";
break;
case "img_z":
c = "http://mt{s}.google.cn/vt/imgtp=png32&lyrs=h@207000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galil";
break;
case "ter":
c = "http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile"
}
o = new Cesium.UrlTemplateImageryProvider({
url: c,
subdomains: ["1", "2", "3"],
maximumLevel: 20,
proxy: i.proxy
});
break;
case "www_osm":
o = new Cesium.createOpenStreetMapImageryProvider({
url: "https://{s}.tile.openstreetmap.org/",
subdomains: ["a", "b", "c"],
maximumLevel: 18,
proxy: i.proxy
});
break;
case "www_bing":
var d = i.layer || Cesium.BingMapsStyle.Aerial;
o = new Cesium.BingMapsImageryProvider({
url: "https://dev.virtualearth.net",
key: "AtkX3zhnRe5fyGuLU30uZw8r3sxdBDnpQly7KfFTCB2rGlDgXBG3yr-qEiQEicEc",
mapStyle: d,
proxy: i.proxy
});
break;
case "custom_grid":
o = new Cesium.GridImageryProvider;
break;
case "custom_tilecoord":
o = new Cesium.TileCoordinatesImageryProvider;
break;
default:
console.log("config配置图层未处理:" + t)
}
return o
}
return {
createLayer: t,
createImageryProvider: e
}
}(), mars3d.popup = function() {
function t(t) {
s = t;
var i = '';
$("#" + s._container.id).append(i);
var n = new Cesium.ScreenSpaceEventHandler(s.scene.canvas);
n.setInputAction(e, Cesium.ScreenSpaceEventType.LEFT_CLICK), s.scene.postRender.addEventListener(r)
}
function e(t) {
var e = t.position,
n = s.scene.pick(e);
if (n && Cesium.defined(n.id)) {
var r = n.id;
if (!r.popup) return;
var a;
a = r.billboard || r.label || r.point ? n.primitive.position : mars3d.latlng.getCurrentMousePosition(s.scene, e), i(r, a)
} else o()
}
function i(t, e) {
if (null != t && null != t.popup) {
var i = "popup-" + t.id;
o(i), l[i] = {
popup: t.popup,
cartesian: e
};
var r;
r = "object" == typeof t.popup ? t.popup.html : t.popup, r = '
', $("#pupup-all-view").append(r);
var a = n(i, e, t.popup);
return a ? void 0 : void o(i)
}
}
function n(t, e, i) {
var n = Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene, e);
if (null == n) return !1;
var r = $("#" + t),
o = n.x - r.width() / 2,
a = n.y - r.height();
return i && "object" == typeof i && i.anchor && (o += i.anchor[0], a += i.anchor[1]), r.css("transform", "translate3d(" + o + "px," + a + "px, 0)"), !0
}
function r() {
for (var t in l) {
var e = l[t];
n(t, e.cartesian, e.popup)
}
}
function o(t) {
!u && t ? ($("#" + t).remove(), delete l[t]) : ($("#pupup-all-view").empty(), l = {})
}
function a(t) {
u = t
}
var s, l = {},
u = !0;
return {
isOnly: a,
init: t,
show: i,
hide: o,
close: o
}
}(), mars3d.tooltip = function() {
function t(t) {
r = t;
var i = '
';
$("#" + r._container.id).append(i);
var n = new Cesium.ScreenSpaceEventHandler(r.scene.canvas);
n.setInputAction(e, Cesium.ScreenSpaceEventType.MOUSE_MOVE)
}
function e(t) {
var e = t.endPosition,
a = r.scene.pick(e);
if (a && Cesium.defined(a.id)) {
var s = a.id;
if (!s.tooltip) return void n();
if (s.billboard || s.label || s.point) {
if (o == s) return;
o = s
}
var l = mars3d.latlng.getCurrentMousePosition(r.scene, e);
i(s, l, e)
} else n()
}
function i(t, e, i) {
if (null != t && null != t.tooltip) {
if (null == i && (i = Cesium.SceneTransforms.wgs84ToWindowCoordinates(r.scene, e)), null == i) return void n();
var o, a = $("#tooltip-view");
o = "object" == typeof t.tooltip ? t.tooltip.html : t.tooltip, $("#tooltip-content").html(o), a.show();
var s = i.x - a.width() / 2,
l = i.y - a.height(),
u = t.tooltip;
u && "object" == typeof u && u.anchor && (s += u.anchor[0], l += u.anchor[1]), a.css("transform", "translate3d(" + s + "px," + l + "px, 0)")
}
}
function n() {
$("#tooltip-content").empty(), $("#tooltip-view").hide(), o = null
}
var r, o;
return {
init: t,
show: i,
hide: n,
close: n
}
}(), mars3d.geocoder = function() {
function t(t, i) {
o = t, l = i.citycode || "", $(".cesium-geocoder-input").attr("placeholder", "输入地名、坐标后按回车键查询"), a = o.geocoder.viewModel, a._searchCommand = Cesium.createCommand(function() {
n(), a.isSearchInProgress ? e() : r()
})
}
function e() {
a._isSearchInProgress = !1, Cesium.defined(a._geocodeInProgress) && (a._geocodeInProgress.cancel = !0, a._geocodeInProgress = void 0)
}
function i(t) {
a._scene.camera.flyTo({
destination: t,
complete: function() {
a._complete.raiseEvent()
},
duration: a._flightDuration,
endTransform: Cesium.Matrix4.IDENTITY
})
}
function n() {
if (Cesium.defined(a.entities)) for (var t = 0; t < a.entities.length; t++) o.entities.remove(a.entities[t]);
a.entities = []
}
function r() {
var t = a.searchText;
if (!/^\s*$/.test(t)) {
var e = t.match(/[^\s,\n]+/g);
if (2 === e.length || 3 === e.length) {
var r = +e[0],
s = +e[1],
u = 3 === e.length ? +e[2] : 300;
if (!isNaN(r) && !isNaN(s) && !isNaN(u)) return void i(Cesium.Cartesian3.fromDegrees(r, s, u))
}
a._isSearchInProgress = !0;
var c = "http://restapi.amap.com/v3/place/text?city=" + l + "&citylimit=true&key=57f8ebe12797a73fc5b87f5d4ef859b1&keywords=" + t,
h = Cesium.loadJson(c),
d = a._geocodeInProgress = Cesium.when(h, function(e) {
if (n(), a._searchText = t, !d.cancel) {
if (a._isSearchInProgress = !1, 0 == e.status) return void alert("请求失败(" + e.infocode + "):" + e.info);
if (0 === e.pois.length) return void alert("未查询到相关数据!");
for (var i, r = 0; r < e.pois.length; r++) {
var s = e.pois[r],
l = "
名称:" + s.name + "
地址:" + s.address + "
区域:" + s.pname + s.cityname + s.adname + "
类别:" + s.type + "
";
i = s.location.split(","), i = pointconvert.gcj2wgs(i);
var u = mars3d.map.point2map({
x: i[0],
y: i[1]
}),
c = o.entities.add({
id: r + "." + s.name,
position: Cesium.Cartesian3.fromDegrees(u.x, u.y),
point: {
color: new Cesium.Color.fromCssColorString("#3388ff"),
pixelSize: 10,
outlineColor: new Cesium.Color.fromCssColorString("#ffffff"),
outlineWidth: 2,
heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND
},
label: {
text: s.name,
font: "16px Helvetica",
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 2,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(0, (-10)),
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
},
data: s,
tooltip: {
html: l,
anchor: [0, -20]
}
});
a.entities.push(c)
}
o.flyTo(a.entities, {
duration: 3
})
}
}, function() {
return d.cancel ? void n() : (a._isSearchInProgress = !1, void(a.searchText = a._searchText + " (error)"))
})
}
}
var o, a, s = "cesium地图 查询POI工具栏",
l = "";
return {
name: s,
init: t
}
}(), mars3d.map = function() {
function t() {
return b
}
function e(t, e, i) {
w = t, C = e;
var r = {
animation: !1,
timeline: !1,
fullscreenButton: !0,
vrButton: !1,
geocoder: !1,
sceneModePicker: !1,
homeButton: !0,
navigationHelpButton: !0,
navigationInstructionsInitiallyVisible: !1,
infoBox: !0,
selectionIndicator: !1,
baseLayerPicker: !1
};
null == i && (i = {});
for (var o in r) i.hasOwnProperty(o) || (i[o] = r[o]);
Cesium.BingMapsApi.defaultKey = "AtkX3zhnRe5fyGuLU30uZw8r3sxdBDnpQly7KfFTCB2rGlDgXBG3yr-qEiQEicEc", C.crs = C.crs || "3857", x = C.crs;
var a = !1,
l = C.controls;
if (l) for (var o = 0; o < l.length; o++) {
var u = l[o];
if (!u.hasOwnProperty("visible") || u.visible) switch (u.type) {
case "geocoder":
i.geocoder = !0;
break;
case "mousezoom":
a = !0
}
}
C.terrain && C.terrain.visible && (i.terrainProvider = n()), null == i.imageryProvider && (i.imageryProvider = Cesium.createTileMapServiceImageryProvider({
url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")
})), b = new Cesium.Viewer(t, i), b.cesiumWidget.creditContainer.style.display = "none";
var f = C.basemaps;
if (f && f.length > 0) {
for (var m = b.imageryLayers, g = m.length, o = 0; o < g; o++) {
var v = m.get(0);
m.remove(v, !0)
}
for (var o = 0; o < f.length; o++) {
var u = f[o];
u.visible && u.crs && (x = u.crs), mars3d.layer.createLayer(u, b, e.serverURL, i.layerToMap)
}
}
b.homeButton && b.homeButton.viewModel.command.beforeExecute.addEventListener(function(t) {
s(), t.cancel = !0
}), s(null, {
duration: 0
});
var _;
b.scene.morphStart.addEventListener(function(t) {
_ = mars3d.latlng.getCameraView(b)
}), b.scene.morphComplete.addEventListener(function(t) {
setTimeout(function() {
s(_)
}, 100)
});
var f = C.operationallayers;
if (f && f.length > 0) for (var o = 0; o < f.length; o++) {
var u = f[o];
mars3d.layer.createLayer(u, b, e.serverURL, i.layerToMap)
}
var l = C.controls;
if (l) for (var o = 0; o < l.length; o++) {
var u = l[o];
if (!u.hasOwnProperty("visible") || u.visible) switch (u.type) {
case "location":
c(u);
break;
case "navigation":
d(u);
break;
case "geocoder":
mars3d.geocoder.init(b, u);
break;
case "msgbar":
h(u)
}
}
mars3d.popup.init(b), mars3d.tooltip.init(b);
var y = b.scene;
if (y.globe.baseColor = Cesium.Color.SILVER, C.style && (y.globe.depthTestAgainstTerrain = C.style.testTerrain, y.globe.enableLighting = C.style.lighting, y.skyAtmosphere && (y.skyAtmosphere.show = C.style.atmosphere), y.fog && (y.fog.enabled = C.style.fog)), y.screenSpaceCameraController.maximumZoomDistance = C.maxzoom || 2e7, y.screenSpaceCameraController.minimumZoomDistance = C.minzoom || 1, a && p()) {
$("#" + w).append('
');
var E = new Cesium.ScreenSpaceEventHandler(y.canvas);
E.setInputAction(function(t) {
$(".cesium-mousezoom").addClass("cesium-mousezoom-visible"), setTimeout(function() {
$(".cesium-mousezoom").removeClass("cesium-mousezoom-visible")
}, 200)
}, Cesium.ScreenSpaceEventType.WHEEL), E.setInputAction(function(t) {
$(".cesium-mousezoom").css({
top: t.endPosition.y + "px",
left: t.endPosition.x + "px"
})
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE)
}
if (b.navigationHelpButton) {
var k = $(".cesium-click-navigation-help .cesium-navigation-help-pan");
k.html("平移视图"), k.next().html("左键点击+拖动");
var L = $(".cesium-click-navigation-help .cesium-navigation-help-zoom");
L.html("缩放视图"), L.next().html("右键点击+拖动,"), L.next().next().html("或鼠标滚轮缩放");
var P = $(".cesium-click-navigation-help .cesium-navigation-help-rotate");
P.html("旋转视图"), P.next().html("中键点击+拖动,"), P.next().next().html("或按Ctrl键+左右键点击+拖动");
var k = $(".cesium-touch-navigation-help .cesium-navigation-help-pan");
k.html("平移视图"), k.next().html("一个手指拖动");
var L = $(".cesium-touch-navigation-help .cesium-navigation-help-zoom");
L.html("缩放视图"), L.next().html("两个手指拖动");
var P = $(".cesium-touch-navigation-help .cesium-navigation-help-rotate");
P.html("倾斜角度"), P.next().html("两指拖曳,同方向");
var D = $(".cesium-touch-navigation-help .cesium-navigation-help-tilt");
D.html("旋转视图"), D.next().html("两手指拖动,方向相反")
}
return b
}
function i(t, e) {
null == e && (e = "name");
var i = C.basemaps;
if (i && i.length > 0) for (var n = 0; n < i.length; n++) {
var r = i[n];
if (null != r && r[e] == t) return r._layer
}
if (i = C.operationallayers, i && i.length > 0) for (var n = 0; n < i.length; n++) {
var r = i[n];
if (null != r && r[e] == t) return r._layer
}
return null
}
function n() {
if (null == E) {
var t = C.terrain || {};
t.hasOwnProperty("requestWaterMask") || (t.requestWaterMask = !0), t.hasOwnProperty("requestVertexNormals") || (t.requestVertexNormals = !0), t.url ? (C.serverURL && (t.url = t.url.replace("$serverURL$", C.serverURL)), t.url = t.url.replace("$hostname$", location.hostname).replace("$host$", location.host)) : t.url = "http://assets.agi.com/stk-terrain/world", E = new Cesium.CesiumTerrainProvider(t)
}
return E
}
function r() {
return null != E && b.terrainProvider == E
}
function o(t) {
t ? b.terrainProvider = n() : b.terrainProvider = new Cesium.EllipsoidTerrainProvider({
ellipsoid: Cesium.Ellipsoid.WGS84
})
}
function a(t) {
return "number" == typeof t && t.constructor == Number
}
function s(t, e, i) {
if (null == e ? e = {} : a(e) && (e = {
duration: e
}), i && (e.complete = i), null == t && (e.isWgs84 = !0, t = C.extent || C.center), t.xmin && t.xmax && t.ymin && t.ymax) {
var n = t.xmin,
r = t.xmax,
o = t.ymin,
s = t.ymax;
if (e.isWgs84) {
var l = mars3d.map.point2map({
x: n,
y: o
});
n = l.x, o = l.y;
var u = mars3d.map.point2map({
x: r,
y: s
});
r = u.x, s = u.y
}
var c = Cesium.Rectangle.fromDegrees(n, o, r, s);
b.camera.flyTo({
destination: c,
duration: e.duration,
complete: e.complete
})
} else {
e.isWgs84 && (t = mars3d.map.point2map(t));
var h = e.minz || 2500;
b.camera.positionCartographic.height < h && (h = b.camera.positionCartographic.height), null != t.z && 0 != t.z && (h = t.z), b.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(Number(t.x), Number(t.y), Number(h)),
orientation: {
heading: Cesium.Math.toRadians(t.heading || 0),
pitch: Cesium.Math.toRadians(t.pitch || -90),
roll: Cesium.Math.toRadians(t.roll || 0)
},
duration: e.duration,
complete: e.complete
})
}
}
function l() {
return L
}
function u(t, e) {
var i = e || mars3d.latlng.getCameraView(b);
L = !0, b.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(-85.16, 13.71, 23e6)
}), b.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(Number(i.x), Number(i.y), 23e6),
duration: 2,
easingFunction: Cesium.EasingFunction.LINEAR_NONE,
complete: function() {
var e = 1.2 * (i.z || 9e4) + 8e3;
e > 23e6 && (e = 23e6), b.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(Number(i.x), Number(i.y), e),
complete: function() {
s(i, {
duration: 2,
complete: function() {
L = !1, t && t()
}
})
}
})
}
})
}
function c(t) {
document.getElementById("location_mars_jwd") || $("#" + w).prepend(''), t.style ? $("#location_mars_jwd").css(t.style) : $("#location_mars_jwd").css({
left: "5px",
bottom: "2px"
});
var e = new Cesium.ScreenSpaceEventHandler(b.scene.canvas);
e.setInputAction(function(e) {
var i = mars3d.latlng.getCurrentMousePosition(b.scene, e.endPosition);
if (i) {
var n = Cesium.Cartographic.fromCartesian(i),
r = Cesium.Math.toDegrees(n.longitude),
o = Cesium.Math.toDegrees(n.latitude),
a = n.height;
if (t.coordinate && "wgs" == t.coordinate) {
var s = mars3d.map.point2wgs({
x: r,
y: o
});
r = s.x, o = s.y
}
var l = "经度:" + r.toFixed(6) + " 纬度:" + o.toFixed(6);
a > 0 && (l += " 高程:" + a.toFixed(1) + "米"), $("#location_mars_jwd").html(l)
} else $("#location_mars_jwd").html("")
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE)
}
function h(t) {
function e() {
var e = mars3d.latlng.getCenter(b);
if (e) {
var i = !1;
for (var n in t.data) {
var r = t.data[n];
if (e.x >= r.xmin && e.x <= r.xmax && e.y >= r.ymin && e.y <= r.ymax) {
$("#mars_msgbar").html(r.msg), i = !0;
break
}
}
}
i || $("#mars_msgbar").html("")
}
null != t.data && 0 != t.data.length && (document.getElementById("mars_msgbar") || $("#" + w).prepend(''), t.style ? $("#mars_msgbar").css(t.style) : $("#mars_msgbar").css({
right: "30px",
bottom: "1px"
}), b.scene.camera.moveEnd.addEventListener(e))
}
function d(t) {
b.extend(Cesium.viewerCesiumNavigationMixin, {
defaultResetView: Cesium.Rectangle.fromDegrees(110, 20, 120, 30),
enableZoomControls: !0
}), $(".distance-legend").css("left", "-10px"), $(".distance-legend").css("bottom", "25px"), $(".distance-legend").css("border", "none"), $(".distance-legend").css("background", "rgba(0, 0, 0, 0)"), $(".navigation-controls").hide(), t.style ? $(".compass").css(t.style) : $(".compass").css({
top: "10px",
left: "10px"
})
}
function p() {
var t = navigator.userAgent.toLowerCase(),
e = "ipad" == t.match(/ipad/i),
i = "iphone" == t.match(/iphone/i),
n = "midp" == t.match(/midp/i),
r = "rv:1.2.3.4" == t.match(/rv:1.2.3.4/i),
o = "ucweb" == t.match(/ucweb/i),
a = "android" == t.match(/android/i),
s = "windows ce" == t.match(/windows ce/i),
l = "windows mobile" == t.match(/windows mobile/i);
return !(e || i || n || r || o || a || s || l)
}
function f() {
return x
}
function m(t) {
if ("gcj" == x) {
var e = pointconvert.wgs2gcj([t.x, t.y]),
i = v(t);
return i.x = e[0], i.y = e[1], i
}
return t
}
function g(t) {
if ("gcj" == x) {
var e = pointconvert.gcj2wgs([t.x, t.y]),
i = v(t);
return i.x = e[0], i.y = e[1], i
}
return t
}
function v(t, e) {
if (null == t || "object" != typeof t) return t;
if (t.constructor != Object && t.constructor != Array) return t;
if (t.constructor == Date || t.constructor == RegExp || t.constructor == Function || t.constructor == String || t.constructor == Number || t.constructor == Boolean) return new t.constructor(t);
e = e || new t.constructor;
for (var i in t) e[i] = "undefined" == typeof e[i] ? v(t[i], null) : e[i];
return e
}
function _(t, i, n) {
if (null == i) return void console.log("配置信息不能为空!");
var r = e(t.id, i, t),
o = {};
return o.config = i, r.gisdata = o, t.success && t.success(r, o, n), r
}
function y() {
var t = haoutil.system.getExplorerInfo();
if ("IE" == t.type && t.version < 11) return !1;
try {
var e, i = document.createElement("canvas"),
n = "undefined" != typeof WebGL2RenderingContext;
if (n && (e = i.getContext("webgl2") || i.getContext("experimental-webgl2") || void 0), null == e && (e = i.getContext("webgl") || i.getContext("experimental-webgl") || void 0), null == e) return !1
} catch (r) {
return !1
}
return !0
}
var b, w, C, x, E, k = "cesium地图 操作类",
L = !1;
return {
name: k,
init: e,
getMap: t,
getLayer: i,
centerAt: s,
openFlyAnimation: u,
isFlyAnimation: l,
hasTerrain: r,
updateTerrainProvider: o,
getCrs: f,
point2map: m,
point2wgs: g,
createMapByData: _,
webglreport: y
}
}(), mars3d.createMap = function(t) {
return t.url ? ($.ajax({
type: "get",
contentType: "application/json; charset=utf-8",
dataType: "json",
url: t.url,
timeout: 0,
success: function(e) {
var i = e.map3d;
e.serverURL && (i.serverURL = e.serverURL), t.serverURL && (i.serverURL = t.serverURL), mars3d.map.createMapByData(t, i, e)
},
error: function(e, i, n) {
console.log("Json文件" + t.url + "加载失败!"), haoutil.alert("Json文件" + t.url + "加载失败!")
}
}), null) : (t.serverURL && t.data && (t.data.serverURL = t.serverURL), mars3d.map.createMapByData(t, t.data))
}, mars3d.drawing = {}, mars3d.drawing.utils = {
createDragger: function(t, e) {
var i;
if (e.dragger) i = e.dragger;
else {
var n = Cesium.defaultValue(e.position, Cesium.Cartesian3.ZERO),
r = Cesium.defaultValue(e.dragIcon, "dragIcon.png");
i = t.entities.add({
position: n,
billboard: {
scale: 1,
heightReference: e.heightReference ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE,
image: r
}
})
}
return i._isDragger = !0, i.onDrag = Cesium.defaultValue(e.onDrag, null), i.horizontal = Cesium.defaultValue(e.horizontal, !0), i.vertical = Cesium.defaultValue(e.vertical, !1), i.verticalCtrl = Cesium.defaultValue(e.vertical, !1), i
},
getCoordinates: function(t) {
for (var e = [], i = 0; i < t.length; i++) {
var n = Cesium.Cartographic.fromCartesian(t[i]),
r = Number(Cesium.Math.toDegrees(n.longitude).toFixed(6)),
o = Number(Cesium.Math.toDegrees(n.latitude).toFixed(6)),
a = Number(n.height.toFixed(1));
e.push([r, o, a])
}
return e
},
getMaxHeightForPositions: function(t, e) {
null == e && (e = 0);
var i = e;
if (null == t || 0 == t.length) return i;
for (var n = (t[0], 0); n < t.length; n++) {
var r = Cesium.Cartographic.fromCartesian(t[n]);
r.height > i && (i = r.height)
}
return i
},
getPositionsWithHeight: function(t, e) {
if (t instanceof Array) {
for (var i = [], n = 0; n < t.length; n++) {
var r = Cesium.Ellipsoid.WGS84.cartesianToCartographic(t[n]),
o = {
lon: Cesium.Math.toDegrees(r.longitude),
lat: Cesium.Math.toDegrees(r.latitude),
hgt: Math.ceil(Number(r.height) + Number(e))
},
a = [Number(o.lon), Number(o.lat), Number(o.hgt)];
i = i.concat(a)
}
return Cesium.Cartesian3.fromDegreesArrayHeights(i)
}
var r = Cesium.Ellipsoid.WGS84.cartesianToCartographic(t),
s = Number(Cesium.Math.toDegrees(r.longitude).toFixed(6)),
l = Number(Cesium.Math.toDegrees(r.latitude).toFixed(6));
return Cesium.Cartesian3.fromDegrees(s, l, Number(r.height) + Number(e))
},
getZHeightPosition: function(t, e) {
var i = Cesium.Cartographic.fromCartesian(t),
n = Number(Cesium.Math.toDegrees(i.longitude)),
r = Number(Cesium.Math.toDegrees(i.latitude)),
o = Number(i.height.toFixed(2)),
a = Cesium.Cartographic.fromCartesian(e),
s = Number(Cesium.Math.toDegrees(a.longitude)),
l = Number(Cesium.Math.toDegrees(a.latitude)),
u = Number(a.height.toFixed(2));
return o > u ? Cesium.Cartesian3.fromDegrees(s, l, o) : Cesium.Cartesian3.fromDegrees(n, r, u)
},
getHDistance: function(t, e) {
var i = this.getZHeightPosition(t, e),
n = Cesium.Cartographic.fromCartesian(e),
r = Cesium.Cartographic.fromCartesian(i),
o = Cesium.Cartesian3.distance(t, i);
return Math.abs(Number(r.height) - Number(n.height)) < .01 && (o = Cesium.Cartesian3.distance(e, i)), o
},
getMidPosition: function(t, e) {
var i = Cesium.Cartographic.fromCartesian(t),
n = Number(Cesium.Math.toDegrees(i.longitude)),
r = Number(Cesium.Math.toDegrees(i.latitude)),
o = Number(i.height.toFixed(2)),
a = Cesium.Cartographic.fromCartesian(e),
s = Number(Cesium.Math.toDegrees(a.longitude)),
l = Number(Cesium.Math.toDegrees(a.latitude)),
u = Number(a.height.toFixed(2)),
c = (n + s) / 2,
h = (r + l) / 2,
d = (o + u) / 2;
return Cesium.Cartesian3.fromDegrees(c, h, d)
},
getPositionsFromJson: function(t) {
if (!t) return null;
switch (t.type) {
case "Point":
return this.lonLatToCartesian(t.coordinates[0]);
case "LineString":
return this.lonLatsToCartesians(t.coordinates);
case "Polygon":
return this.lonLatsToCartesians(t.coordinates[0]);
case "MultiPoint":
return this.lonLatsToCartesians(t.coordinates);
default:
throw new Error("Invalid GeoJSON object.")
}
},
lonLatToCartesian: function(t) {
return Cesium.Cartesian3.fromDegrees(Number(t[0]), Number(t[1]), Number(t[2] || 0))
},
lonLatsToCartesians: function(t) {
for (var e = [], i = 0; i < t.length; i++) {
var n = [Number(t[i][0]), Number(t[i][1]), Number(t[i][2] || 0)];
e = e.concat(n)
}
return Cesium.Cartesian3.fromDegreesArrayHeights(e)
},
normalizeJsonData: function(t) {
var e = {};
e.type = "FeatureCollection", e.features = [];
var i;
if (i = "string" == typeof t ? JSON.parse(t) : t, i instanceof Array) {
for (var n = 0; n < i.length; n++) {
var r = {
type: "Feature"
};
r.properties = i[n].properties || i[n].PROPERTIES, r.geometry = i[n].geometry || i[n].GEOMETRY, e.features.push(r)
}
return JSON.stringify(e)
}
if (t.features && t.features instanceof Array) return t
},
normalizeBusinessData: function(t) {
var e = {};
try {
e = JSON.parse(t)
} catch (i) {
return void haoutil.alert(i.name + ": " + i.message + " \n请确认json文件格式正确!!!")
}
for (var n = e.features, r = [], o = 0; o < n.length; o++) {
var a = n[o],
s = {
dataID: a.properties.attr.id,
dataType: a.properties.attr.type,
properties: a.properties,
geometry: a.geometry
};
r.push(s)
}
return JSON.stringify(r)
},
terrainPolyline: function(t) {
var e = t.viewer,
i = t.positions;
if (null == i || 0 == i.length) return void(t.calback && t.calback(i));
for (var n = Cesium.PolylinePipeline.generateArc({
positions: i,
granularity: t.granularity || 1e-5
}), r = [], o = e.scene.globe.ellipsoid, a = 0; a < n.length; a += 3) {
var s = Cesium.Cartesian3.unpack(n, a);
r.push(o.cartesianToCartographic(s))
}
var l = Cesium.Cartographic.fromCartesian(i[0]).height;
Cesium.when(Cesium.sampleTerrainMostDetailed(e.terrainProvider, r), function(e) {
for (var n = !1, r = t.offset || 2, a = 0; a < e.length; ++a) null == e[a].height ? n = !0 : l = e[a].height || 0, e[a].height = r + (e[a].height || l);
var s = o.cartographicArrayToCartesianArray(e);
t.calback ? t.calback(s, n) : i.setValue && i.setValue(s)
})
}
}, mars3d.drawing.DynamicProperty = function(t,type) {
this._type = type,this._value = void 0, this._hasClone = !1, this._hasEquals = !1, this._definitionChanged = new Cesium.Event, this._constant = !1, this.setValue(t)
}, Cesium.defineProperties(mars3d.drawing.DynamicProperty.prototype, {
isConstant: {
get: function() {
return this._constant
},
set: function(t) {
this._constant !== t && (this._constant = t, this._definitionChanged.raiseEvent(this))
}
},
definitionChanged: {
get: function() {
return this._definitionChanged
}
}
}), mars3d.drawing.DynamicProperty.prototype.getValue = function(t, e) {
if(this._type){
return {positions:this._value}
}
else{
return this._hasClone ? this._value.clone(e) : this._value
}
}, mars3d.drawing.DynamicProperty.prototype.setValue = function(t) {
var e = this._value;
if (e !== t) {
var i = Cesium.defined(t),
n = i && "function" == typeof t.clone,
r = i && "function" == typeof t.equals;
this._hasClone = n, this._hasEquals = r;
var o = !r || !t.equals(e);
o && (this._value = n ? t.clone() : t, this._definitionChanged.raiseEvent(this))
}
}, mars3d.drawing.DynamicProperty.prototype.equals = function(t) {
return this === t || t instanceof mars3d.drawing.DynamicProperty && (!this._hasEquals && this._value === t._value || this._hasEquals && this._value.equals(t._value))
}, mars3d.drawing.DynamicProperty.prototype.valueOf = function(t) {
return this._value
}, mars3d.drawing.DynamicProperty.prototype.toString = function(t) {
return String(this._value)
}, mars3d.drawing.EllipseEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.options = i, this.draggers = [], this.heightDraggers = [], this.initDraggers()
}, mars3d.drawing.EllipseEditor.prototype.initDraggers = function() {
var t = this,
e = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: this.options.dragIcon,
position: this.entity.position._value,
onDrag: function(e, i) {
var n = new Cesium.Cartesian3;
Cesium.Cartesian3.subtract(i, t.entity.position._value, n);
var r = Cesium.Cartographic.fromCartesian(i),
o = Number(r.height).toFixed(2);
t.entity.ellipse.height = new Cesium.ConstantProperty(r.height), t.entity.attribute.style.height = o, t.entity.position._value = i;
var a = new Cesium.Cartesian3;
Cesium.Cartesian3.add(e.majorDragger.position._value, n, a), e.majorDragger.position = new Cesium.ConstantProperty(a), Cesium.Cartesian3.add(e.minorDragger.position._value, n, a), e.minorDragger.position = new Cesium.ConstantProperty(a), void 0 != t.entity.attribute.style.extrudedHeight && t.updateHeightDraggers(), t.entity.changeEditing()
}
});
this.draggers.push(e);
var i = Cesium.EllipseGeometryLibrary.computeEllipsePositions({
center: this.entity.position._value,
semiMinorAxis: this.entity.ellipse.semiMinorAxis._value,
semiMajorAxis: this.entity.ellipse.semiMajorAxis._value,
rotation: Cesium.Math.toRadians(Number(this.entity.attribute.style.rotation || 0)),
granularity: 2
}, !0, !1),
n = new Cesium.Cartesian3(i.positions[0], i.positions[1], i.positions[2]),
r = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: this.options.dragIcon,
position: n,
onDrag: function(e, i) {
var n = Cesium.Cartesian3.distance(t.entity.position._value, i);
t.entity.ellipse.semiMajorAxis = new Cesium.ConstantProperty(n), t.entity.attribute.style.semiMajorAxis = Number(n).toFixed(2), void 0 != t.entity.attribute.style.extrudedHeight && t.updateHeightDraggers(), t.entity.changeEditing()
}
});
e.majorDragger = r, this.draggers.push(r);
var o = new Cesium.Cartesian3(i.positions[3], i.positions[4], i.positions[5]),
a = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: this.options.dragIcon,
position: o,
onDrag: function(e, i) {
var n = Cesium.Cartesian3.distance(t.entity.position._value, i);
t.entity.ellipse.semiMinorAxis = new Cesium.ConstantProperty(n), t.entity.attribute.style.semiMinorAxis = Number(n).toFixed(2), void 0 != t.entity.attribute.style.extrudedHeight && t.updateHeightDraggers(), t.entity.changeEditing()
}
});
e.minorDragger = a, this.draggers.push(a), void 0 != this.entity.attribute.style.extrudedHeight && this.initHeightDraggers()
}, mars3d.drawing.EllipseEditor.prototype.initHeightDraggers = function() {
var t = this,
e = Number(this.entity.attribute.style.extrudedHeight) - Number(this.entity.attribute.style.height),
i = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: this.options.dragIcon,
position: mars3d.drawing.utils.getPositionsWithHeight(this.entity.position._value, e),
onDrag: function(i, n) {
var r = new Cesium.Cartesian3;
Cesium.Cartesian3.subtract(n, t.entity.position._value, r);
var o = Cesium.Cartographic.fromCartesian(n),
a = Number(o.height).toFixed(2);
t.entity.position._value = n, t.entity.ellipse.extrudedHeight = new Cesium.ConstantProperty(Number(a) + Number(e)), t.entity.ellipse.height = new Cesium.ConstantProperty(o.height), t.entity.attribute.style.extrudedHeight = Number(a) + Number(e), t.entity.attribute.style.height = a, t.updateDraggers(), t.entity.changeEditing()
}
});
this.heightDraggers.push(i);
var n = Cesium.EllipseGeometryLibrary.computeEllipsePositions({
center: this.entity.position._value,
semiMinorAxis: this.entity.ellipse.semiMinorAxis._value,
semiMajorAxis: this.entity.ellipse.semiMajorAxis._value,
rotation: Cesium.Math.toRadians(Number(this.entity.attribute.style.rotation || 0)),
granularity: 2
}, !0, !1),
r = new Cesium.Cartesian3(n.positions[0], n.positions[1], n.positions[2]),
o = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: this.options.dragIcon,
position: mars3d.drawing.utils.getPositionsWithHeight(r, e),
onDrag: function(e, i) {
var n = Cesium.Cartographic.fromCartesian(i);
t.entity.ellipse.extrudedHeight = new Cesium.ConstantProperty(n.height), t.entity.attribute.style.extrudedHeight = Number(n.height).toFixed(2), t.updateHeightDraggers(), t.entity.changeEditing()
},
vertical: !0,
horizontal: !1
});
this.heightDraggers.push(o);
var a = new Cesium.Cartesian3(n.positions[3], n.positions[4], n.positions[5]),
s = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: this.options.dragIcon,
position: mars3d.drawing.utils.getPositionsWithHeight(a, e),
onDrag: function(e, i) {
var n = Cesium.Cartographic.fromCartesian(i);
t.entity.ellipse.extrudedHeight = new Cesium.ConstantProperty(n.height), t.entity.attribute.style.extrudedHeight = Number(n.height).toFixed(2), t.updateHeightDraggers(), t.entity.changeEditing()
},
vertical: !0,
horizontal: !1
});
this.heightDraggers.push(s)
}, mars3d.drawing.EllipseEditor.prototype.updateDraggers = function() {
this.destroy(), this.initDraggers()
}, mars3d.drawing.EllipseEditor.prototype.updateHeightDraggers = function() {
for (i = 0; i < this.heightDraggers.length; i++) this.viewer.entities.remove(this.heightDraggers[i]);
this.heightDraggers = [], this.initHeightDraggers()
}, mars3d.drawing.EllipseEditor.prototype.destroy = function() {
var t = 0;
for (t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
if (this.draggers = [], void 0 != this.entity.attribute.style.extrudedHeight) {
for (t = 0; t < this.heightDraggers.length; t++) this.viewer.entities.remove(this.heightDraggers[t]);
this.heightDraggers = []
}
}, mars3d.drawing.EllipsoidEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.options = i, this.draggers = [], this.initDraggers()
}, mars3d.drawing.EllipsoidEditor.prototype.initDraggers = function() {
var t = this,
e = this.entity.position._value,
i = Number(this.entity.attribute.style.heightRadii) || 0,
n = Cesium.Cartographic.fromCartesian(e);
n.height += i;
var r = Cesium.Cartesian3.fromRadians(n.longitude, n.latitude, n.height),
o = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: this.options.dragIcon,
position: r,
onDrag: function(e, i) {
var n = new Cesium.Cartesian3;
Cesium.Cartesian3.subtract(i, t.entity.position._value, n);
var r = Cesium.Cartographic.fromCartesian(i),
o = Number(t.entity.attribute.style.heightRadii) || 0;
r.height -= o;
var a = Cesium.Cartesian3.fromRadians(r.longitude, r.latitude, r.height);
t.entity.position._value = a, t.entity.changeEditing()
}
});
this.draggers.push(o)
}, mars3d.drawing.EllipsoidEditor.prototype.updateDraggers = function() {
this.destroy(), this.initDraggers()
}, mars3d.drawing.EllipsoidEditor.prototype.destroy = function() {
var t = 0;
for (t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
this.draggers = []
}, mars3d.drawing.ExtrudedPolygonEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.draggers = [], this.heightDraggers = [];
var n = this,
r = 0,
o = e.polygon.hierarchy._value;
for (e.polygon.hierarchy.isConstant = !1, r = 0; r < o.length; r++) {
var a = o[r];
if (void 0 != e.polygon.height) {
var s = Cesium.Cartographic.fromCartesian(a);
s.height += e.polygon.height._value, a = Cesium.Cartesian3.fromRadians(s.longitude, s.latitude, s.height)
}
var l = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: a,
onDrag: function(t, i) {
t.positions[t.index] = i;
for (var r = e.polygon.hierarchy._value, o = r[0], a = 1; a < r.length; a++) {
var s = Cesium.Cartographic.fromCartesian(o),
l = Cesium.Cartographic.fromCartesian(r[a]);
Number(l.height) > Number(s.height) && (o = r[a])
}
var u = Number(e.polygon.extrudedHeight) - Number(Cesium.Cartographic.fromCartesian(o).height);
e.attribute.style.extrudedHeight = Number(u).toFixed(2), n.updateDraggers(), e.changeEditing()
}
});
l.index = r, l.positions = o, this.draggers.push(l)
}
if (e.polygon.extrudedHeight) for (r = 0; r < o.length; r++) {
var u = o[r],
c = Cesium.Cartographic.fromCartesian(u);
c.height = e.polygon.extrudedHeight._value;
var h = Cesium.Cartesian3.fromRadians(c.longitude, c.latitude, c.height),
l = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: h,
onDrag: function(t, i) {
for (var r = n.entity.polygon.hierarchy._value, o = r[0], a = 1; a < r.length; a++) {
var s = Cesium.Cartographic.fromCartesian(o),
l = Cesium.Cartographic.fromCartesian(r[a]);
Number(l.height) > Number(s.height) && (o = r[a])
}
var u = Cesium.Cartographic.fromCartesian(i);
e.polygon.extrudedHeight = new Cesium.ConstantProperty(Number(u.height));
var c = Number(u.height) - Number(Cesium.Cartographic.fromCartesian(o).height);
e.attribute.style.extrudedHeight = Number(c).toFixed(2), n.updateDraggers(), e.changeEditing()
},
vertical: !0,
horizontal: !1
});
l.index = r, this.heightDraggers.push(l)
}
}, mars3d.drawing.ExtrudedPolygonEditor.prototype.updateDraggers = function() {
var t = this.entity.polygon.hierarchy._value,
e = this.entity.polygon.extrudedHeight._value,
i = 0;
void 0 != this.entity.polygon.height && (i = this.entity.polygon.height._value);
for (var n = 0; n < this.heightDraggers.length; n++) {
var r = t[n],
o = this.heightDraggers[n],
a = Cesium.Cartographic.fromCartesian(r);
a.height = e;
var s = Cesium.Cartesian3.fromRadians(a.longitude, a.latitude, a.height);
o.position = s;
var l = this.draggers[n],
u = Cesium.Cartographic.fromCartesian(r);
u.height += i, s = Cesium.Cartesian3.fromRadians(u.longitude, u.latitude, u.height), l.position = s
}
}, mars3d.drawing.ExtrudedPolygonEditor.prototype.destroy = function() {
var t = 0;
for (t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
for (this.draggers = [], t = 0; t < this.heightDraggers.length; t++) this.viewer.entities.remove(this.heightDraggers[t]);
this.heightDraggers = []
}, mars3d.drawing.PointEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.draggers = [];
mars3d.drawing.utils.createDragger(this.viewer, {
dragger: e,
onDrag: function(t, i) {
var n = new Cesium.Cartesian3;
Cesium.Cartesian3.subtract(i, e.position._value, n), e.position._value = i, e.changeEditing()
}
})
}, mars3d.drawing.PointEditor.prototype.updateDraggers = function() {}, mars3d.drawing.PointEditor.prototype.destroy = function() {
this.draggers = []
}, mars3d.drawing.PolygonEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.draggers = [];
var n = e.polygon.hierarchy._value;
e.polygon.hierarchy.isConstant = !1;
for (var r = 0; r < n.length; r++) {
var o = n[r],
a = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: o,
heightReference: !e.attribute.style.perPositionHeight,
onDrag: function(t, i) {
t.positions[t.index] = i, e.changeEditing()
}
});
a.index = r, a.positions = n, this.draggers.push(a)
}
}, mars3d.drawing.PolygonEditor.prototype.updateDraggers = function() {
for (var t = this.entity.polygon.hierarchy._value, e = 0; e < this.draggers.length; e++) {
var i = t[e];
this.draggers[e].position = i
}
}, mars3d.drawing.PolygonEditor.prototype.destroy = function() {
this.entity.polygon.hierarchy.isConstant = !0;
for (var t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
this.draggers = []
}, mars3d.drawing.PolylineEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.draggers = [];
var n = e.polyline.positions._value;
e.polyline.positions.isConstant = !1;
for (var r = 0; r < n.length; r++) {
var o = n[r],
a = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: o,
onDrag: function(t, i) {
n[t.index] = i, e.polyline.positions = n, e.changeEditing()
}
});
a.index = r, this.draggers.push(a)
}
}, mars3d.drawing.PolylineEditor.prototype.updateDraggers = function() {
for (var t = this.entity.polyline.positions.getValue(), e = 0; e < this.draggers.length; e++) {
var i = t[e];
this.draggers[e].position = i
}
}, mars3d.drawing.PolylineEditor.prototype.destroy = function() {
this.entity.polyline.positions.isConstant = !0;
for (var t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
this.draggers = []
}, mars3d.drawing.PolylineVolumeEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.draggers = [];
var n = e.polylineVolume.positions.getValue();
e.polylineVolume.positions.isConstant = !1;
for (var r = 0; r < n.length; r++) {
var o = n[r],
a = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: o,
onDrag: function(t, i) {
n[t.index] = i, e.polylineVolume.positions = n, e.changeEditing()
}
});
a.index = r, this.draggers.push(a)
}
}, mars3d.drawing.PolylineVolumeEditor.prototype.updateDraggers = function() {
for (var t = this.entity.polylineVolume.positions.getValue(), e = 0; e < this.draggers.length; e++) {
var i = t[e];
this.draggers[e].position = i
}
}, mars3d.drawing.PolylineVolumeEditor.prototype.destroy = function() {
this.entity.polylineVolume.positions.isConstant = !0;
for (var t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
this.draggers = []
}, mars3d.drawing.RectangleEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.draggers = [];
var n = this.getDraggersPositions();
e.rectangle.coordinates.isConstant = !1;
for (var r = 0; r < n.length; r++) {
var o = n[r],
a = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: o,
heightReference: !e.attribute.style.perPositionHeight,
onDrag: function(t, i) {
t.positions[t.index] = i;
var n;
n = 0 == t.index ? Cesium.Rectangle.fromCartesianArray([i, t.positions[1]]) : Cesium.Rectangle.fromCartesianArray([i, t.positions[0]]), e.rectangle.coordinates.setValue(n), e.changeEditing()
}
});
a.index = r, a.positions = n, this.draggers.push(a)
}
}, mars3d.drawing.RectangleEditor.prototype.updateDraggers = function() {
for (var t = this.getDraggersPositions(), e = 0; e < this.draggers.length; e++) {
var i = t[e];
this.draggers[e].position = i
}
}, mars3d.drawing.RectangleEditor.prototype.getDraggersPositions = function() {
var t = this.entity.rectangle.coordinates._value,
e = Cesium.Rectangle.northwest(t),
i = Cesium.Rectangle.southeast(t);
return Cesium.Cartesian3.fromRadiansArray([e.longitude, e.latitude, i.longitude, i.latitude])
}, mars3d.drawing.RectangleEditor.prototype.destroy = function() {
this.entity.rectangle.coordinates.isConstant = !0;
for (var t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
this.draggers = []
}, mars3d.drawing.RectangleExtrudedEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.draggers = [], this.heightDraggers = [];
var n = this,
r = 0,
o = this.getDraggersPositions();
for (e.rectangle.coordinates.isConstant = !1, r = 0; r < o.length; r++) {
var a = o[r];
if (void 0 != e.rectangle.height) {
var s = Cesium.Cartographic.fromCartesian(a);
s.height += e.rectangle.height._value, a = Cesium.Cartesian3.fromRadians(s.longitude, s.latitude, s.height)
}
var l = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: a,
onDrag: function(t, i) {
t.positions[t.index] = i;
var r;
r = 0 == t.index ? Cesium.Rectangle.fromCartesianArray([i, t.positions[1]]) : Cesium.Rectangle.fromCartesianArray([i, t.positions[0]]), e.rectangle.coordinates.setValue(r), n.updateDraggers(), e.changeEditing()
}
});
l.index = r, l.positions = o, this.draggers.push(l)
}
if (e.rectangle.extrudedHeight) for (r = 0; r < o.length; r++) {
var u = o[r],
s = Cesium.Cartographic.fromCartesian(u);
s.height += e.rectangle.extrudedHeight._value;
var a = Cesium.Cartesian3.fromRadians(s.longitude, s.latitude, s.height),
l = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: a,
onDrag: function(t, i) {
var r = Cesium.Cartographic.fromCartesian(i);
e.rectangle.extrudedHeight = new Cesium.ConstantProperty(r.height);
var o = Number(r.height) - Number(e.rectangle.height);
e.attribute.style.extrudedHeight = Number(o).toFixed(2), n.updateDraggers(), e.changeEditing()
},
vertical: !0,
horizontal: !1
});
l.index = r, this.heightDraggers.push(l)
}
}, mars3d.drawing.RectangleExtrudedEditor.prototype.getDraggersPositions = function() {
var t = this.entity.rectangle.coordinates._value,
e = Cesium.Rectangle.northwest(t),
i = Cesium.Rectangle.southeast(t);
return Cesium.Cartesian3.fromRadiansArray([e.longitude, e.latitude, i.longitude, i.latitude])
}, mars3d.drawing.RectangleExtrudedEditor.prototype.updateDraggers = function() {
var t = this.getDraggersPositions(),
e = this.entity.rectangle.extrudedHeight._value,
i = 0;
void 0 != this.entity.rectangle.height && (i = this.entity.rectangle.height._value);
for (var n = 0; n < this.heightDraggers.length; n++) {
var r = t[n],
o = this.heightDraggers[n],
a = Cesium.Cartographic.fromCartesian(r);
a.height += e;
var s = Cesium.Cartesian3.fromRadians(a.longitude, a.latitude, a.height);
o.position = s;
var l = this.draggers[n],
u = Cesium.Cartographic.fromCartesian(r);
u.height += i, s = Cesium.Cartesian3.fromRadians(u.longitude, u.latitude, u.height), l.position = s
}
}, mars3d.drawing.RectangleExtrudedEditor.prototype.destroy = function() {
var t = 0;
for (t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
for (this.draggers = [], t = 0; t < this.heightDraggers.length; t++) this.viewer.entities.remove(this.heightDraggers[t]);
this.heightDraggers = []
}, mars3d.drawing.WallEditor = function(t, e, i) {
this.viewer = t, this.entity = e, this.draggers = [], this.heightDraggers = [];
var n = this,
r = 0,
o = e.wall.positions._value;
for (e.wall.positions.isConstant = !1, r = 0; r < o.length; r++) {
var a = o[r],
s = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: a,
onDrag: function(t, i) {
t.positions[t.index] = i, n.updateDraggers(), e.changeEditing()
}
});
s.index = r, s.positions = o, this.draggers.push(s)
}
if (e.wall.maximumHeights) for (r = 0; r < o.length; r++) {
var l = o[r],
u = Cesium.Cartographic.fromCartesian(l.clone());
u.height = e.wall.maximumHeights._value[r];
var a = Cesium.Cartesian3.fromRadians(u.longitude, u.latitude, u.height),
s = mars3d.drawing.utils.createDragger(this.viewer, {
dragIcon: i.dragIcon,
position: a,
onDrag: function(t, i) {
var r = Cesium.Cartographic.fromCartesian(i),
o = n.entity.wall.minimumHeights._value,
a = Number(r.height) - Number(o[t.index]);
e.attribute.style.extrudedHeight = a.toFixed(2), n.updateDraggers(), e.changeEditing()
},
vertical: !0,
horizontal: !1
});
s.index = r, this.heightDraggers.push(s)
}
}, mars3d.drawing.WallEditor.prototype.updateDraggers = function() {
for (var t = this.entity.wall.positions._value, e = this.entity.wall.minimumHeights._value, i = this.entity.wall.maximumHeights._value, n = 0; n < this.heightDraggers.length; n++) {
var r = t[n].clone(),
o = this.heightDraggers[n],
a = Cesium.Cartographic.fromCartesian(r);
e[n] = a.height, i[n] = Number(a.height) + Number(this.entity.attribute.style.extrudedHeight), o.position = mars3d.drawing.utils.getPositionsWithHeight(r, this.entity.attribute.style.extrudedHeight), this.draggers[n].position = r
}
}, mars3d.drawing.WallEditor.prototype.destroy = function() {
var t = 0;
for (t = 0; t < this.draggers.length; t++) this.viewer.entities.remove(this.draggers[t]);
for (this.draggers = [], t = 0; t < this.heightDraggers.length; t++) this.viewer.entities.remove(this.heightDraggers[t]);
this.heightDraggers = []
}, mars3d.drawing.BillboardControl = {
typename: "billboard",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
billboard: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "opacity":
e.color = new Cesium.Color.fromCssColorString("#FFFFFF").withAlpha(Number(n || 1));
break;
case "rotation":
e.rotation = Cesium.Math.toRadians(n)
}
}
return e
},
getEditor: function(t, e, i) {
return new mars3d.drawing.PointEditor(t, e, i)
},
setPositions: function(t, e) {
t.position = new mars3d.drawing.DynamicProperty(e)
},
getPositions: function(t) {
return [t.position._value]
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "Point",
coordinates: e
}
}
}
}, mars3d.drawing.EllipseControl = {
typename: "ellipse",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
ellipse: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
show: !0,
fill: !0
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "opacity":
case "outlineOpacity":
break;
case "outlineColor":
e.outlineColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(t.style.outlineOpacity || t.style.opacity || 1);
break;
case "color":
e.material = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1));
break;
case "rotation":
e.rotation = Cesium.Math.toRadians(n)
}
}
return e
},
getEditor: function(t, e, i) {
return new mars3d.drawing.EllipseEditor(t, e, i)
},
setPositions: function(t, e) {
t.position = new mars3d.drawing.DynamicProperty(e)
},
getPositions: function(t) {
return [t.position._value]
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "Point",
coordinates: e
}
}
}
}, mars3d.drawing.EllipsoidControl = {
typename: "ellipsoid",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
ellipsoid: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
show: !0,
fill: !0
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "opacity":
case "outlineOpacity":
case "widthRadii":
case "heightRadii":
break;
case "outlineColor":
e.outlineColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(t.style.outlineOpacity || t.style.opacity || 1);
break;
case "color":
e.material = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1));
break;
case "extentRadii":
var r = t.style.extentRadii || 100,
o = t.style.widthRadii || 100,
a = t.style.heightRadii || 100;
e.radii = new Cesium.Cartesian3(r, o, a)
}
}
return e
},
getEditor: function(t, e, i) {
return new mars3d.drawing.EllipsoidEditor(t, e, i)
},
setPositions: function(t, e) {
t.position = new mars3d.drawing.DynamicProperty(e)
},
getPositions: function(t) {
return [t.position._value]
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "Point",
coordinates: e
}
}
}
}, mars3d.drawing.LabelControl = {
typename: "label",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
label: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
show: !0,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "font_style":
case "font_weight":
case "font_size":
case "font_family":
case "text":
break;
case "color":
e.fillColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1));
break;
case "border":
e.style = n ? Cesium.LabelStyle.FILL_AND_OUTLINE : Cesium.LabelStyle.FILL;
break;
case "border_color":
e.outlineColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1));
break;
case "border_width":
e.outlineWidth = n;
break;
case "background":
e.showBackground = n;
break;
case "background_color":
e.backgroundColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1));
break;
case "pixelOffset":
e.pixelOffset = new Cesium.Cartesian2(t.style.pixelOffset[0], t.style.pixelOffset[1])
}
}
e.text = (t.style.text || "文字").replace(new RegExp(" ", "gm"), "\n");
var r = (t.style.font_style || "normal") + " small-caps " + (t.style.font_weight || "normal") + " " + (t.style.font_size || "30") + "px " + (t.style.font_family || "黑体");
return e.font = r, e
},
getEditor: function(t, e, i) {
return new mars3d.drawing.PointEditor(t, e, i)
},
setPositions: function(t, e) {
t.position = new mars3d.drawing.DynamicProperty(e)
},
getPositions: function(t) {
return [t.position._value]
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "Point",
coordinates: e
}
}
}
}, mars3d.drawing.ModelControl = {
typename: "model",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
model: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
show: !0
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "silhouette":
case "silhouetteColor":
case "silhouetteAlpha":
case "silhouetteSize":
case "fill":
case "color":
case "opacity":
break;
case "modelUrl":
e.uri = n
}
}
return t.style.silhouette ? (e.silhouetteColor = new Cesium.Color.fromCssColorString(t.style.silhouetteColor || "#FFFFFF").withAlpha(Number(t.style.silhouetteAlpha || 1)), e.silhouetteSize = Number(t.style.silhouetteSize || 1)) : e.silhouetteSize = 0, t.style.fill ? e.color = new Cesium.Color.fromCssColorString(t.style.color || "#FFFFFF").withAlpha(Number(t.style.opacity || 1)) : e.color = new Cesium.Color.fromCssColorString("#FFFFFF").withAlpha(Number(t.style.opacity || 1)), e
},
attribute2Model: function(t, e) {
var i = Cesium.Math.toRadians(Number(e.attribute.style.heading || 0)),
n = Cesium.Math.toRadians(Number(e.attribute.style.pitch || 0)),
r = Cesium.Math.toRadians(Number(e.attribute.style.roll || 0)),
o = new Cesium.HeadingPitchRoll(i, n, r);
e.orientation && (e.orientation = Cesium.Transforms.headingPitchRollQuaternion(e.position._value, o))
},
getEditor: function(t, e, i) {
return new mars3d.drawing.PointEditor(t, e, i)
},
setPositions: function(t, e) {
t.position = new mars3d.drawing.DynamicProperty(e);
var i = Cesium.Math.toRadians(Number(t.attribute.style.heading || 0)),
n = Cesium.Math.toRadians(Number(t.attribute.style.pitch || 0)),
r = Cesium.Math.toRadians(Number(t.attribute.style.roll || 0)),
o = new Cesium.HeadingPitchRoll(i, n, r);
t.orientation = Cesium.Transforms.headingPitchRollQuaternion(t.position._value, o)
},
getPositions: function(t) {
return [t.position._value]
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "Point",
coordinates: e
}
}
}
}, mars3d.drawing.PointControl = {
typename: "point",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
point: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
show: !0
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "opacity":
case "outlineOpacity":
break;
case "outlineColor":
e.outlineColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(t.style.outlineOpacity || t.style.opacity || 1);
break;
case "color":
e.color = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1))
}
}
return t.style.outline || (e.outlineWidth = 0), e
},
getEditor: function(t, e, i) {
return new mars3d.drawing.PointEditor(t, e, i)
},
setPositions: function(t, e) {
t.position = new mars3d.drawing.DynamicProperty(e)
},
getPositions: function(t) {
return [t.position._value]
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "Point",
coordinates: e
}
}
}
}, mars3d.drawing.PolygonControl = {
typename: "polygon",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
polygon: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
show: !0,
fill: !0,
hierarchy: new mars3d.drawing.DynamicProperty([],"polygon")
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "opacity":
case "outlineOpacity":
break;
case "outlineColor":
e.outlineColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(t.style.outlineOpacity || t.style.opacity || 1);
break;
case "color":
e.material = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1));
break;
case "extrudedHeight":
var r = mars3d.drawing.utils.getMaxHeightForPositions(e.hierarchy._value);
e.extrudedHeight = Number(n) + r
}
}
return null == t.style.color && (e.material = Cesium.Color.fromRandom({
minimumGreen: .75,
maximumBlue: .75,
alpha: Number(t.style.opacity || 1)
})), e
},
getEditor: function(t, e, i) {
return e.polygon.extrudedHeight ? new mars3d.drawing.ExtrudedPolygonEditor(t, e, i) : new mars3d.drawing.PolygonEditor(t, e, i)
},
setPositions: function(t, e) {
if (t.polygon.hierarchy = new mars3d.drawing.DynamicProperty(e), t.attribute.style.extrudedHeight) {
var i = mars3d.drawing.utils.getMaxHeightForPositions(e);
t.polygon.extrudedHeight = i + Number(t.attribute.style.extrudedHeight)
}
},
getPositions: function(t) {
return t.polygon.hierarchy._value
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t),
i = e[0],
n = e[e.length - 1];
return i[0] == n[0] && i[1] == n[1] && i[2] == n[2] || e.push(i), {
type: "Feature",
properties: t.attribute,
geometry: {
type: "Polygon",
coordinates: [e]
}
}
}
}, mars3d.drawing.PolylineControl = {
typename: "polyline",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
polyline: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
followSurface: !0,
positions: new mars3d.drawing.DynamicProperty([])
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "lineType":
case "color":
case "opacity":
case "outline":
case "outlineWidth":
case "outlineColor":
case "outlineOpacity":
}
}
var r = new Cesium.Color.fromCssColorString(t.style.color || "#FFFF00").withAlpha(Number(t.style.opacity || 1));
switch (t.style.lineType) {
default:
case "solid":
t.style.outline ? e.material = new Cesium.PolylineOutlineMaterialProperty({
color: r,
outlineWidth: Number(t.style.outlineWidth || 1),
outlineColor: new Cesium.Color.fromCssColorString(t.style.outlineColor || "#FFFF00").withAlpha(Number(t.style.outlineOpacity || t.style.opacity || 1))
}) : e.material = r;
break;
case "dash":
e.material = new Cesium.PolylineDashMaterialProperty({
color: r
})
}
return e
},
getEditor: function(t, e, i) {
return new mars3d.drawing.PolylineEditor(t, e, i)
},
setPositions: function(t, e) {
t.polyline.positions.setValue(e)
},
getPositions: function(t) {
return t.polyline.positions._value
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "LineString",
coordinates: e
}
}
}
}, mars3d.drawing.PolylineVolumeControl = {
typename: "polylineVolume",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
polylineVolume: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
null == e && (e = {
positions: new mars3d.drawing.DynamicProperty([])
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "opacity":
case "outlineOpacity":
case "radius":
case "shape":
break;
case "outlineColor":
e.outlineColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(t.style.outlineOpacity || t.style.opacity || 1);
break;
case "color":
e.material = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1))
}
}
switch (t.style.radius = t.style.radius || 10, t.style.shape) {
default:
case "pipeline":
e.shape = this._getCorridorShape1(t.style.radius);
break;
case "circle":
e.shape = this._getCorridorShape2(t.style.radius);
break;
case "star":
e.shape = this._getCorridorShape3(t.style.radius)
}
return e
},
_getCorridorShape1: function(t) {
for (var e = t / 3, i = 0, n = 360, r = [], o = i; o <= n; o++) {
var a = Cesium.Math.toRadians(o);
r.push(new Cesium.Cartesian2(t * Math.cos(a), t * Math.sin(a)))
}
for (var o = n; o >= i; o--) {
var a = Cesium.Math.toRadians(o);
r.push(new Cesium.Cartesian2((t - e) * Math.cos(a), (t - e) * Math.sin(a)))
}
return r
},
_getCorridorShape2: function(t) {
for (var e = 0, i = 360, n = [], r = e; r <= i; r++) {
var o = Cesium.Math.toRadians(r);
n.push(new Cesium.Cartesian2(t * Math.cos(o), t * Math.sin(o)))
}
return n
},
_getCorridorShape3: function(t, e) {
for (var e = e || 6, i = Math.PI / e, n = 2 * e, r = new Array(n), o = 0; o < n; o++) {
var a = o % 2 === 0 ? t : t / 3;
r[o] = new Cesium.Cartesian2(Math.cos(o * i) * a, Math.sin(o * i) * a)
}
return r
},
getEditor: function(t, e, i) {
return new mars3d.drawing.PolylineVolumeEditor(t, e, i)
},
setPositions: function(t, e) {
t.polylineVolume.positions = e
},
getPositions: function(t) {
return t.polylineVolume.positions._value
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "LineString",
coordinates: e
}
}
}
}, mars3d.drawing.RectangleControl = {
typename: "rectangle",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
rectangle: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
if (!e) {
var i = Cesium.Rectangle.fromDegrees(78.654473, 34.878143, 78.654673, 34.878316);
e = {
show: !0,
fill: !0,
closeTop: !0,
closeBottom: !0,
coordinates: i
}
}
for (var n in t.style) {
var r = t.style[n];
switch (n) {
default:
e[n] = r;
break;
case "opacity":
case "outlineOpacity":
break;
case "outlineColor":
e.outlineColor = new Cesium.Color.fromCssColorString(r || "#FFFF00").withAlpha(t.style.outlineOpacity || t.style.opacity || 1);
break;
case "height":
e.height = Number(r), e.extrudedHeight = Number(t.style.extrudedHeight) + Number(r);
break;
case "extrudedHeight":
e.extrudedHeight = Number(e.height) + Number(r);
break;
case "color":
e.material = new Cesium.Color.fromCssColorString(r || "#FFFF00").withAlpha(Number(t.style.opacity || 1));
break;
case "image":
e.material = t.style.image;
break;
case "rotation":
e.rotation = Cesium.Math.toRadians(r), t.style.stRotation || (e.stRotation = Cesium.Math.toRadians(r));
break;
case "stRotation":
e.stRotation = Cesium.Math.toRadians(r)
}
}
return null == e.material && (e.material = Cesium.Color.fromRandom({
minimumGreen: .75,
maximumBlue: .75,
alpha: Number(t.style.opacity || 1)
})), e
},
getEditor: function(t, e, i) {
return e.rectangle.extrudedHeight ? new mars3d.drawing.RectangleExtrudedEditor(t, e, i) : new mars3d.drawing.RectangleEditor(t, e, i)
},
setPositions: function(t, e) {
e instanceof Array && (e = Cesium.Rectangle.fromCartesianArray(e)), t.rectangle.coordinates.setValue(e)
},
getPositions: function(t) {
return t.rectangle.coordinates
},
getCoordinates: function(t) {
var e = this.getDiagonalPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
getDiagonalPositions: function(t) {
var e = t.rectangle.coordinates._value,
i = Cesium.Rectangle.northwest(e),
n = Cesium.Rectangle.southeast(e);
return Cesium.Cartesian3.fromRadiansArray([i.longitude, i.latitude, n.longitude, n.latitude])
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "MultiPoint",
coordinates: e
}
}
}
}, mars3d.drawing.WallControl = {
typename: "wall",
startDraw: function(t, e) {
var i = this.attribute2Entity(e),
n = t.entities.add({
wall: i,
attribute: e
});
return n
},
attribute2Entity: function(t, e) {
e || (e = {
show: !0,
fill: !0,
minimumHeights: [],
maximumHeights: [],
positions: new mars3d.drawing.DynamicProperty([])
});
for (var i in t.style) {
var n = t.style[i];
switch (i) {
default:
e[i] = n;
break;
case "opacity":
case "outlineOpacity":
break;
case "outlineColor":
e.outlineColor = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(t.style.outlineOpacity || t.style.opacity || 1);
break;
case "color":
e.material = new Cesium.Color.fromCssColorString(n || "#FFFF00").withAlpha(Number(t.style.opacity || 1))
}
}
return null == e.material && (e.material = Cesium.Color.fromRandom({
minimumGreen: .75,
maximumBlue: .75,
alpha: Number(t.style.opacity || 1)
})), e
},
getEditor: function(t, e, i) {
return new mars3d.drawing.WallEditor(t, e, i)
},
setPositions: function(t, e) {
if (t.wall.positions = new mars3d.drawing.DynamicProperty(e), t.wall.maximumHeights && t.wall.minimumHeights) for (var i = 0; i < e.length; i++) {
var n = Cesium.Cartographic.fromCartesian(e[i]);
t.wall.minimumHeights._value[i] = Number(n.height), t.wall.maximumHeights._value[i] = Number(n.height) + Number(t.attribute.style.extrudedHeight)
}
},
getPositions: function(t) {
return t.wall.positions._value
},
setMaximumHeights: function(t, e) {
t.wall.maximumHeights = new mars3d.drawing.DynamicProperty(e)
},
getMaximumHeights: function(t) {
return t.wall.maximumHeights._value
},
setMinimumHeights: function(t, e) {
t.wall.minimumHeights = new mars3d.drawing.DynamicProperty(e)
},
getMinimumHeights: function(t) {
return t.wall.minimumHeights._value
},
getCoordinates: function(t) {
var e = this.getPositions(t),
i = mars3d.drawing.utils.getCoordinates(e);
return i
},
toGeoJSON: function(t) {
var e = this.getCoordinates(t);
return {
type: "Feature",
properties: t.attribute,
geometry: {
type: "LineString",
coordinates: e
}
}
}
}, mars3d.drawing.EventControl = function(t) {
this.viewer = t, t.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), t.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK)
}, mars3d.drawing.EventControl.prototype.createDrawPointHandler = function(t) {
var e = this;
t.inProgress = !0;
var i = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
return i.setInputAction(function(n) {
var r = mars3d.latlng.getCurrentMousePosition(e.viewer.scene, n.position);
r && (t.updatePositions(r), t.inProgress = !1, t.stopDrawing(), t.startEditing(), i.destroy(), e.drawHandler = null)
}, Cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler = i, i
},
mars3d.drawing.EventControl.prototype.createDrawPolylineHandler = function(t, e) {
var i = this;
t.inProgress = !0;
var n = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
return n.lastPointTemporary = !1, n.setInputAction(function(r) {
var o = mars3d.latlng.getCurrentMousePosition(i.viewer.scene, r.position);
o && (n.lastPointTemporary && e.pop(), e.push(o), n.lastPointTemporary = !1, t.attribute && t.attribute.minMaxPoints && (e.length == t.attribute.minMaxPoints.min && e.length == t.attribute.minMaxPoints.max || t.attribute.minMaxPoints.isSuper && 4 == e.length) && (t.inProgress = !1, n.destroy(), i.drawHandler = null, t.stopDrawing(), t.startEditing()), t.changeDrawing())
}, Cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function(r) {
if (r.endPosition) {
var o = mars3d.latlng.getCurrentMousePosition(i.viewer.scene, r.endPosition);
o && (n.lastPointTemporary && e.pop(), e.push(o), n.lastPointTemporary = !0, t.moveDrawing())
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE), n.setInputAction(function(r) {
t.inProgress = !1, n.destroy(), i.drawHandler = null, e.pop(), t.stopDrawing(), t.startEditing()
}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.drawHandler = n, n
},
mars3d.drawing.EventControl.prototype.createDrawPolygonHandler = function(t, e) {
var i = this;
t.inProgress = !0;
var n = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
return n.lastPointTemporary = !1, n.setInputAction(function(r) {
var o = mars3d.latlng.getCurrentMousePosition(i.viewer.scene, r.position);
if (o) {
if (n.lastPointTemporary && e.pop(), e.push(o), t.attribute.style.extrudedHeight) {
var a = mars3d.drawing.utils.getMaxHeightForPositions(e);
t.polygon.extrudedHeight = a + Number(t.attribute.style.extrudedHeight)
}
n.lastPointTemporary = !1, t.changeDrawing()
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function(r) {
if (r.endPosition) {
var o = mars3d.latlng.getCurrentMousePosition(i.viewer.scene, r.endPosition);
if (o) {
if (n.lastPointTemporary && e.pop(), e.push(o), t.attribute.style.extrudedHeight) {
var a = mars3d.drawing.utils.getMaxHeightForPositions(e);
t.polygon.extrudedHeight = a + Number(t.attribute.style.extrudedHeight)
}
n.lastPointTemporary = !0, t.moveDrawing()
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE), n.setInputAction(function(r) {
t.inProgress = !1, n.destroy(), i.drawHandler = null, e.pop(), t.stopDrawing(), t.startEditing()
}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.drawHandler = n, n
}, mars3d.drawing.EventControl.prototype.createTwoPointsModelHandler = function(t, e) {
var i = this;
t.inProgress = !0;
var n = [],
r = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
return r.lastPointTemporary = !1, r.setInputAction(function(o) {
var a = mars3d.latlng.getCurrentMousePosition(i.viewer.scene, o.position);
if (a) {
if (r.lastPointTemporary && n.pop(), n.push(a), 1 == n.length && t.attribute.style.extrudedHeight) {
var s = Number(Cesium.Cartographic.fromCartesian(a).height).toFixed(2);
t.rectangle.height = Number(s), t.rectangle.extrudedHeight = Number(s) + Number(t.attribute.style.extrudedHeight), t.attribute.style.height = Number(s)
}
if (2 == n.length) {
var l = Cesium.Rectangle.fromCartesianArray(n);
e.setValue(l)
}
r.lastPointTemporary = !1, t.changeDrawing(), 2 == n.length && (t.inProgress = !1, r.destroy(), i.drawHandler = null, t.stopDrawing(), t.startEditing())
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK), r.setInputAction(function(o) {
if (o.endPosition) {
var a = mars3d.latlng.getCurrentMousePosition(i.viewer.scene, o.endPosition);
if (a) {
if (r.lastPointTemporary && n.pop(), n.push(a), 2 == n.length) {
var s = Cesium.Rectangle.fromCartesianArray(n);
e.setValue(s)
}
r.lastPointTemporary = !0, t.moveDrawing()
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler = r, r
}, mars3d.drawing.EventControl.prototype.createDrawWallHandler = function(t, e, i, n) {
var r = this;
t.inProgress = !0;
var o = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
return o.lastPointTemporary = !1, o.setInputAction(function(a) {
var s = mars3d.latlng.getCurrentMousePosition(r.viewer.scene, a.position);
if (s) {
o.lastPointTemporary && (e.pop(), i.pop(), n.pop()), e.push(s);
var l = Cesium.Cartographic.fromCartesian(s),
u = Number(l.height).toFixed(2),
c = Number(u) + Number(t.attribute.style.extrudedHeight);
i.push(u), n.push(c), o.lastPointTemporary = !1, t.changeDrawing()
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK), o.setInputAction(function(a) {
if (a.endPosition) {
var s = mars3d.latlng.getCurrentMousePosition(r.viewer.scene, a.endPosition);
if (s) {
o.lastPointTemporary && (e.pop(), i.pop(), n.pop()), e.push(s);
var l = Cesium.Cartographic.fromCartesian(s),
u = Number(l.height).toFixed(2),
c = Number(u) + Number(t.attribute.style.extrudedHeight);
i.push(u), n.push(c), o.lastPointTemporary = !0, t.moveDrawing()
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE), o.setInputAction(function(a) {
t.inProgress = !1, o.destroy(), r.drawHandler = null, e.pop(), i.pop(), n.pop(), t.stopDrawing(), t.startEditing()
}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.drawHandler = o, o
}, mars3d.drawing.EventControl.prototype.destroyDrawHandler = function() {
this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = null)
}, mars3d.drawing.EventControl.prototype.createEditSelectHandler = function(t) {
var e = this,
i = new Cesium.ScreenSpaceEventHandler(this.viewer.canvas);
i.setInputAction(function(i) {
var n = e.viewer.scene.pick(i.position),
r = null;
if (Cesium.defined(n)) {
var o = Cesium.defaultValue(n.id, n.primitive.id);
if (o instanceof Cesium.Entity) {
var a = Cesium.defaultValue(o.inProgress, !1);
a || (r = o)
}
}
t(r)
}, Cesium.ScreenSpaceEventType.LEFT_CLICK), this.selectHandler = i
}, mars3d.drawing.EventControl.prototype.createEditDraggerHandler = function() {
var t = new Cesium.ScreenSpaceEventHandler(this.viewer.canvas);
t.dragger = null;
var e = this;
t.setInputAction(function(i) {
var n = e.viewer.scene.pick(i.position);
if (Cesium.defined(n)) {
var r = n.id;
r && Cesium.defaultValue(r._isDragger, !1) && (r.billboard && (r.billboard.scale_src = r.billboard.scale._value, r.billboard.scale._value = 1.2 * r.billboard.scale_src), t.dragger = r, e.viewer.scene.screenSpaceCameraController.enableRotate = !1, e.viewer.scene.screenSpaceCameraController.enableTilt = !1, e.viewer.scene.screenSpaceCameraController.enableTranslate = !1)
}
}, Cesium.ScreenSpaceEventType.LEFT_DOWN), t.setInputAction(function(i) {
var n = e.viewer.scene.pick(i.position);
if (Cesium.defined(n)) {
var r = n.id;
r && Cesium.defaultValue(r._isDragger, !1) && (r.billboard && (r.billboard.scale_src = r.billboard.scale._value, r.billboard.scale._value = 1.2 * r.billboard.scale_src), t.dragger = r, e.viewer.scene.screenSpaceCameraController.enableRotate = !1, e.viewer.scene.screenSpaceCameraController.enableTilt = !1, e.viewer.scene.screenSpaceCameraController.enableTranslate = !1)
}
}, Cesium.ScreenSpaceEventType.LEFT_DOWN, Cesium.KeyboardEventModifier.CTRL), t.setInputAction(function(n) {
if (t.dragger) {
if (t.dragger.horizontal) {
var r;
if (t.dragger.model) {
var o = e.viewer.scene,
a = o.pick(n.endPosition);
if (Cesium.defined(a) && a.id == t.dragger) {
var s = o.camera.getPickRay(n.endPosition);
r = o.globe.pick(s, o)
}
}
null == r && (r = mars3d.latlng.getCurrentMousePosition(e.viewer.scene, n.endPosition)), r && (t.dragger.position = r, t.dragger.onDrag && t.dragger.onDrag(t.dragger, r))
}
if (t.dragger.vertical) {
var l = n.endPosition.y - n.startPosition.y,
u = t.dragger.position._value,
c = new Cesium.EllipsoidTangentPlane(u);
i.center = u, i.radius = 1;
var h = e.viewer.scene.frameState.camera.getPixelSize(i, e.viewer.scene.frameState.context.drawingBufferWidth, e.viewer.scene.frameState.context.drawingBufferHeight),
d = new Cesium.Cartesian3;
Cesium.Cartesian3.multiplyByScalar(c.zAxis, -l * h, d);
var p = Cesium.Cartesian3.clone(u);
Cesium.Cartesian3.add(u, d, p), t.dragger.position = p, t.dragger.onDrag && t.dragger.onDrag(t.dragger, p)
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
var i = new Cesium.BoundingSphere;
t.setInputAction(function(n) {
if (t.dragger && t.dragger.verticalCtrl) {
var r = n.endPosition.y - n.startPosition.y,
o = t.dragger.position._value,
a = new Cesium.EllipsoidTangentPlane(o);
i.center = o, i.radius = 1;
var s = e.viewer.scene.frameState.camera.getPixelSize(i, e.viewer.scene.frameState.context.drawingBufferWidth, e.viewer.scene.frameState.context.drawingBufferHeight),
l = new Cesium.Cartesian3;
Cesium.Cartesian3.multiplyByScalar(a.zAxis, -r * s, l);
var u = Cesium.Cartesian3.clone(o);
Cesium.Cartesian3.add(o, l, u), t.dragger.position = u, t.dragger.onDrag && t.dragger.onDrag(t.dragger, u)
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE, Cesium.KeyboardEventModifier.CTRL), t.setInputAction(function() {
t.dragger && (t.dragger.billboard && (t.dragger.billboard.scale._value = t.dragger.billboard.scale_src), t.dragger = null, e.viewer.scene.screenSpaceCameraController.enableRotate = !0, e.viewer.scene.screenSpaceCameraController.enableTilt = !0, e.viewer.scene.screenSpaceCameraController.enableTranslate = !0)
}, Cesium.ScreenSpaceEventType.LEFT_UP), t.setInputAction(function() {
t.dragger && (t.dragger.billboard && (t.dragger.billboard.scale._value = t.dragger.billboard.scale_src), t.dragger = null, e.viewer.scene.screenSpaceCameraController.enableRotate = !0, e.viewer.scene.screenSpaceCameraController.enableTilt = !0, e.viewer.scene.screenSpaceCameraController.enableTranslate = !0)
}, Cesium.ScreenSpaceEventType.LEFT_UP, Cesium.KeyboardEventModifier.CTRL), this.draggerHandler = t
}, mars3d.drawing.EventControl.prototype.destroyEditHandler = function() {
this.selectHandler && (this.selectHandler.destroy(), this.selectHandler = null), this.draggerHandler && (this.draggerHandler.destroy(), this.draggerHandler = null)
}, mars3d.Draw = function(t) {
function e(e) {
L = e, e ? (k.createEditSelectHandler(function(e) {
x && x.inProgress || (e !== x ? (x && x.stopEditing && (x.stopEditing(), x = null), x = e, x && x.startEditing && x.startEditing()) : t.onStopEditing && "function" == typeof t.onStopEditing && t.onStopEditing())
}), k.createEditDraggerHandler()) : (n(), k.destroyEditHandler())
}
function i(t) {
if (n(), null == t || null == t.type) throw "请传入需要绘制的类型参数";
t.style = t.style || {}, t.attr = t.attr || {};
var e = t.type;
if (null == b[e]) throw "传入的[" + e + "]类型参数有误";
var i = b[e].startDraw(w, t);
switch (e) {
case "label":
case "point":
case "billboard":
case "model":
case "ellipse":
case "ellipsoid":
k.createDrawPointHandler(i);
break;
case "polyline":
case "polylineVolume":
k.createDrawPolylineHandler(i, b[e].getPositions(i));
break;
case "polygon":
k.createDrawPolygonHandler(i, b[e].getPositions(i));
break;
case "rectangle":
case "extrudedRectangle":
case "measureHeight":
k.createTwoPointsModelHandler(i, b[e].getPositions(i));
break;
case "wall":
var r = b[e].getPositions(i),
o = b[e].getMinimumHeights(i),
s = b[e].getMaximumHeights(i);
k.createDrawWallHandler(i, r, o, s)
}
return a(i), E.push(i), i.startDrawing(), x = i, i
}
function n() {
return k.destroyDrawHandler(), x && x.inProgress && (x.stopDrawing(), w.entities.remove(x), y(E, x)), x && (x.stopEditing(), x = null), this
}
function r(t) {
if (null != x && null != t) {
t.style = t.style || {}, t.attr = t.attr || {};
var e = x.attribute.type;
return b[e].attribute2Entity(t, x[e]), "model" == e && b[e].attribute2Model(t, x), x.attribute = t, "ellipse" != e && "polygon" != e && "wall" != e && "rectangle" != e || x.editor.updateDraggers(), x
}
}
function o(t) {
if (null != x && null != t) {
var e = x.attribute.type;
return b[e].setPositions(x, t), x.editor.updateDraggers(), x
}
}
function a(e) {
e.startDrawing = function() {
$(".cesium-viewer").css("cursor", "crosshair");
var e = this;
t.onStartDrawing && "function" == typeof t.onStartDrawing && t.onStartDrawing(e)
}, e.changeDrawing = function() {
var e = this;
t.onChangeDrawing && "function" == typeof t.onChangeDrawing && t.onChangeDrawing(e)
}, e.moveDrawing = function() {
var e = this;
t.onMoveDrawing && "function" == typeof t.onMoveDrawing && t.onMoveDrawing(e)
}, e.stopDrawing = function() {
$(".cesium-viewer").css("cursor", "");
var e = this;
t.onStopDrawing && "function" == typeof t.onStopDrawing && t.onStopDrawing(e)
}, e.startEditing = function() {
if (L) {
var e = this;
if (null == e.editor) {
var i = e.attribute.type;
e.editor = b[i].getEditor(w, e, {
dragIcon: C
})
}
t.onStartEditing && "function" == typeof t.onStartEditing && t.onStartEditing(e)
}
}, e.stopEditing = function() {
var e = this;
e.editor && (e.editor.destroy(), e.editor = null), t.onStopEditing && "function" == typeof t.onStopEditing && t.onStopEditing()
}, e.changeEditing = function() {
var e = this;
t.onChangeEditing && "function" == typeof t.onChangeEditing && t.onChangeEditing(e)
}, e.updatePositions = function(t) {
var e = this,
i = e.attribute.type;
if ("ellipse" == i) {
var n = Cesium.Cartographic.fromCartesian(t).height;
if (e.attribute.style.height = Number(Number(n).toFixed(2)), e.ellipse.height._value = Number(Number(n).toFixed(2)), e.attribute.style.extrudedHeight) {
var r = Number(n) + Number(e.attribute.style.extrudedHeight);
e.ellipse.extrudedHeight._value = Number(r.toFixed(2)), e.attribute.style.extrudedHeight = Number(r.toFixed(2))
}
}
b[i].setPositions(x, t)
}
}
function s(t) {
null != t && (t.stopEditing(), y(E, t), w.entities.remove(t))
}
function l() {
x && (x.stopEditing(), y(E, x), w.entities.remove(x), x = null)
}
function u() {
n();
for (var t = 0; t < E.length; t++) {
var e = E[t];
e.stopEditing(), w.entities.remove(e)
}
E = []
}
function c(t) {
var e = t.attribute.type,
i = b[e].getCoordinates(t);
return i
}
function h(t) {
var e = t.attribute.type,
i = b[e].getPositions(t);
return i
}
function d(t, e) {
var i = t.attribute.type,
e = b[i].setPositions(t, e)
}
function p() {
return E.length > 0
}
function f() {
return E
}
function m() {
if (0 == E.length) return "";
for (var t = [], e = 0; e < E.length; e++) {
var i = E[e],
n = i.attribute.type,
r = b[n].toGeoJSON(i);
t.push(r)
}
var r = {
type: "FeatureCollection",
features: t
};
return JSON.stringify(r)
}
function g(t, e, i) {
var n = t;
try {
v(t) && (n = JSON.parse(t))
} catch (r) {
return void haoutil.alert(r.name + ": " + r.message + " \n请确认json文件格式正确!!!")
}
e && u();
for (var o = n.features, s = 0; s < o.length; s++) {
var l = o[s],
c = l.properties.type,
h = b[c].startDraw(w, l.properties),
d = mars3d.drawing.utils.getPositionsFromJson(l.geometry);
b[c].setPositions(h, d), a(h), E.push(h)
}
return i && w.flyTo(E, {
duration: 3
}), E
}
function v(t) {
return "string" == typeof t && t.constructor == String
}
function _(t, e, i) {
var n = t;
try {
v(t) && (n = JSON.parse(t))
} catch (r) {
return void haoutil.alert(r.name + ": " + r.message + " \n请确认json文件格式正确!!!")
}
if (!(n instanceof Array)) return void haoutil.alert("请确认json文件格式正确!!!");
i && u();
for (var o = 0; o < n.length; o++) {
var s = n[o];
if (!s.x || !s.y) return void haoutil.alert(r.name + ": " + r.message + " \n请确认json文件格式正确!!!");
var l = {
id: s.id || s.ID || "",
name: s.name || s.NAME || "",
remark: s.remark || s.REMA || ""
},
c = {
type: e.type || "billboard",
attr: l,
style: e.style
},
h = Cesium.Cartesian3.fromDegrees(s.x, s.y, s.z || 0),
d = b[c.type].startDraw(w, c);
b[c.type].setPositions(d, h), a(d), E.push(d)
}
return E
}
function y(t, e) {
for (var i = 0; i < t.length; i++) if (t[i] == e) {
t.splice(i, 1);
break
}
}
var b = {
billboard: mars3d.drawing.BillboardControl,
label: mars3d.drawing.LabelControl,
ellipse: mars3d.drawing.EllipseControl,
polyline: mars3d.drawing.PolylineControl,
polylineVolume: mars3d.drawing.PolylineVolumeControl,
polygon: mars3d.drawing.PolygonControl,
ellipsoid: mars3d.drawing.EllipsoidControl,
wall: mars3d.drawing.WallControl,
point: mars3d.drawing.PointControl,
rectangle: mars3d.drawing.RectangleControl,
model: mars3d.drawing.ModelControl
},
w = t.viewer,
C = (w.scene, t.dragIcon),
x = null,
E = [],
k = new mars3d.drawing.EventControl(w),
L = t.hasEdit;
return e(t.hasEdit), {
startDraw: i,
stopDraw: n,
updateAttribute: r,
updateGeometry: o,
toGeoJSON: m,
jsonToEntity: g,
markersInfoToEntity: _,
deleteEntity: s,
deleteCurrentEntity: l,
deleteAll: u,
hasDraw: p,
hasEdit: e,
getEntitys: f,
getCoordinates: c,
getPositions: h,
setPositions: d
}
}, mars3d.Measure = function(t) {
function e(t) {
// debugger;
r(), h = "length", t = t || {}, t.type = h, t.hasOwnProperty("terrain") || (t.terrain = !0), p.start(t)
}
function i(t) {
r(), h = "area", t = t || {}, t.type = h, f.start(t)
}
function n(t) {
r(), t = t || {}, t.hasOwnProperty("isSuper") && !t.isSuper ? (h = "height", t.type = h, m.start(t)) : (h = "super_height", t.type = h, g.start(t))
}
function r() {
p.clearLastNoEnd(), f.clearLastNoEnd(), m.clearLastNoEnd(), g.clearLastNoEnd(), d.stopDraw()
}
function o() {
h = "", r();
for (var t = d.getEntitys(), e = 0; e < t.length; e++) {
var i = t[e];
if (i._totalLable && (u.entities.remove(i._totalLable), delete i._totalLable), i._arrLables) {
var n = i._arrLables;
if (n && n.length > 0) for (var e in n) u.entities.remove(n[e]);
delete i._arrLables
}
}
t = [];
var o = u.entities.values;
for (var e in o) {
var i = o[e];
i.label && i.isMarsMeasureLabel && t.push(i)
}
for (var e = 0; e < t.length; e++) {
var i = t[e];
u.entities.remove(i)
}
d.deleteAll()
}
function a(t, e) {
var i = u.entities.values;
for (var n in i) {
var r = i[n];
if (r.label && r.isMarsMeasureLabel && r.attribute && r.attribute.value) {
if (r.attribute.type != t) continue;
"area" == t ? r.label.text._value = (r.attribute.textEx || "") + s(r.attribute.value, e) : r._label.text._value = (r.attribute.textEx || "") + l(r.attribute.value, e)
}
}
}
function s(t, e) {
if (null == t) return "";
null != e && "auto" != e || (e = t < 1e6 ? "m" : "km");
var i = "";
switch (e) {
default:
case "m":
i = t.toFixed(2) + " 平方米";
break;
case "km":
i = (t / 1e6).toFixed(2) + " 平方公里";
break;
case "mu":
i = (.0015 * t).toFixed(2) + " 亩";
break;
case "ha":
i = (1e-4 * t).toFixed(2) + " 公顷"
}
return i
}
function l(t, e) {
// debugger;
if (null == t) return "";
null != e && "auto" != e || (e = t < 1e3 ? "m" : "km");
var i = "";
switch (e) {
default:
case "m":
i = t.toFixed(2) + " 米";
break;
case "km":
i = (.001 * t).toFixed(2) + " 公里";
break;
case "mile":
i = (54e-5 * t).toFixed(2) + " 海里";
break;
case "zhang":
i = (.3 * t).toFixed(2) + " 丈"
}
return i
}
var u = t.viewer,
c = t.font || "16px SimHei",
h = "",
d = new mars3d.Draw({
viewer: u,
hasEdit: !1,
onChangeDrawing: function(t) {
switch (h) {
case "length":
p.showAddPointLength(t);
break;
case "area":
f.showAddPointLength(t);
break;
case "height":
m.showAddPointLength(t);
break;
case "super_height":
g.showAddPointLength(t)
}
},
onMoveDrawing: function(t) {
switch (h) {
case "length":
p.showMoveDrawing(t);
break;
case "area":
f.showMoveDrawing(t);
break;
case "height":
m.showMoveDrawing(t);
break;
case "super_height":
g.showMoveDrawing(t)
}
},
onStopDrawing: function(t) {
switch (h) {
case "length":
p.showDrawEnd(t);
break;
case "area":
f.showDrawEnd(t);
break;
case "height":
m.showDrawEnd(t);
break;
case "super_height":
g.showDrawEnd(t)
}
}
}),
p = {
options: null,
arrLables: [],
totalLable: null,
clearLastNoEnd: function() {
if (null != this.totalLable && u.entities.remove(this.totalLable), this.arrLables && this.arrLables.length > 0) {
var t = this.arrLables;
if (t && t.length > 0) for (var e in t) u.entities.remove(t[e])
}
this.totalLable = null, this.arrLables = []
},
start: function(t) {
// debugger;
this.options = t, this.totalLable = u.entities.add({
label: {
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
eyeOffset: new Cesium.Cartesian3(0, 0, (-20)),
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
font: c,
show: !1
},
isMarsMeasureLabel: !0,
attribute: {
unit: this.options.unit,
type: this.options.type
}
}), this.arrLables = [], d.startDraw({
type: "polyline",
style: {
color: "#ffff00",
width: 3
}
})
},
showAddPointLength: function(t) {
var e = d.getPositions(t),
i = u.entities.add({
position: e[e.length - 1],
label: {
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
eyeOffset: new Cesium.Cartesian3(0, 0, (-20)),
font: c,
show: !0
},
isMarsMeasureLabel: !0,
attribute: {
unit: this.options.unit,
type: this.options.type
}
});
if (1 == e.length) i.label.text = "起点";
else {
var n = this.getLength(e),
r = l(n, this.options.unit);
i.label.text = r, i.attribute.value = n, this.getLength([e[e.length - 2], e[e.length - 1]]) < 5 && (i.show = !1)
}
this.arrLables.push(i)
},
showMoveDrawing: function(t) {
var e = d.getPositions(t);
if (!(e.length < 2)) {
var i = this.getLength(e),
n = l(i, this.options.unit);
this.totalLable.position = e[e.length - 1], this.totalLable.label.text = "全长:" + n, this.totalLable.label.show = !0, this.totalLable.attribute.value = i, this.totalLable.attribute.textEx = "全长:", this.options.calback && this.options.calback(n, i)
}
},
showDrawEnd: function(t) {
var e = d.getPositions(t),
i = this.arrLables.length - e.length;
if (i >= 0) {
for (var n = this.arrLables.length - 1; n >= e.length - 1; n--) u.entities.remove(this.arrLables[n]);
this.arrLables.splice(e.length - 1, i + 1)
}
t._totalLable = this.totalLable, t._arrLables = this.arrLables, this.totalLable = null, this.arrLables = [], this.updateLengthForTerrain(t)
},
updateLengthForTerrain: function(t) {
function e() {
s++;
var h = [n[s - 1], n[s]];
mars3d.drawing.utils.terrainPolyline({
viewer: u,
positions: h,
calback: function(u, d) {
if (c = d ? 1 == s ? c.concat(h) : c.concat([n[s]]) : c.concat(u), s >= n.length - 1) {
if (t.polyline.positions.setValue(c), o) {
var p = i.getLength(c),
f = l(p, a);
o.label.text = "全长:" + f, o.attribute.value = p, i.options.calback && i.options.calback(f, p)
}
} else {
var p = i.getLength(u),
f = l(p, a),
m = r[s];
m.label.text = f, m.attribute.value = p, e()
}
}
})
}
if (this.options.terrain && null != t.polyline) {
var i = this,
n = t.polyline.positions.getValue(),
r = t._arrLables,
o = t._totalLable,
a = o && o.unit,
s = 0,
c = [];
e()
}
},
getLength: function(t) {
for (var e = 0, i = 0, n = t.length - 1; i < n; i++) e += Cesium.Cartesian3.distance(t[i], t[i + 1]);
return e
}
},
f = {
options: null,
totalLable: null,
clearLastNoEnd: function() {
null != this.totalLable && u.entities.remove(this.totalLable), this.totalLable = null
},
start: function(t) {
this.options = t,
this.totalLable = u.entities.add({
label: {
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
outlineColor: Cesium.Color.BLACK,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
outlineWidth: 3,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
eyeOffset: new Cesium.Cartesian3(0, 0, (-20)),
font: c,
show: !1
},
isMarsMeasureLabel: !0,
attribute: {
unit: this.options.unit,
type: this.options.type
}
}),
d.startDraw({
type: "polygon",
style: {
color: "#ffff00",
outline: !0,
outlineColor: "#ffff00",
outlineWidth: 4,
opacity: .4
}
})
},
showAddPointLength: function(t) {},
showMoveDrawing: function(t) {
var e = d.getPositions(t);
if (!(e.length < 3)) {
var i = mars3d.drawing.PolygonControl.toGeoJSON(t),
n = turf.area(i),
r = s(n, this.options.unit),
o = turf.centerOfMass(i),
a = mars3d.drawing.utils.getMaxHeightForPositions(e),
l = Cesium.Cartesian3.fromDegrees(o.geometry.coordinates[0], o.geometry.coordinates[1], a + 1);
this.totalLable.position = l, this.totalLable.label.text = "面积:" + r, this.totalLable.label.show = !0, this.totalLable.attribute.value = n, this.totalLable.attribute.textEx = "面积:", this.options.calback && this.options.calback(r, n)
}
},
showDrawEnd: function(t) {
if (null != t.polygon) {
var e = t.polygon.hierarchy.getValue();
$.each(e, function(t, e) {
e.z = e.z + 1
}), t._totalLable = this.totalLable, this.totalLable = null
}
}
},
m = {
options: null,
totalLable: null,
clearLastNoEnd: function() {
null != this.totalLable && u.entities.remove(this.totalLable), this.totalLable = null
},
start: function(t) {
this.options = t, this.totalLable = u.entities.add({
label: {
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
font: c,
show: !1
},
isMarsMeasureLabel: !0,
attribute: {
unit: this.options.unit,
type: this.options.type
}
}), d.startDraw({
type: "polyline",
minMaxPoints: {
min: 2,
max: 2,
isSuper: !1
},
style: {
color: "#ffff00",
width: 3
}
})
},
showAddPointLength: function(t) {},
showMoveDrawing: function(t) {
var e = d.getPositions(t);
if (!(e.length < 2)) {
var i = Cesium.Cartographic.fromCartesian(e[0]),
n = Cesium.Cartographic.fromCartesian(e[1]),
r = Math.abs(n.height - i.height),
o = l(r, this.options.unit);
this.totalLable.position = mars3d.drawing.utils.getMidPosition(e[0], e[1]), this.totalLable.label.text = "高度差:" + o, this.totalLable.label.show = !0, this.totalLable.attribute.value = r, this.totalLable.attribute.textEx = "高度差:", this.options.calback && this.options.calback(o, r)
}
},
showDrawEnd: function(t) {
t._totalLable = this.totalLable, this.totalLable = null
}
},
g = {
options: null,
totalLable: null,
xLable: null,
hLable: null,
clearLastNoEnd: function() {
null != this.totalLable && u.entities.remove(this.totalLable), null != this.xLable && u.entities.remove(this.xLable), null != this.hLable && u.entities.remove(this.hLable), this.totalLable = null, this.xLable = null, this.hLable = null
},
start: function(t) {
this.options = t, this.totalLable = u.entities.add({
label: {
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
font: c,
show: !1,
pixelOffset: new Cesium.Cartesian2((-40), 0)
},
isMarsMeasureLabel: !0,
attribute: {
unit: this.options.unit,
type: this.options.type
}
}), this.xLable = u.entities.add({
label: {
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
font: c,
show: !1,
pixelOffset: new Cesium.Cartesian2((-40), 0)
},
isMarsMeasureLabel: !0,
attribute: {
unit: this.options.unit,
type: this.options.type
}
}), this.hLable = u.entities.add({
label: {
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
font: c,
show: !1,
pixelOffset: new Cesium.Cartesian2((-40), 0)
},
isMarsMeasureLabel: !0,
attribute: {
unit: this.options.unit,
type: this.options.type
}
}), d.startDraw({
type: "polyline",
minMaxPoints: {
min: 2,
max: 2,
isSuper: !0
},
style: {
color: "#ffff00",
width: 3
}
})
},
showAddPointLength: function(t) {
var e = d.getPositions(t);
if (4 == e.length) {
var i = e[3].clone();
e.pop(), e.pop(), e.pop(), e.push(i)
}
if (2 == e.length) {
var n = mars3d.drawing.utils.getZHeightPosition(e[0], e[1]),
r = mars3d.drawing.utils.getHDistance(e[0], e[1]);
r > 3 && (e.push(n), e.push(e[0]))
}
this.showSuperHeight(e)
},
showMoveDrawing: function(t) {
var e = d.getPositions(t);
if (4 == e.length) {
var i = e[3].clone();
e.pop(), e.pop(), e.pop(), e.push(i)
}
if (2 == e.length) {
var n = mars3d.drawing.utils.getZHeightPosition(e[0], e[1]),
r = mars3d.drawing.utils.getHDistance(e[0], e[1]);
r > 3 && (e.push(n), e.push(e[0]))
}
this.showSuperHeight(e)
},
showDrawEnd: function(t) {
t._arrLables = [this.totalLable, this.hLable, this.xLable], this.totalLable = null, this.hLable = null, this.xLable = null
},
showSuperHeight: function(t) {
var e, i, n, r;
if (4 == t.length) {
var o, a, s = mars3d.drawing.utils.getMidPosition(t[0], t[1]),
u = Cesium.Cartographic.fromCartesian(t[0]),
c = Cesium.Cartographic.fromCartesian(t[1]),
h = Cesium.Cartographic.fromCartesian(t[2]);
tempHeight = c.height - h.height, r = c.height - u.height, n = Cesium.Cartesian3.distance(t[0], t[1]), r > -1 && r < 1 ? (a = t[1], this.updateSuperHeightLabel(this.totalLable, a, "高度差", r), this.updateSuperHeightLabel(this.hLable, s, "长度", n)) : (tempHeight > -.1 && tempHeight < .1 ? (o = mars3d.drawing.utils.getMidPosition(t[2], t[1]), a = mars3d.drawing.utils.getMidPosition(t[2], t[3]), i = Cesium.Cartesian3.distance(t[1], t[2]), e = Cesium.Cartesian3.distance(t[3], t[2])) : (a = mars3d.drawing.utils.getMidPosition(t[2], t[1]), o = mars3d.drawing.utils.getMidPosition(t[2], t[3]), i = Cesium.Cartesian3.distance(t[3], t[2]), e = Cesium.Cartesian3.distance(t[1], t[2])), this.updateSuperHeightLabel(this.totalLable, a, "高度差", e), this.updateSuperHeightLabel(this.xLable, o, "水平距离", i), this.updateSuperHeightLabel(this.hLable, s, "长度", n))
} else if (2 == t.length) {
e = Cesium.Cartesian3.distance(t[1], t[0]);
var a = mars3d.drawing.utils.getMidPosition(t[0], t[1]);
xLable.label.show && (xLable.label.show = !1, hLable.label.show = !1), this.updateSuperHeightLabel(this.totalLable, a, "高度差", e)
}
var d = l(e, this.options.unit);
this.options.calback && this.options.calback(d, e)
},
updateSuperHeightLabel: function(t, e, i, n) {
null != t && (t.position = e, t.label.text = i + ":" + l(n, this.options.unit), t.label.show = !0, t.attribute.value = n, t.attribute.textEx = i + ":")
}
};
return {
measuerLength: e,
measureHeight: n,
measureArea: i,
updateUnit: a,
clearMeasure: o,
formatArea: s,
formatLength: l
}
};