~holger-seelig/cobweb.js/trunk

« back to all changes in this revision

Viewing changes to cobweb.js/cobweb.min.js

  • Committer: Holger Seelig
  • Date: 2017-08-22 04:53:24 UTC
  • Revision ID: holger.seelig@yahoo.de-20170822045324-4of4xxgt79669gbt
Switched to npm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
2
 
 *******************************************************************************
3
 
 *
4
 
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
 
 *
6
 
 * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
7
 
 *
8
 
 * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
9
 
 *
10
 
 * The copyright notice above does not evidence any actual of intended
11
 
 * publication of such source code, and is an unpublished work by create3000.
12
 
 * This material contains CONFIDENTIAL INFORMATION that is the property of
13
 
 * create3000.
14
 
 *
15
 
 * No permission is granted to copy, distribute, or create derivative works from
16
 
 * the contents of this software, in whole or in part, without the prior written
17
 
 * permission of create3000.
18
 
 *
19
 
 * NON-MILITARY USE ONLY
20
 
 *
21
 
 * All create3000 software are effectively free software with a non-military use
22
 
 * restriction. It is free. Well commented source is provided. You may reuse the
23
 
 * source in any way you please with the exception anything that uses it must be
24
 
 * marked to indicate is contains 'non-military use only' components.
25
 
 *
26
 
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
27
 
 *
28
 
 * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
29
 
 *
30
 
 * This file is part of the Cobweb Project.
31
 
 *
32
 
 * Cobweb is free software: you can redistribute it and/or modify it under the
33
 
 * terms of the GNU General Public License version 3 only, as published by the
34
 
 * Free Software Foundation.
35
 
 *
36
 
 * Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY
37
 
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
38
 
 * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
39
 
 * details (a copy is included in the LICENSE file that accompanied this code).
40
 
 *
41
 
 * You should have received a copy of the GNU General Public License version 3
42
 
 * along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a
43
 
 * copy of the GPLv3 License.
44
 
 *
45
 
 * For Silvio, Joy and Adi.
46
 
 *
47
 
 ******************************************************************************/
48
 
 
49
 
!function(){var requirejs,require,define;!function(e){function t(e,t){return b.call(e,t)}function n(e,t){var n,i,r,o,s,a,u,l,c,h,d=t&&t.split("/"),p=g.map,f=p&&p["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=(d=d.slice(0,d.length-1)).concat(e.split("/")),l=0;l<e.length;l+=1)if("."===(h=e[l]))e.splice(l,1),l-=1;else if(".."===h){if(1===l&&(".."===e[2]||".."===e[0]))break;l>0&&(e.splice(l-1,2),l-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||f)&&p){for(l=(n=e.split("/")).length;l>0;l-=1){if(i=n.slice(0,l).join("/"),d)for(c=d.length;c>0;c-=1)if((r=p[d.slice(0,c).join("/")])&&(r=r[i])){o=r,s=l;break}if(o)break;!a&&f&&f[i]&&(a=f[i],u=l)}!o&&a&&(o=a,s=u),o&&(n.splice(0,s,o),e=n.join("/"))}return e}function i(t,n){return function(){return c.apply(e,w.call(arguments,0).concat([t,n]))}}function r(e){return function(t){return n(t,e)}}function o(e){return function(t){p[e]=t}}function s(n){if(t(f,n)){var i=f[n];delete f[n],m[n]=!0,l.apply(e,i)}if(!t(p,n)&&!t(m,n))throw new Error("No "+n);return p[n]}function a(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function u(e){return function(){return g&&g.config&&g.config[e]||{}}}var l,c,h,d,p={},f={},g={},m={},b=Object.prototype.hasOwnProperty,w=[].slice;h=function(e,t){var i,o=a(e),u=o[0];return e=o[1],u&&(i=s(u=n(u,t))),u?e=i&&i.normalize?i.normalize(e,r(t)):n(e,t):(u=(o=a(e=n(e,t)))[0],e=o[1],u&&(i=s(u))),{f:u?u+"!"+e:e,n:e,pr:u,p:i}},d={require:function(e){return i(e)},exports:function(e){var t=p[e];return void 0!==t?t:p[e]={}},module:function(e){return{id:e,uri:"",exports:p[e],config:u(e)}}},l=function(n,r,a,u){var l,c,g,b,w,y,x=[];if(u=u||n,"function"==typeof a){for(r=!r.length&&a.length?["require","exports","module"]:r,w=0;w<r.length;w+=1)if(b=h(r[w],u),"require"===(c=b.f))x[w]=d.require(n);else if("exports"===c)x[w]=d.exports(n),y=!0;else if("module"===c)l=x[w]=d.module(n);else if(t(p,c)||t(f,c)||t(m,c))x[w]=s(c);else{if(!b.p)throw new Error(n+" missing "+c);b.p.load(b.n,i(u,!0),o(c),{}),x[w]=p[c]}g=a.apply(p[n],x),n&&(l&&l.exports!==e&&l.exports!==p[n]?p[n]=l.exports:g===e&&y||(p[n]=g))}else n&&(p[n]=a)},requirejs=require=c=function(t,n,i,r,o){return"string"==typeof t?d[t]?d[t](n):s(h(t,n).f):(t.splice||(g=t,n.splice?(t=n,n=i,i=null):t=e),n=n||function(){},"function"==typeof i&&(i=r,r=o),r?l(e,t,n,i):setTimeout(function(){l(e,t,n,i)},4),c)},c.config=function(e){return(g=e).deps&&c(g.deps,g.callback),c},(define=function(e,n,i){n.splice||(i=n,n=[]),t(p,e)||t(f,e)||(f[e]=[e,n,i])}).amd={jQuery:!0}}(),define("requireLib",function(){}),function(e,t){function n(e){var t=e.length,n=re.type(e);return!re.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)))}function i(e){var t=pe[e]={};return re.each(e.match(se)||[],function(e,n){t[n]=!0}),t}function r(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=re.expando+Math.random()}function o(e,n,i){var r;if(i===t&&1===e.nodeType)if(r="data-"+n.replace(be,"-$1").toLowerCase(),"string"==typeof(i=e.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:me.test(i)?JSON.parse(i):i)}catch(e){}fe.set(e,n,i)}else i=t;return i}function s(){return!0}function a(){return!1}function u(){try{return q.activeElement}catch(e){}}function l(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function c(e,t,n){if(re.isFunction(t))return re.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return re.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Te.test(t))return re.filter(t,e,n);t=re.filter(t,e)}return re.grep(e,function(e){return ee.call(t,e)>=0!==n})}function h(e,t){return re.nodeName(e,"table")&&re.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function d(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function p(e){var t=Pe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function f(e,t){for(var n=e.length,i=0;i<n;i++)ge.set(e[i],"globalEval",!t||ge.get(t[i],"globalEval"))}function g(e,t){var n,i,r,o,s,a,u,l;if(1===t.nodeType){if(ge.hasData(e)&&(o=ge.access(e),s=re.extend({},o),l=o.events,ge.set(t,s),l)){delete s.handle,s.events={};for(r in l)for(n=0,i=l[r].length;n<i;n++)re.event.add(t,r,l[r][n])}fe.hasData(e)&&(a=fe.access(e),u=re.extend({},a),fe.set(t,u))}}function m(e,n){var i=e.getElementsByTagName?e.getElementsByTagName(n||"*"):e.querySelectorAll?e.querySelectorAll(n||"*"):[];return n===t||n&&re.nodeName(e,n)?re.merge([e],i):i}function b(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Be.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function w(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),i=t,r=Ke.length;r--;)if((t=Ke[r]+n)in e)return t;return i}function y(e,t){return e=t||e,"none"===re.css(e,"display")||!re.contains(e.ownerDocument,e)}function x(t){return e.getComputedStyle(t,null)}function v(e,t){for(var n,i,r,o=[],s=0,a=e.length;s<a;s++)(i=e[s]).style&&(o[s]=ge.get(i,"olddisplay"),n=i.style.display,t?(o[s]||"none"!==n||(i.style.display=""),""===i.style.display&&y(i)&&(o[s]=ge.access(i,"olddisplay",F(i.nodeName)))):o[s]||(r=y(i),(n&&"none"!==n||!r)&&ge.set(i,"olddisplay",r?n:re.css(i,"display"))));for(s=0;s<a;s++)(i=e[s]).style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?o[s]||"":"none"));return e}function _(e,t,n){var i=Ue.exec(t);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):t}function S(e,t,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===t?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=re.css(e,n+$e[o],!0,r)),i?("content"===n&&(s-=re.css(e,"padding"+$e[o],!0,r)),"margin"!==n&&(s-=re.css(e,"border"+$e[o]+"Width",!0,r))):(s+=re.css(e,"padding"+$e[o],!0,r),"padding"!==n&&(s+=re.css(e,"border"+$e[o]+"Width",!0,r)));return s}function C(e,t,n){var i=!0,r="width"===t?e.offsetWidth:e.offsetHeight,o=x(e),s=re.support.boxSizing&&"border-box"===re.css(e,"boxSizing",!1,o);if(r<=0||null==r){if(((r=ke(e,t,o))<0||null==r)&&(r=e.style[t]),Ge.test(r))return r;i=s&&(re.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+S(e,t,n||(s?"border":"content"),i,o)+"px"}function F(e){var t=q,n=He[e];return n||("none"!==(n=T(e,t))&&n||((t=((ze=(ze||re("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement))[0].contentWindow||ze[0].contentDocument).document).write("<!doctype html><html><body>"),t.close(),n=T(e,t),ze.detach()),He[e]=n),n}function T(e,t){var n=re(t.createElement(e)).appendTo(t.body),i=re.css(n[0],"display");return n.remove(),i}function N(e,t,n,i){var r;if(re.isArray(t))re.each(t,function(t,r){n||Qe.test(e)?i(e,r):N(e+"["+("object"==typeof r?t:"")+"]",r,n,i)});else if(n||"object"!==re.type(t))i(e,t);else for(r in t)N(e+"["+r+"]",t[r],n,i)}function O(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(se)||[];if(re.isFunction(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function M(e,t,n,i){function r(a){var u;return o[a]=!0,re.each(e[a]||[],function(e,a){var l=a(t,n,i);return"string"!=typeof l||s||o[l]?s?!(u=l):void 0:(t.dataTypes.unshift(l),r(l),!1)}),u}var o={},s=e===gt;return r(t.dataTypes[0])||!o["*"]&&r("*")}function V(e,n){var i,r,o=re.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&re.extend(!0,e,r),e}function D(e,n,i){for(var r,o,s,a,u=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),r===t&&(r=e.mimeType||n.getResponseHeader("Content-Type"));if(r)for(o in u)if(u[o]&&u[o].test(r)){l.unshift(o);break}if(l[0]in i)s=l[0];else{for(o in i){if(!l[0]||e.converters[o+" "+l[0]]){s=o;break}a||(a=o)}s=s||a}if(s)return s!==l[0]&&l.unshift(s),i[s]}function I(e,t,n,i){var r,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(r in l)if((a=r.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[r]:!0!==l[r]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}function B(){return setTimeout(function(){St=t}),St=re.now()}function E(e,t){re.each(t,function(t,n){for(var i=(Mt[t]||[]).concat(Mt["*"]),r=0,o=i.length;r<o;r++)if(i[r].call(e,t,n))return})}function A(e,t,n){var i,r,o=0,s=Ot.length,a=re.Deferred().always(function(){delete u.elem}),u=function(){if(r)return!1;for(var t=St||B(),n=Math.max(0,l.startTime+l.duration-t),i=1-(n/l.duration||0),o=0,s=l.tweens.length;o<s;o++)l.tweens[o].run(i);return a.notifyWith(e,[l,i,n]),i<1&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:re.extend({},t),opts:re.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:St||B(),duration:n.duration,tweens:[],createTween:function(t,n){var i=re.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(i),i},stop:function(t){var n=0,i=t?l.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(P(c,l.opts.specialEasing);o<s;o++)if(i=Ot[o].call(l,e,c,l.opts))return i;return E(l,c),re.isFunction(l.opts.start)&&l.opts.start.call(e,l),re.fx.timer(re.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function P(e,t){var n,i,r,o,s;for(n in e)if(i=re.camelCase(n),r=t[i],o=e[n],re.isArray(o)&&(r=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),(s=re.cssHooks[i])&&"expand"in s){o=s.expand(o),delete e[i];for(n in o)n in e||(e[n]=o[n],t[n]=r)}else t[i]=r}function L(e,n,i){var r,o,s,a,u,l,c,h,d,p=this,f=e.style,g={},m=[],b=e.nodeType&&y(e);i.queue||(null==(h=re._queueHooks(e,"fx")).unqueued&&(h.unqueued=0,d=h.empty.fire,h.empty.fire=function(){h.unqueued||d()}),h.unqueued++,p.always(function(){p.always(function(){h.unqueued--,re.queue(e,"fx").length||h.empty.fire()})})),1===e.nodeType&&("height"in n||"width"in n)&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],"inline"===re.css(e,"display")&&"none"===re.css(e,"float")&&(f.display="inline-block")),i.overflow&&(f.overflow="hidden",p.always(function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]})),u=ge.get(e,"fxshow");for(r in n)if(s=n[r],Ft.exec(s)){if(delete n[r],l=l||"toggle"===s,s===(b?"hide":"show")){if("show"!==s||u===t||u[r]===t)continue;b=!0}m.push(r)}if(a=m.length){"hidden"in(u=ge.get(e,"fxshow")||ge.access(e,"fxshow",{}))&&(b=u.hidden),l&&(u.hidden=!b),b?re(e).show():p.done(function(){re(e).hide()}),p.done(function(){var t;ge.remove(e,"fxshow");for(t in g)re.style(e,t,g[t])});for(r=0;r<a;r++)o=m[r],c=p.createTween(o,b?u[o]:0),g[o]=u[o]||re.style(e,o),o in u||(u[o]=c.start,b&&(c.end=c.start,c.start="width"===o||"height"===o?1:0))}}function R(e,t,n,i,r){return new R.prototype.init(e,t,n,i,r)}function k(e,t){var n,i={height:e},r=0;for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=$e[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function z(e){return re.isWindow(e)?e:9===e.nodeType&&e.defaultView}var j,X,U=typeof t,G=e.location,q=e.document,H=q.documentElement,W=e.jQuery,Y=e.$,$={},K=[],Z=K.concat,Q=K.push,J=K.slice,ee=K.indexOf,te=$.toString,ne=$.hasOwnProperty,ie="2.0.0".trim,re=function(e,t){return new re.fn.init(e,t,j)},oe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,se=/\S+/g,ae=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,ue=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,le=/^-ms-/,ce=/-([\da-z])/gi,he=function(e,t){return t.toUpperCase()},de=function(){q.removeEventListener("DOMContentLoaded",de,!1),e.removeEventListener("load",de,!1),re.ready()};re.fn=re.prototype={jquery:"2.0.0",constructor:re,init:function(e,n,i){var r,o;if(!e)return this;if("string"==typeof e){if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ae.exec(e))||!r[1]&&n)return!n||n.jquery?(n||i).find(e):this.constructor(n).find(e);if(r[1]){if(n=n instanceof re?n[0]:n,re.merge(this,re.parseHTML(r[1],n&&n.nodeType?n.ownerDocument||n:q,!0)),ue.test(r[1])&&re.isPlainObject(n))for(r in n)re.isFunction(this[r])?this[r](n[r]):this.attr(r,n[r]);return this}return(o=q.getElementById(r[2]))&&o.parentNode&&(this.length=1,this[0]=o),this.context=q,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):re.isFunction(e)?i.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),re.makeArray(e,this))},selector:"",length:0,toArray:function(){return J.call(this)},get:function(e){return null==e?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=re.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return re.each(this,e,t)},ready:function(e){return re.ready.promise().done(e),this},slice:function(){return this.pushStack(J.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},map:function(e){return this.pushStack(re.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:Q,sort:[].sort,splice:[].splice},re.fn.init.prototype=re.fn,re.extend=re.fn.extend=function(){var e,n,i,r,o,s,a=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},u=2),"object"==typeof a||re.isFunction(a)||(a={}),l===u&&(a=this,--u);u<l;u++)if(null!=(e=arguments[u]))for(n in e)i=a[n],a!==(r=e[n])&&(c&&r&&(re.isPlainObject(r)||(o=re.isArray(r)))?(o?(o=!1,s=i&&re.isArray(i)?i:[]):s=i&&re.isPlainObject(i)?i:{},a[n]=re.extend(c,s,r)):r!==t&&(a[n]=r));return a},re.extend({expando:"jQuery"+("2.0.0"+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===re&&(e.$=Y),t&&e.jQuery===re&&(e.jQuery=W),re},isReady:!1,readyWait:1,holdReady:function(e){e?re.readyWait++:re.ready(!0)},ready:function(e){(!0===e?--re.readyWait:re.isReady)||(re.isReady=!0,!0!==e&&--re.readyWait>0||(X.resolveWith(q,[re]),re.fn.trigger&&re(q).trigger("ready").off("ready")))},isFunction:function(e){return"function"===re.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?$[te.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==re.type(e)||e.nodeType||re.isWindow(e))return!1;try{if(e.constructor&&!ne.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||q;var i=ue.exec(e),r=!n&&[];return i?[t.createElement(i[1])]:(i=re.buildFragment([e],t,r),r&&re(r).remove(),re.merge([],i.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var n,i;if(!e||"string"!=typeof e)return null;try{i=new DOMParser,n=i.parseFromString(e,"text/xml")}catch(e){n=t}return n&&!n.getElementsByTagName("parsererror").length||re.error("Invalid XML: "+e),n},noop:function(){},globalEval:function(e){var t,n=eval;(e=re.trim(e))&&(1===e.indexOf("use strict")?((t=q.createElement("script")).text=e,q.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(le,"ms-").replace(ce,he)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,i){var r=0,o=e.length,s=n(e);if(i){if(s)for(;r<o&&!1!==t.apply(e[r],i);r++);else for(r in e)if(!1===t.apply(e[r],i))break}else if(s)for(;r<o&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":ie.call(e)},makeArray:function(e,t){var i=t||[];return null!=e&&(n(Object(e))?re.merge(i,"string"==typeof e?[e]:e):Q.call(i,e)),i},inArray:function(e,t,n){return null==t?-1:ee.call(t,e,n)},merge:function(e,n){var i=n.length,r=e.length,o=0;if("number"==typeof i)for(;o<i;o++)e[r++]=n[o];else for(;n[o]!==t;)e[r++]=n[o++];return e.length=r,e},grep:function(e,t,n){var i=[],r=0,o=e.length;for(n=!!n;r<o;r++)n!==!!t(e[r],r)&&i.push(e[r]);return i},map:function(e,t,i){var r,o=0,s=e.length,a=[];if(n(e))for(;o<s;o++)null!=(r=t(e[o],o,i))&&(a[a.length]=r);else for(o in e)null!=(r=t(e[o],o,i))&&(a[a.length]=r);return Z.apply([],a)},guid:1,proxy:function(e,n){var i,r,o;return"string"==typeof n&&(i=e[n],n=e,e=i),re.isFunction(e)?(r=J.call(arguments,2),o=function(){return e.apply(n||this,r.concat(J.call(arguments)))},o.guid=e.guid=e.guid||re.guid++,o):t},access:function(e,n,i,r,o,s,a){var u=0,l=e.length,c=null==i;if("object"===re.type(i)){o=!0;for(u in i)re.access(e,n,u,i[u],!0,s,a)}else if(r!==t&&(o=!0,re.isFunction(r)||(a=!0),c&&(a?(n.call(e,r),n=null):(c=n,n=function(e,t,n){return c.call(re(e),n)})),n))for(;u<l;u++)n(e[u],i,a?r:r.call(e[u],u,n(e[u],i)));return o?e:c?n.call(e):l?n(e[0],i):s},now:Date.now,swap:function(e,t,n,i){var r,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];r=n.apply(e,i||[]);for(o in t)e.style[o]=s[o];return r}}),re.ready.promise=function(t){return X||(X=re.Deferred(),"complete"===q.readyState?setTimeout(re.ready):(q.addEventListener("DOMContentLoaded",de,!1),e.addEventListener("load",de,!1))),X.promise(t)},re.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){$["[object "+t+"]"]=t.toLowerCase()}),j=re(q),function(e,t){function n(e){return be.test(e+"")}function i(){var e,t=[];return e=function(n,i){return t.push(n+=" ")>C.cacheLength&&delete e[t.shift()],e[n]=i}}function r(e){return e[R]=!0,e}function o(e){var t=D.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function s(e,t,n,i){var r,o,s,a,u,l,c,p,f,g;if((t?t.ownerDocument||t:k)!==D&&V(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(a=t.nodeType)&&9!==a)return[];if(B&&!i){if(r=we.exec(e))if(s=r[1]){if(9===a){if(!(o=t.getElementById(s))||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&L(t,o)&&o.id===s)return n.push(o),n}else{if(r[2])return J.apply(n,t.getElementsByTagName(e)),n;if((s=r[3])&&z.getElementsByClassName&&t.getElementsByClassName)return J.apply(n,t.getElementsByClassName(s)),n}if(z.qsa&&(!E||!E.test(e))){if(p=c=R,f=t,g=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){for(l=h(e),(c=t.getAttribute("id"))?p=c.replace(ve,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",u=l.length;u--;)l[u]=p+d(l[u]);f=de.test(e)&&t.parentNode||t,g=l.join(",")}if(g)try{return J.apply(n,f.querySelectorAll(g)),n}catch(e){}finally{c||t.removeAttribute("id")}}}return x(e.replace(le,"$1"),t,n,i)}function a(e,t){var n=t&&e,i=n&&(~t.sourceIndex||$)-(~e.sourceIndex||$);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function u(e,n,i){var r;return i?t:(r=e.getAttributeNode(n))&&r.specified?r.value:!0===e[n]?n.toLowerCase():null}function l(e,n,i){return i?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}function c(e){return r(function(t){return t=+t,r(function(n,i){for(var r,o=e([],n.length,t),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function h(e,t){var n,i,r,o,a,u,l,c=G[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],l=C.preFilter;a;){n&&!(i=ce.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(r=[])),n=!1,(i=he.exec(a))&&(n=i.shift(),r.push({value:n,type:i[0].replace(le," ")}),a=a.slice(n.length));for(o in C.filter)!(i=me[o].exec(a))||l[o]&&!(i=l[o](i))||(n=i.shift(),r.push({value:n,type:o,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?s.error(e):G(e,u).slice(0)}function d(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function p(e,t,n){var i=t.dir,r=n&&"parentNode"===i,o=X++;return t.first?function(t,n,o){for(;t=t[i];)if(1===t.nodeType||r)return e(t,n,o)}:function(t,n,s){var a,u,l,c=j+" "+o;if(s){for(;t=t[i];)if((1===t.nodeType||r)&&e(t,n,s))return!0}else for(;t=t[i];)if(1===t.nodeType||r)if(l=t[R]||(t[R]={}),(u=l[i])&&u[0]===c){if(!0===(a=u[1])||a===S)return!0===a}else if(u=l[i]=[c],u[1]=e(t,n,s)||S,!0===u[1])return!0}}function f(e){return e.length>1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function g(e,t,n,i,r){for(var o,s=[],a=0,u=e.length,l=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,i,r)||(s.push(o),l&&t.push(a)));return s}function m(e,t,n,i,o,s){return i&&!i[R]&&(i=m(i)),o&&!o[R]&&(o=m(o,s)),r(function(r,s,a,u){var l,c,h,d=[],p=[],f=s.length,m=r||y(t||"*",a.nodeType?[a]:a,[]),b=!e||!r&&t?m:g(m,d,e,a,u),w=n?o||(r?e:f||i)?[]:s:b;if(n&&n(b,w,a,u),i)for(l=g(w,p),i(l,[],a,u),c=l.length;c--;)(h=l[c])&&(w[p[c]]=!(b[p[c]]=h));if(r){if(o||e){if(o){for(l=[],c=w.length;c--;)(h=w[c])&&l.push(b[c]=h);o(null,w=[],l,u)}for(c=w.length;c--;)(h=w[c])&&(l=o?te.call(r,h):d[c])>-1&&(r[l]=!(s[l]=h))}}else w=g(w===s?w.splice(f,w.length):w),o?o(null,s,w,u):J.apply(s,w)})}function b(e){for(var t,n,i,r=e.length,o=C.relative[e[0].type],s=o||C.relative[" "],a=o?1:0,u=p(function(e){return e===t},s,!0),l=p(function(e){return te.call(t,e)>-1},s,!0),c=[function(e,n,i){return!o&&(i||n!==O)||((t=n).nodeType?u(e,n,i):l(e,n,i))}];a<r;a++)if(n=C.relative[e[a].type])c=[p(f(c),n)];else{if((n=C.filter[e[a].type].apply(null,e[a].matches))[R]){for(i=++a;i<r&&!C.relative[e[i].type];i++);return m(a>1&&f(c),a>1&&d(e.slice(0,a-1)).replace(le,"$1"),n,a<i&&b(e.slice(a,i)),i<r&&b(e=e.slice(i)),i<r&&d(e))}c.push(n)}return f(c)}function w(e,t){var n=0,i=t.length>0,o=e.length>0,a=function(r,a,u,l,c){var h,d,p,f=[],m=0,b="0",w=r&&[],y=null!=c,x=O,v=r||o&&C.find.TAG("*",c&&a.parentNode||a),_=j+=null==x?1:Math.random()||.1;for(y&&(O=a!==D&&a,S=n);null!=(h=v[b]);b++){if(o&&h){for(d=0;p=e[d++];)if(p(h,a,u)){l.push(h);break}y&&(j=_,S=++n)}i&&((h=!p&&h)&&m--,r&&w.push(h))}if(m+=b,i&&b!==m){for(d=0;p=t[d++];)p(w,f,a,u);if(r){if(m>0)for(;b--;)w[b]||f[b]||(f[b]=Z.call(l));f=g(f)}J.apply(l,f),y&&!r&&f.length>0&&m+t.length>1&&s.uniqueSort(l)}return y&&(j=_,O=x),w};return i?r(a):a}function y(e,t,n){for(var i=0,r=t.length;i<r;i++)s(e,t[i],n);return n}function x(e,t,n,i){var r,o,s,a,u,l=h(e);if(!i&&1===l.length){if((o=l[0]=l[0].slice(0)).length>2&&"ID"===(s=o[0]).type&&9===t.nodeType&&B&&C.relative[o[1].type]){if(!(t=(C.find.ID(s.matches[0].replace(_e,Se),t)||[])[0]))return n;e=e.slice(o.shift().value.length)}for(r=me.needsContext.test(e)?0:o.length;r--&&(s=o[r],!C.relative[a=s.type]);)if((u=C.find[a])&&(i=u(s.matches[0].replace(_e,Se),de.test(o[0].type)&&t.parentNode||t))){if(o.splice(r,1),!(e=i.length&&d(o)))return J.apply(n,i),n;break}}return N(e,l)(i,t,!B,n,de.test(e)),n}function v(){}var _,S,C,F,T,N,O,M,V,D,I,B,E,A,P,L,R="sizzle"+-new Date,k=e.document,z={},j=0,X=0,U=i(),G=i(),q=i(),H=!1,W=function(){return 0},Y=typeof t,$=1<<31,K=[],Z=K.pop,Q=K.push,J=K.push,ee=K.slice,te=K.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ie="[\\x20\\t\\r\\n\\f]",oe="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",se=oe.replace("w","w#"),ae="\\["+ie+"*("+oe+")"+ie+"*(?:([*^$|!~]?=)"+ie+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+se+")|)|)"+ie+"*\\]",ue=":("+oe+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+ae.replace(3,8)+")*)|.*)\\)|)",le=new RegExp("^"+ie+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ie+"+$","g"),ce=new RegExp("^"+ie+"*,"+ie+"*"),he=new RegExp("^"+ie+"*([>+~]|"+ie+")"+ie+"*"),de=new RegExp(ie+"*[+~]"),pe=new RegExp("="+ie+"*([^\\]'\"]*)"+ie+"*\\]","g"),fe=new RegExp(ue),ge=new RegExp("^"+se+"$"),me={ID:new RegExp("^#("+oe+")"),CLASS:new RegExp("^\\.("+oe+")"),TAG:new RegExp("^("+oe.replace("w","w*")+")"),ATTR:new RegExp("^"+ae),PSEUDO:new RegExp("^"+ue),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ie+"*(even|odd|(([+-]|)(\\d*)n|)"+ie+"*(?:([+-]|)"+ie+"*(\\d+)|))"+ie+"*\\)|)","i"),boolean:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+ie+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ie+"*((?:-\\d)?\\d*)"+ie+"*\\)|)(?=[^-]|$)","i")},be=/^[^{]+\{\s*\[native \w/,we=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/^(?:input|select|textarea|button)$/i,xe=/^h\d$/i,ve=/'|\\/g,_e=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Se=function(e,t){var n="0x"+t-65536;return n!==n?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{J.apply(K=ee.call(k.childNodes),k.childNodes),K[k.childNodes.length].nodeType}catch(e){J={apply:K.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}T=s.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},V=s.setDocument=function(e){var i=e?e.ownerDocument||e:k;return i!==D&&9===i.nodeType&&i.documentElement?(D=i,I=i.documentElement,B=!T(i),z.getElementsByTagName=o(function(e){return e.appendChild(i.createComment("")),!e.getElementsByTagName("*").length}),z.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),z.getElementsByClassName=o(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),z.sortDetached=o(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),z.getById=o(function(e){return I.appendChild(e).id=R,!i.getElementsByName||!i.getElementsByName(R).length}),z.getById?(C.find.ID=function(e,t){if(typeof t.getElementById!==Y&&B){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},C.filter.ID=function(e){var t=e.replace(_e,Se);return function(e){return e.getAttribute("id")===t}}):(C.find.ID=function(e,n){if(typeof n.getElementById!==Y&&B){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==Y&&i.getAttributeNode("id").value===e?[i]:t:[]}},C.filter.ID=function(e){var t=e.replace(_e,Se);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=z.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Y)return t.getElementsByTagName(e)}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},C.find.CLASS=z.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==Y&&B)return t.getElementsByClassName(e)},A=[],E=[],(z.qsa=n(i.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||E.push("\\["+ie+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||E.push(":checked")}),o(function(e){var t=D.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&E.push("[*^$]="+ie+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||E.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),E.push(",.*:")})),(z.matchesSelector=n(P=I.webkitMatchesSelector||I.mozMatchesSelector||I.oMatchesSelector||I.msMatchesSelector))&&o(function(e){z.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),A.push("!=",ue)}),E=E.length&&new RegExp(E.join("|")),A=A.length&&new RegExp(A.join("|")),L=n(I.contains)||I.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=I.compareDocumentPosition?function(e,t){if(e===t)return H=!0,0;var n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return n?1&n||!z.sortDetached&&t.compareDocumentPosition(e)===n?e===i||L(k,e)?-1:t===i||L(k,t)?1:M?te.call(M,e)-te.call(M,t):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,r=0,o=e.parentNode,s=t.parentNode,u=[e],l=[t];if(e===t)return H=!0,0;if(!o||!s)return e===i?-1:t===i?1:o?-1:s?1:M?te.call(M,e)-te.call(M,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[r]===l[r];)r++;return r?a(u[r],l[r]):u[r]===k?-1:l[r]===k?1:0},D):D},s.matches=function(e,t){return s(e,null,null,t)},s.matchesSelector=function(e,t){if((e.ownerDocument||e)!==D&&V(e),t=t.replace(pe,"='$1']"),z.matchesSelector&&B&&(!A||!A.test(t))&&(!E||!E.test(t)))try{var n=P.call(e,t);if(n||z.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return s(t,D,null,[e]).length>0},s.contains=function(e,t){return(e.ownerDocument||e)!==D&&V(e),L(e,t)},s.attr=function(e,n){(e.ownerDocument||e)!==D&&V(e);var i=C.attrHandle[n.toLowerCase()],r=i&&i(e,n,!B);return r===t?z.attributes||!B?e.getAttribute(n):(r=e.getAttributeNode(n))&&r.specified?r.value:null:r},s.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},s.uniqueSort=function(e){var t,n=[],i=0,r=0;if(H=!z.detectDuplicates,M=!z.sortStable&&e.slice(0),e.sort(W),H){for(;t=e[r++];)t===e[r]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},F=s.getText=function(e){var t,n="",i=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=F(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[i];i++)n+=F(t);return n},C=s.selectors={cacheLength:50,createPseudo:r,match:me,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(_e,Se),e[3]=(e[4]||e[5]||"").replace(_e,Se),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||s.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&s.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return me.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&fe.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(_e,Se).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+ie+")"+e+"("+ie+"|$)"))&&U(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(i){var r=s.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,u){var l,c,h,d,p,f,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,b=a&&t.nodeName.toLowerCase(),w=!u&&!a;if(m){if(o){for(;g;){for(h=t;h=h[g];)if(a?h.nodeName.toLowerCase()===b:1===h.nodeType)return!1;f=g="only"===e&&!f&&"nextSibling"}return!0}if(f=[s?m.firstChild:m.lastChild],s&&w){for(p=(l=(c=m[R]||(m[R]={}))[e]||[])[0]===j&&l[1],d=l[0]===j&&l[2],h=p&&m.childNodes[p];h=++p&&h&&h[g]||(d=p=0)||f.pop();)if(1===h.nodeType&&++d&&h===t){c[e]=[j,p,d];break}}else if(w&&(l=(t[R]||(t[R]={}))[e])&&l[0]===j)d=l[1];else for(;(h=++p&&h&&h[g]||(d=p=0)||f.pop())&&((a?h.nodeName.toLowerCase()!==b:1!==h.nodeType)||!++d||(w&&((h[R]||(h[R]={}))[e]=[j,d]),h!==t)););return(d-=r)===i||d%i==0&&d/i>=0}}},PSEUDO:function(e,t){var n,i=C.pseudos[e]||C.setFilters[e.toLowerCase()]||s.error("unsupported pseudo: "+e);return i[R]?i(t):i.length>1?(n=[e,e,"",t],C.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,n){for(var r,o=i(e,t),s=o.length;s--;)e[r=te.call(e,o[s])]=!(n[r]=o[s])}):function(e){return i(e,0,n)}):i}},pseudos:{not:r(function(e){var t=[],n=[],i=N(e.replace(le,"$1"));return i[R]?r(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(e){return function(t){return s(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||F(t)).indexOf(e)>-1}}),lang:r(function(e){return ge.test(e||"")||s.error("unsupported lang: "+e),e=e.replace(_e,Se).toLowerCase(),function(t){var n;do{if(n=B?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===I},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return xe.test(e.nodeName)},input:function(e){return ye.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[n<0?n+t:n]}),even:c(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var i=n<0?n+t:n;--i>=0;)e.push(i);return e}),gt:c(function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e})}};for(_ in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[_]=function(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}(_);for(_ in{submit:!0,reset:!0})C.pseudos[_]=function(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}(_);N=s.compile=function(e,t){var n,i=[],r=[],o=q[e+" "];if(!o){for(t||(t=h(e)),n=t.length;n--;)(o=b(t[n]))[R]?i.push(o):r.push(o);o=q(e,w(r,i))}return o},C.pseudos.nth=C.pseudos.eq,v.prototype=C.filters=C.pseudos,C.setFilters=new v,z.sortStable=R.split("").sort(W).join("")===R,V(),[0,0].sort(W),z.detectDuplicates=H,o(function(e){if(e.innerHTML="<a href='#'></a>","#"!==e.firstChild.getAttribute("href"))for(var t="type|href|height|width".split("|"),n=t.length;n--;)C.attrHandle[t[n]]=l}),o(function(e){if(null!=e.getAttribute("disabled"))for(var t=ne.split("|"),n=t.length;n--;)C.attrHandle[t[n]]=u}),re.find=s,re.expr=s.selectors,re.expr[":"]=re.expr.pseudos,re.unique=s.uniqueSort,re.text=s.getText,re.isXMLDoc=s.isXML,re.contains=s.contains}(e);var pe={};re.Callbacks=function(e){var n,r,o,s,a,u,l=[],c=!(e="string"==typeof e?pe[e]||i(e):re.extend({},e)).once&&[],h=function(t){for(n=e.memory&&t,r=!0,u=s||0,s=0,a=l.length,o=!0;l&&u<a;u++)if(!1===l[u].apply(t[0],t[1])&&e.stopOnFalse){n=!1;break}o=!1,l&&(c?c.length&&h(c.shift()):n?l=[]:d.disable())},d={add:function(){if(l){var t=l.length;!function t(n){re.each(n,function(n,i){var r=re.type(i);"function"===r?e.unique&&d.has(i)||l.push(i):i&&i.length&&"string"!==r&&t(i)})}(arguments),o?a=l.length:n&&(s=t,h(n))}return this},remove:function(){return l&&re.each(arguments,function(e,t){for(var n;(n=re.inArray(t,l,n))>-1;)l.splice(n,1),o&&(n<=a&&a--,n<=u&&u--)}),this},has:function(e){return e?re.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],a=0,this},disable:function(){return l=c=n=t,this},disabled:function(){return!l},lock:function(){return c=t,n||d.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||r&&!c||(o?c.push(t):h(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!r}};return d},re.extend({Deferred:function(e){var t=[["resolve","done",re.Callbacks("once memory"),"resolved"],["reject","fail",re.Callbacks("once memory"),"rejected"],["notify","progress",re.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return re.Deferred(function(n){re.each(t,function(t,o){var s=o[0],a=re.isFunction(e[t])&&e[t];r[o[1]](function(){var e=a&&a.apply(this,arguments);e&&re.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?re.extend(e,i):i}},r={};return i.pipe=i.then,re.each(t,function(e,o){var s=o[2],a=o[3];i[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),r[o[0]]=function(){return r[o[0]+"With"](this===r?i:this,arguments),this},r[o[0]+"With"]=s.fireWith}),i.promise(r),e&&e.call(r,r),r},when:function(e){var t,n,i,r=0,o=J.call(arguments),s=o.length,a=1!==s||e&&re.isFunction(e.promise)?s:0,u=1===a?e:re.Deferred(),l=function(e,n,i){return function(r){n[e]=this,i[e]=arguments.length>1?J.call(arguments):r,i===t?u.notifyWith(n,i):--a||u.resolveWith(n,i)}};if(s>1)for(t=new Array(s),n=new Array(s),i=new Array(s);r<s;r++)o[r]&&re.isFunction(o[r].promise)?o[r].promise().done(l(r,i,o)).fail(u.reject).progress(l(r,n,t)):--a;return a||u.resolveWith(i,o),u.promise()}}),re.support=function(t){var n=q.createElement("input"),i=q.createDocumentFragment(),r=q.createElement("div"),o=q.createElement("select"),s=o.appendChild(q.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=s.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,o.disabled=!0,t.optDisabled=!s.disabled,n=q.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),i.appendChild(n),t.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,r.style.backgroundClip="content-box",r.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===r.style.backgroundClip,re(function(){var n,i,o=q.getElementsByTagName("body")[0];o&&((n=q.createElement("div")).style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",o.appendChild(n).appendChild(r),r.innerHTML="",r.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",re.swap(o,null!=o.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===r.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(r,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(r,null)||{width:"4px"}).width,(i=r.appendChild(q.createElement("div"))).style.cssText=r.style.cssText="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",i.style.marginRight=i.style.width="0",r.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),o.removeChild(n))}),t):t}({});var fe,ge,me=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,be=/([A-Z])/g;r.uid=1,r.accepts=function(e){return!e.nodeType||(1===e.nodeType||9===e.nodeType)},r.prototype={key:function(e){if(!r.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=r.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(i){t[this.expando]=n,re.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var i,r=this.key(e),o=this.cache[r];if("string"==typeof t)o[t]=n;else if(re.isEmptyObject(o))this.cache[r]=t;else for(i in t)o[i]=t[i]},get:function(e,n){var i=this.cache[this.key(e)];return n===t?i:i[n]},access:function(e,n,i){return n===t||n&&"string"==typeof n&&i===t?this.get(e,n):(this.set(e,n,i),i!==t?i:n)},remove:function(e,n){var i,r,o=this.key(e),s=this.cache[o];if(n===t)this.cache[o]={};else{i=(r=re.isArray(n)?n.concat(n.map(re.camelCase)):n in s?[n]:(r=re.camelCase(n))in s?[r]:r.match(se)||[]).length;for(;i--;)delete s[r[i]]}},hasData:function(e){return!re.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){delete this.cache[this.key(e)]}},fe=new r,ge=new r,re.extend({acceptData:r.accepts,hasData:function(e){return fe.hasData(e)||ge.hasData(e)},data:function(e,t,n){return fe.access(e,t,n)},removeData:function(e,t){fe.remove(e,t)},_data:function(e,t,n){return ge.access(e,t,n)},_removeData:function(e,t){ge.remove(e,t)}}),re.fn.extend({data:function(e,n){var i,r,s=this[0],a=0,u=null;if(e===t){if(this.length&&(u=fe.get(s),1===s.nodeType&&!ge.get(s,"hasDataAttrs"))){for(i=s.attributes;a<i.length;a++)0===(r=i[a].name).indexOf("data-")&&(r=re.camelCase(r.substring(5)),o(s,r,u[r]));ge.set(s,"hasDataAttrs",!0)}return u}return"object"==typeof e?this.each(function(){fe.set(this,e)}):re.access(this,function(n){var i,r=re.camelCase(e);if(s&&n===t){if((i=fe.get(s,e))!==t)return i;if((i=fe.get(s,r))!==t)return i;if((i=o(s,r,t))!==t)return i}else this.each(function(){var i=fe.get(this,r);fe.set(this,r,n),-1!==e.indexOf("-")&&i!==t&&fe.set(this,e,n)})},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){fe.remove(this,e)})}}),re.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=ge.get(e,t),n&&(!i||re.isArray(n)?i=ge.access(e,t,re.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=re.queue(e,t),i=n.length,r=n.shift(),o=re._queueHooks(e,t),s=function(){re.dequeue(e,t)};"inprogress"===r&&(r=n.shift(),i--),o.cur=r,r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,s,o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ge.get(e,n)||ge.access(e,n,{empty:re.Callbacks("once memory").add(function(){ge.remove(e,[t+"queue",n])})})}}),re.fn.extend({queue:function(e,n){var i=2;return"string"!=typeof e&&(n=e,e="fx",i--),arguments.length<i?re.queue(this[0],e):n===t?this:this.each(function(){var t=re.queue(this,e,n);re._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&re.dequeue(this,e)})},dequeue:function(e){return this.each(function(){re.dequeue(this,e)})},delay:function(e,t){return e=re.fx?re.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var i=setTimeout(t,e);n.stop=function(){clearTimeout(i)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var i,r=1,o=re.Deferred(),s=this,a=this.length,u=function(){--r||o.resolveWith(s,[s])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";a--;)(i=ge.get(s[a],e+"queueHooks"))&&i.empty&&(r++,i.empty.add(u));return u(),o.promise(n)}});var we,ye=/[\t\r\n]/g,xe=/\r/g,ve=/^(?:input|select|textarea|button)$/i;re.fn.extend({attr:function(e,t){return re.access(this,re.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){re.removeAttr(this,e)})},prop:function(e,t){return re.access(this,re.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[re.propFix[e]||e]})},addClass:function(e){var t,n,i,r,o,s=0,a=this.length,u="string"==typeof e&&e;if(re.isFunction(e))return this.each(function(t){re(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(se)||[];s<a;s++)if(n=this[s],i=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(ye," "):" ")){for(o=0;r=t[o++];)i.indexOf(" "+r+" ")<0&&(i+=r+" ");n.className=re.trim(i)}return this},removeClass:function(e){var t,n,i,r,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(re.isFunction(e))return this.each(function(t){re(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(se)||[];s<a;s++)if(n=this[s],i=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(ye," "):"")){for(o=0;r=t[o++];)for(;i.indexOf(" "+r+" ")>=0;)i=i.replace(" "+r+" "," ");n.className=e?re.trim(i):""}return this},toggleClass:function(e,t){var n=typeof e,i="boolean"==typeof t;return re.isFunction(e)?this.each(function(n){re(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var r,o=0,s=re(this),a=t,u=e.match(se)||[];r=u[o++];)s[(a=i?a:!s.hasClass(r))?"addClass":"removeClass"](r);else n!==U&&"boolean"!==n||(this.className&&ge.set(this,"__className__",this.className),this.className=this.className||!1===e?"":ge.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;n<i;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(ye," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,i,r,o=this[0];{if(arguments.length)return r=re.isFunction(e),this.each(function(i){var o,s=re(this);1===this.nodeType&&(null==(o=r?e.call(this,i,s.val()):e)?o="":"number"==typeof o?o+="":re.isArray(o)&&(o=re.map(o,function(e){return null==e?"":e+""})),(n=re.valHooks[this.type]||re.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return(n=re.valHooks[o.type]||re.valHooks[o.nodeName.toLowerCase()])&&"get"in n&&(i=n.get(o,"value"))!==t?i:(i=o.value,"string"==typeof i?i.replace(xe,""):null==i?"":i)}}}),re.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,i=e.options,r=e.selectedIndex,o="select-one"===e.type||r<0,s=o?null:[],a=o?r+1:i.length,u=r<0?a:o?r:0;u<a;u++)if(((n=i[u]).selected||u===r)&&(re.support.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!re.nodeName(n.parentNode,"optgroup"))){if(t=re(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,i,r=e.options,o=re.makeArray(t),s=r.length;s--;)((i=r[s]).selected=re.inArray(re(i).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,i){var r,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===U?re.prop(e,n,i):(1===s&&re.isXMLDoc(e)||(n=n.toLowerCase(),r=re.attrHooks[n]||(re.expr.match.boolean.test(n)?we:void 0)),i===t?r&&"get"in r&&null!==(o=r.get(e,n))?o:(o=re.find.attr(e,n),null==o?t:o):null!==i?r&&"set"in r&&(o=r.set(e,i,n))!==t?o:(e.setAttribute(n,i+""),i):void re.removeAttr(e,n))},removeAttr:function(e,t){var n,i,r=0,o=t&&t.match(se);if(o&&1===e.nodeType)for(;n=o[r++];)i=re.propFix[n]||n,re.expr.match.boolean.test(n)&&(e[i]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!re.support.radioValue&&"radio"===t&&re.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{for:"htmlFor",class:"className"},prop:function(e,n,i){var r,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return(1!==s||!re.isXMLDoc(e))&&(n=re.propFix[n]||n,o=re.propHooks[n]),i!==t?o&&"set"in o&&(r=o.set(e,i,n))!==t?r:e[n]=i:o&&"get"in o&&null!==(r=o.get(e,n))?r:e[n]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||ve.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),we={set:function(e,t,n){return!1===t?re.removeAttr(e,n):e.setAttribute(n,n),n}},re.each(re.expr.match.boolean.source.match(/\w+/g),function(e,n){var i=re.expr.attrHandle[n]||re.find.attr;re.expr.attrHandle[n]=function(e,n,r){var o=re.expr.attrHandle[n],s=r?t:(re.expr.attrHandle[n]=t)!=i(e,n,r)?n.toLowerCase():null;return re.expr.attrHandle[n]=o,s}}),re.support.optSelected||(re.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),re.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){re.propFix[this.toLowerCase()]=this}),re.each(["radio","checkbox"],function(){re.valHooks[this]={set:function(e,t){if(re.isArray(t))return e.checked=re.inArray(re(e).val(),t)>=0}},re.support.checkOn||(re.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var _e=/^key/,Se=/^(?:mouse|contextmenu)|click/,Ce=/^(?:focusinfocus|focusoutblur)$/,Fe=/^([^.]*)(?:\.(.+)|)$/;re.event={global:{},add:function(e,n,i,r,o){var s,a,u,l,c,h,d,p,f,g,m,b=ge.get(e);if(b){for(i.handler&&(i=(s=i).handler,o=s.selector),i.guid||(i.guid=re.guid++),(l=b.events)||(l=b.events={}),(a=b.handle)||((a=b.handle=function(e){return typeof re===U||e&&re.event.triggered===e.type?t:re.event.dispatch.apply(a.elem,arguments)}).elem=e),c=(n=(n||"").match(se)||[""]).length;c--;)f=m=(u=Fe.exec(n[c])||[])[1],g=(u[2]||"").split(".").sort(),f&&(d=re.event.special[f]||{},f=(o?d.delegateType:d.bindType)||f,d=re.event.special[f]||{},h=re.extend({type:f,origType:m,data:r,handler:i,guid:i.guid,selector:o,needsContext:o&&re.expr.match.needsContext.test(o),namespace:g.join(".")},s),(p=l[f])||((p=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,g,a)||e.addEventListener&&e.addEventListener(f,a,!1)),d.add&&(d.add.call(e,h),h.handler.guid||(h.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),re.event.global[f]=!0);e=null}},remove:function(e,t,n,i,r){var o,s,a,u,l,c,h,d,p,f,g,m=ge.hasData(e)&&ge.get(e);if(m&&(u=m.events)){for(l=(t=(t||"").match(se)||[""]).length;l--;)if(a=Fe.exec(t[l])||[],p=g=a[1],f=(a[2]||"").split(".").sort(),p){for(h=re.event.special[p]||{},d=u[p=(i?h.delegateType:h.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!r&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(e,c));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(e,f,m.handle)||re.removeEvent(e,p,m.handle),delete u[p])}else for(p in u)re.event.remove(e,p+t[l],n,i,!0);re.isEmptyObject(u)&&(delete m.handle,ge.remove(e,"events"))}},trigger:function(n,i,r,o){var s,a,u,l,c,h,d,p=[r||q],f=ne.call(n,"type")?n.type:n,g=ne.call(n,"namespace")?n.namespace.split("."):[];if(a=u=r=r||q,3!==r.nodeType&&8!==r.nodeType&&!Ce.test(f+re.event.triggered)&&(f.indexOf(".")>=0&&(f=(g=f.split(".")).shift(),g.sort()),c=f.indexOf(":")<0&&"on"+f,n=n[re.expando]?n:new re.Event(f,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=g.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=r),i=null==i?[n]:re.makeArray(i,[n]),d=re.event.special[f]||{},o||!d.trigger||!1!==d.trigger.apply(r,i))){if(!o&&!d.noBubble&&!re.isWindow(r)){for(l=d.delegateType||f,Ce.test(l+f)||(a=a.parentNode);a;a=a.parentNode)p.push(a),u=a;u===(r.ownerDocument||q)&&p.push(u.defaultView||u.parentWindow||e)}for(s=0;(a=p[s++])&&!n.isPropagationStopped();)n.type=s>1?l:d.bindType||f,(h=(ge.get(a,"events")||{})[n.type]&&ge.get(a,"handle"))&&h.apply(a,i),(h=c&&a[c])&&re.acceptData(a)&&h.apply&&!1===h.apply(a,i)&&n.preventDefault();return n.type=f,o||n.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),i)||!re.acceptData(r)||c&&re.isFunction(r[f])&&!re.isWindow(r)&&((u=r[c])&&(r[c]=null),re.event.triggered=f,r[f](),re.event.triggered=t,u&&(r[c]=u)),n.result}},dispatch:function(e){e=re.event.fix(e);var n,i,r,o,s,a=[],u=J.call(arguments),l=(ge.get(this,"events")||{})[e.type]||[],c=re.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(a=re.event.handlers.call(this,e,l),n=0;(o=a[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,i=0;(s=o.handlers[i++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(s.namespace)||(e.handleObj=s,e.data=s.data,(r=((re.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,u))!==t&&!1===(e.result=r)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var i,r,o,s,a=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!==this;l=l.parentNode||this)if(!0!==l.disabled||"click"!==e.type){for(r=[],i=0;i<u;i++)r[o=(s=n[i]).selector+" "]===t&&(r[o]=s.needsContext?re(o,this).index(l)>=0:re.find(o,this,null,[l]).length),r[o]&&r.push(s);r.length&&a.push({elem:l,handlers:r})}return u<n.length&&a.push({elem:this,handlers:n.slice(u)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var i,r,o,s=n.button;return null==e.pageX&&null!=n.clientX&&(r=(i=e.target.ownerDocument||q).documentElement,o=i.body,e.pageX=n.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[re.expando])return e;var t,n,i,r=e.type,o=e,s=this.fixHooks[r];for(s||(this.fixHooks[r]=s=Se.test(r)?this.mouseHooks:_e.test(r)?this.keyHooks:{}),i=s.props?this.props.concat(s.props):this.props,e=new re.Event(o),t=i.length;t--;)e[n=i[t]]=o[n];return 3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==u()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===u()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&re.nodeName(this,"input"))return this.click(),!1},_default:function(e){return re.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,i){var r=re.extend(new re.Event,n,{type:e,isSimulated:!0,originalEvent:{}});i?re.event.trigger(r,null,t):re.event.dispatch.call(t,r),r.isDefaultPrevented()&&n.preventDefault()}},re.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},re.Event=function(e,t){if(!(this instanceof re.Event))return new re.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?s:a):this.type=e,t&&re.extend(this,t),this.timeStamp=e&&e.timeStamp||re.now(),this[re.expando]=!0},re.Event.prototype={isDefaultPrevented:a,isPropagationStopped:a,isImmediatePropagationStopped:a,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=s,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=s,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=s,this.stopPropagation()}},re.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){re.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=this,r=e.relatedTarget,o=e.handleObj;return r&&(r===i||re.contains(i,r))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),re.support.focusinBubbles||re.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,i=function(e){re.event.simulate(t,e.target,re.event.fix(e),!0)};re.event.special[t]={setup:function(){0==n++&&q.addEventListener(e,i,!0)},teardown:function(){0==--n&&q.removeEventListener(e,i,!0)}}}),re.fn.extend({on:function(e,n,i,r,o){var s,u;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=t);for(u in e)this.on(u,n,i,e[u],o);return this}if(null==i&&null==r?(r=n,i=n=t):null==r&&("string"==typeof n?(r=i,i=t):(r=i,i=n,n=t)),!1===r)r=a;else if(!r)return this;return 1===o&&(s=r,(r=function(e){return re().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=re.guid++)),this.each(function(){re.event.add(this,e,r,i,n)})},one:function(e,t,n,i){return this.on(e,t,n,i,1)},off:function(e,n,i){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,re(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return!1!==n&&"function"!=typeof n||(i=n,n=t),!1===i&&(i=a),this.each(function(){re.event.remove(this,e,i,n)})},trigger:function(e,t){return this.each(function(){re.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return re.event.trigger(e,t,n,!0)}});var Te=/^.[^:#\[\.,]*$/,Ne=re.expr.match.needsContext,Oe={children:!0,contents:!0,next:!0,prev:!0};re.fn.extend({find:function(e){var t,n,i,r=this.length;if("string"!=typeof e)return t=this,this.pushStack(re(e).filter(function(){for(i=0;i<r;i++)if(re.contains(t[i],this))return!0}));for(n=[],i=0;i<r;i++)re.find(e,this[i],n);return n=this.pushStack(r>1?re.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t=re(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(re.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(c(this,e||[],!0))},filter:function(e){return this.pushStack(c(this,e||[],!1))},is:function(e){return!!e&&("string"==typeof e?Ne.test(e)?re(e,this.context).index(this[0])>=0:re.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,i=0,r=this.length,o=[],s=Ne.test(e)||"string"!=typeof e?re(e,t||this.context):0;i<r;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&re.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?re.unique(o):o)},index:function(e){return e?"string"==typeof e?ee.call(re(e),this[0]):ee.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?re(e,t):re.makeArray(e&&e.nodeType?[e]:e),i=re.merge(this.get(),n);return this.pushStack(re.unique(i))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),re.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return re.dir(e,"parentNode")},parentsUntil:function(e,t,n){return re.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return re.dir(e,"nextSibling")},prevAll:function(e){return re.dir(e,"previousSibling")},nextUntil:function(e,t,n){return re.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return re.dir(e,"previousSibling",n)},siblings:function(e){return re.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return re.sibling(e.firstChild)},contents:function(e){return re.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:re.merge([],e.childNodes)}},function(e,t){re.fn[e]=function(n,i){var r=re.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=re.filter(i,r)),this.length>1&&(Oe[e]||re.unique(r),"p"===e[0]&&r.reverse()),this.pushStack(r)}}),re.extend({filter:function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?re.find.matchesSelector(i,e)?[i]:[]:re.find.matches(e,re.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,i){for(var r=[],o=i!==t;(e=e[n])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&re(e).is(i))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var Me=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ve=/<([\w:]+)/,De=/<|&#?\w+;/,Ie=/<(?:script|style|link)/i,Be=/^(?:checkbox|radio)$/i,Ee=/checked\s*(?:[^=]|=\s*.checked.)/i,Ae=/^$|\/(?:java|ecma)script/i,Pe=/^true\/(.*)/,Le=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Re={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Re.optgroup=Re.option,Re.tbody=Re.tfoot=Re.colgroup=Re.caption=Re.col=Re.thead,Re.th=Re.td,re.fn.extend({text:function(e){return re.access(this,function(e){return e===t?re.text(this):this.empty().append((this[0]&&this[0].ownerDocument||q).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||h(this,e).appendChild(e)})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=h(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,i=e?re.filter(e,this):this,r=0;null!=(n=i[r]);r++)t||1!==n.nodeType||re.cleanData(m(n)),n.parentNode&&(t&&re.contains(n.ownerDocument,n)&&f(m(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(re.cleanData(m(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return re.clone(this,e,t)})},html:function(e){return re.access(this,function(e){var n=this[0]||{},i=0,r=this.length;if(e===t&&1===n.nodeType)return n.innerHTML;if("string"==typeof e&&!Ie.test(e)&&!Re[(Ve.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Me,"<$1></$2>");try{for(;i<r;i++)1===(n=this[i]||{}).nodeType&&(re.cleanData(m(n,!1)),n.innerHTML=e);n=0}catch(e){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=re.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var i=e[t++],r=e[t++];r&&(re(this).remove(),r.insertBefore(n,i))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=Z.apply([],e);var i,r,o,s,a,u,l=0,c=this.length,h=this,f=c-1,g=e[0],b=re.isFunction(g);if(b||!(c<=1||"string"!=typeof g||re.support.checkClone)&&Ee.test(g))return this.each(function(i){var r=h.eq(i);b&&(e[0]=g.call(this,i,r.html())),r.domManip(e,t,n)});if(c&&(i=re.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=i.firstChild,1===i.childNodes.length&&(i=r),r)){for(s=(o=re.map(m(i,"script"),d)).length;l<c;l++)a=i,l!==f&&(a=re.clone(a,!0,!0),s&&re.merge(o,m(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,re.map(o,p),l=0;l<s;l++)a=o[l],Ae.test(a.type||"")&&!ge.access(a,"globalEval")&&re.contains(u,a)&&(a.src?re._evalUrl(a.src):re.globalEval(a.textContent.replace(Le,"")))}return this}}),re.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){re.fn[e]=function(e){for(var n,i=[],r=re(e),o=r.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),re(r[s])[t](n),Q.apply(i,n.get());return this.pushStack(i)}}),re.extend({clone:function(e,t,n){var i,r,o,s,a=e.cloneNode(!0),u=re.contains(e.ownerDocument,e);if(!(re.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||re.isXMLDoc(e)))for(s=m(a),i=0,r=(o=m(e)).length;i<r;i++)b(o[i],s[i]);if(t)if(n)for(o=o||m(e),s=s||m(a),i=0,r=o.length;i<r;i++)g(o[i],s[i]);else g(e,a);return(s=m(a,"script")).length>0&&f(s,!u&&m(e,"script")),a},buildFragment:function(e,t,n,i){for(var r,o,s,a,u,l,c=0,h=e.length,d=t.createDocumentFragment(),p=[];c<h;c++)if((r=e[c])||0===r)if("object"===re.type(r))re.merge(p,r.nodeType?[r]:r);else if(De.test(r)){for(o=o||d.appendChild(t.createElement("div")),s=(Ve.exec(r)||["",""])[1].toLowerCase(),a=Re[s]||Re._default,o.innerHTML=a[1]+r.replace(Me,"<$1></$2>")+a[2],l=a[0];l--;)o=o.firstChild;re.merge(p,o.childNodes),(o=d.firstChild).textContent=""}else p.push(t.createTextNode(r));for(d.textContent="",c=0;r=p[c++];)if((!i||-1===re.inArray(r,i))&&(u=re.contains(r.ownerDocument,r),o=m(d.appendChild(r),"script"),u&&f(o),n))for(l=0;r=o[l++];)Ae.test(r.type||"")&&n.push(r);return d},cleanData:function(e){for(var t,n,i,r=e.length,o=0,s=re.event.special;o<r;o++){if(n=e[o],re.acceptData(n)&&(t=ge.access(n)))for(i in t.events)s[i]?re.event.remove(n,i):re.removeEvent(n,i,t.handle);fe.discard(n),ge.discard(n)}},_evalUrl:function(e){return re.ajax({url:e,type:"GET",dataType:"text",async:!1,global:!1,success:re.globalEval})}}),re.fn.extend({wrapAll:function(e){var t;return re.isFunction(e)?this.each(function(t){re(this).wrapAll(e.call(this,t))}):(this[0]&&(t=re(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return re.isFunction(e)?this.each(function(t){re(this).wrapInner(e.call(this,t))}):this.each(function(){var t=re(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=re.isFunction(e);return this.each(function(n){re(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}});var ke,ze,je=/^(none|table(?!-c[ea]).+)/,Xe=/^margin/,Ue=new RegExp("^("+oe+")(.*)$","i"),Ge=new RegExp("^("+oe+")(?!px)[a-z%]+$","i"),qe=new RegExp("^([+-])=("+oe+")","i"),He={BODY:"block"},We={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:0,fontWeight:400},$e=["Top","Right","Bottom","Left"],Ke=["Webkit","O","Moz","ms"];re.fn.extend({css:function(e,n){return re.access(this,function(e,n,i){var r,o,s={},a=0;if(re.isArray(n)){for(r=x(e),o=n.length;a<o;a++)s[n[a]]=re.css(e,n[a],!1,r);return s}return i!==t?re.style(e,n,i):re.css(e,n)},e,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:y(this))?re(this).show():re(this).hide()})}}),re.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=ke(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,n,i,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,s,a,u=re.camelCase(n),l=e.style;if(n=re.cssProps[u]||(re.cssProps[u]=w(l,u)),a=re.cssHooks[n]||re.cssHooks[u],i===t)return a&&"get"in a&&(o=a.get(e,!1,r))!==t?o:l[n];"string"===(s=typeof i)&&(o=qe.exec(i))&&(i=(o[1]+1)*o[2]+parseFloat(re.css(e,n)),s="number"),null==i||"number"===s&&isNaN(i)||("number"!==s||re.cssNumber[u]||(i+="px"),re.support.clearCloneStyle||""!==i||0!==n.indexOf("background")||(l[n]="inherit"),a&&"set"in a&&(i=a.set(e,i,r))===t||(l[n]=i))}},css:function(e,n,i,r){var o,s,a,u=re.camelCase(n);return n=re.cssProps[u]||(re.cssProps[u]=w(e.style,u)),(a=re.cssHooks[n]||re.cssHooks[u])&&"get"in a&&(o=a.get(e,!0,i)),o===t&&(o=ke(e,n,r)),"normal"===o&&n in Ye&&(o=Ye[n]),""===i||i?(s=parseFloat(o),!0===i||re.isNumeric(s)?s||0:o):o}}),ke=function(e,n,i){var r,o,s,a=i||x(e),u=a?a.getPropertyValue(n)||a[n]:t,l=e.style;return a&&(""!==u||re.contains(e.ownerDocument,e)||(u=re.style(e,n)),Ge.test(u)&&Xe.test(n)&&(r=l.width,o=l.minWidth,s=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=a.width,l.width=r,l.minWidth=o,l.maxWidth=s)),u},re.each(["height","width"],function(e,t){re.cssHooks[t]={get:function(e,n,i){if(n)return 0===e.offsetWidth&&je.test(re.css(e,"display"))?re.swap(e,We,function(){return C(e,t,i)}):C(e,t,i)},set:function(e,n,i){var r=i&&x(e);return _(e,n,i?S(e,t,i,re.support.boxSizing&&"border-box"===re.css(e,"boxSizing",!1,r),r):0)}}}),re(function(){re.support.reliableMarginRight||(re.cssHooks.marginRight={get:function(e,t){if(t)return re.swap(e,{display:"inline-block"},ke,[e,"marginRight"])}}),!re.support.pixelPosition&&re.fn.position&&re.each(["top","left"],function(e,t){re.cssHooks[t]={get:function(e,n){if(n)return n=ke(e,t),Ge.test(n)?re(e).position()[t]+"px":n}}})}),re.expr&&re.expr.filters&&(re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)}),re.each({margin:"",padding:"",border:"Width"},function(e,t){re.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+$e[i]+t]=o[i]||o[i-2]||o[0];return r}},Xe.test(e)||(re.cssHooks[e+t].set=_)});var Ze=/%20/g,Qe=/\[\]$/,Je=/\r?\n/g,et=/^(?:submit|button|image|reset|file)$/i,tt=/^(?:input|select|textarea|keygen)/i;re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&tt.test(this.nodeName)&&!et.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Je,"\r\n")}}):{name:t.name,value:n.replace(Je,"\r\n")}}).get()}}),re.param=function(e,n){var i,r=[],o=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){o(this.name,this.value)});else for(i in e)N(i,e[i],n,o);return r.join("&").replace(Ze,"+")},re.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){re.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),re.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var nt,it,rt=re.now(),ot=/\?/,st=/#.*$/,at=/([?&])_=[^&]*/,ut=/^(.*?):[ \t]*([^\r\n]*)$/gm,lt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ct=/^(?:GET|HEAD)$/,ht=/^\/\//,dt=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,pt=re.fn.load,ft={},gt={},mt="*/".concat("*");try{it=G.href}catch(e){(it=q.createElement("a")).href="",it=it.href}nt=dt.exec(it.toLowerCase())||[],re.fn.load=function(e,n,i){if("string"!=typeof e&&pt)return pt.apply(this,arguments);var r,o,s,a=this,u=e.indexOf(" ");return u>=0&&(r=e.slice(u),e=e.slice(0,u)),re.isFunction(n)?(i=n,n=t):n&&"object"==typeof n&&(o="POST"),a.length>0&&re.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(i&&function(e,t){a.each(i,s||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:it,type:"GET",isLocal:lt.test(nt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":mt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":re.parseJSON,"text xml":re.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,re.ajaxSettings),t):V(re.ajaxSettings,e)},ajaxPrefilter:O(ft),ajaxTransport:O(gt),ajax:function(e,n){function i(e,n,i,a){var l,h,w,y,v,S=n;2!==x&&(x=2,u&&clearTimeout(u),r=t,s=a||"",_.readyState=e>0?4:0,l=e>=200&&e<300||304===e,i&&(y=D(d,_,i)),y=I(d,y,_,l),l?(d.ifModified&&((v=_.getResponseHeader("Last-Modified"))&&(re.lastModified[o]=v),(v=_.getResponseHeader("etag"))&&(re.etag[o]=v)),204===e?S="nocontent":304===e?S="notmodified":(S=y.state,h=y.data,l=!(w=y.error))):(w=S,!e&&S||(S="error",e<0&&(e=0))),_.status=e,_.statusText=(n||S)+"",l?g.resolveWith(p,[h,S,_]):g.rejectWith(p,[_,S,w]),_.statusCode(b),b=t,c&&f.trigger(l?"ajaxSuccess":"ajaxError",[_,d,l?h:w]),m.fireWith(p,[_,S]),c&&(f.trigger("ajaxComplete",[_,d]),--re.active||re.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var r,o,s,a,u,l,c,h,d=re.ajaxSetup({},n),p=d.context||d,f=d.context&&(p.nodeType||p.jquery)?re(p):re.event,g=re.Deferred(),m=re.Callbacks("once memory"),b=d.statusCode||{},w={},y={},x=0,v="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!a)for(a={};t=ut.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=y[n]=y[n]||e,w[e]=t),this},overrideMimeType:function(e){return x||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(x<2)for(t in e)b[t]=[b[t],e[t]];else _.always(e[_.status]);return this},abort:function(e){var t=e||v;return r&&r.abort(t),i(0,t),this}};if(g.promise(_).complete=m.add,_.success=_.done,_.error=_.fail,d.url=((e||d.url||it)+"").replace(st,"").replace(ht,nt[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=re.trim(d.dataType||"*").toLowerCase().match(se)||[""],null==d.crossDomain&&(l=dt.exec(d.url.toLowerCase()),d.crossDomain=!(!l||l[1]===nt[1]&&l[2]===nt[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(nt[3]||("http:"===nt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=re.param(d.data,d.traditional)),M(ft,d,n,_),2===x)return _;(c=d.global)&&0==re.active++&&re.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!ct.test(d.type),o=d.url,d.hasContent||(d.data&&(o=d.url+=(ot.test(o)?"&":"?")+d.data,delete d.data),!1===d.cache&&(d.url=at.test(o)?o.replace(at,"$1_="+rt++):o+(ot.test(o)?"&":"?")+"_="+rt++)),d.ifModified&&(re.lastModified[o]&&_.setRequestHeader("If-Modified-Since",re.lastModified[o]),re.etag[o]&&_.setRequestHeader("If-None-Match",re.etag[o])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&_.setRequestHeader("Content-Type",d.contentType),_.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+mt+"; q=0.01":""):d.accepts["*"]);for(h in d.headers)_.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(p,_,d)||2===x))return _.abort();v="abort";for(h in{success:1,error:1,complete:1})_[h](d[h]);if(r=M(gt,d,n,_)){_.readyState=1,c&&f.trigger("ajaxSend",[_,d]),d.async&&d.timeout>0&&(u=setTimeout(function(){_.abort("timeout")},d.timeout));try{x=1,r.send(w,i)}catch(e){if(!(x<2))throw e;i(-1,e)}}else i(-1,"No Transport");return _},getJSON:function(e,t,n){return re.get(e,t,n,"json")},getScript:function(e,n){return re.get(e,t,n,"script")}}),re.each(["get","post"],function(e,n){re[n]=function(e,i,r,o){return re.isFunction(i)&&(o=o||r,r=i,i=t),re.ajax({url:e,type:n,dataType:o,data:i,success:r})}}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,r){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),q.head.appendChild(t[0])},abort:function(){n&&n()}}}});var bt=[],wt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=bt.pop()||re.expando+"_"+rt++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(n,i,r){var o,s,a,u=!1!==n.jsonp&&(wt.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&wt.test(n.data)&&"data");if(u||"jsonp"===n.dataTypes[0])return o=n.jsonpCallback=re.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(wt,"$1"+o):!1!==n.jsonp&&(n.url+=(ot.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return a||re.error(o+" was not called"),a[0]},n.dataTypes[0]="json",s=e[o],e[o]=function(){a=arguments},r.always(function(){e[o]=s,n[o]&&(n.jsonpCallback=i.jsonpCallback,bt.push(o)),a&&re.isFunction(s)&&s(a[0]),a=s=t}),"script"}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var yt=re.ajaxSettings.xhr(),xt={0:200,1223:204},vt=0,_t={};e.ActiveXObject&&re(e).on("unload",function(){for(var e in _t)_t[e]();_t=t}),re.support.cors=!!yt&&"withCredentials"in yt,re.support.ajax=yt=!!yt,re.ajaxTransport(function(e){var n;if(re.support.cors||yt&&!e.crossDomain)return{send:function(i,r){var o,s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(o in i)a.setRequestHeader(o,i[o]);n=function(e){return function(){n&&(delete _t[s],n=a.onload=a.onerror=null,"abort"===e?a.abort():"error"===e?r(a.status||404,a.statusText):r(xt[a.status]||a.status,a.statusText,"string"==typeof a.responseText?{text:a.responseText}:t,a.getAllResponseHeaders()))}},a.onload=n(),a.onerror=n("error"),n=_t[s=vt++]=n("abort"),a.send(e.hasContent&&e.data||null)},abort:function(){n&&n()}}});var St,Ct,Ft=/^(?:toggle|show|hide)$/,Tt=new RegExp("^(?:([+-])=|)("+oe+")([a-z%]*)$","i"),Nt=/queueHooks$/,Ot=[L],Mt={"*":[function(e,t){var n,i,r=this.createTween(e,t),o=Tt.exec(t),s=r.cur(),a=+s||0,u=1,l=20;if(o){if(n=+o[2],"px"!==(i=o[3]||(re.cssNumber[e]?"":"px"))&&a){a=re.css(r.elem,e,!0)||n||1;do{a/=u=u||".5",re.style(r.elem,e,a+i)}while(u!==(u=r.cur()/s)&&1!==u&&--l)}r.unit=i,r.start=a,r.end=o[1]?a+(o[1]+1)*n:n}return r}]};re.Animation=re.extend(A,{tweener:function(e,t){re.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,i=0,r=e.length;i<r;i++)n=e[i],Mt[n]=Mt[n]||[],Mt[n].unshift(t)},prefilter:function(e,t){t?Ot.unshift(e):Ot.push(e)}}),re.Tween=R,R.prototype={constructor:R,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||"swing",this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(re.cssNumber[n]?"":"px")},cur:function(){var e=R.propHooks[this.prop];return e&&e.get?e.get(this):R.propHooks._default.get(this)},run:function(e){var t,n=R.propHooks[this.prop];return this.options.duration?this.pos=t=re.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):R.propHooks._default.set(this),this}},R.prototype.init.prototype=R.prototype,R.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=re.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){re.fx.step[e.prop]?re.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[re.cssProps[e.prop]]||re.cssHooks[e.prop])?re.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},R.propHooks.scrollTop=R.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},re.each(["toggle","show","hide"],function(e,t){var n=re.fn[t];re.fn[t]=function(e,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(k(t,!0),e,i,r)}}),re.fn.extend({fadeTo:function(e,t,n,i){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=re.isEmptyObject(e),o=re.speed(t,n,i),s=function(){var t=A(this,re.extend({},e),o);s.finish=function(){t.stop(!0)},(r||ge.get(this,"finish"))&&t.stop(!0)};return s.finish=s,r||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,n,i){var r=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=n,n=e,e=t),n&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=re.timers,s=ge.get(this);if(n)s[n]&&s[n].stop&&r(s[n]);else for(n in s)s[n]&&s[n].stop&&Nt.test(n)&&r(s[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(i),t=!1,o.splice(n,1));!t&&i||re.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=ge.get(this),i=n[e+"queue"],r=n[e+"queueHooks"],o=re.timers,s=i?i.length:0;for(n.finish=!0,re.queue(this,e,[]),r&&r.cur&&r.cur.finish&&r.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish})}}),re.each({slideDown:k("show"),slideUp:k("hide"),slideToggle:k("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){re.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}}),re.speed=function(e,t,n){var i=e&&"object"==typeof e?re.extend({},e):{complete:n||!n&&t||re.isFunction(e)&&e,duration:e,easing:n&&t||t&&!re.isFunction(t)&&t};return i.duration=re.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in re.fx.speeds?re.fx.speeds[i.duration]:re.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){re.isFunction(i.old)&&i.old.call(this),i.queue&&re.dequeue(this,i.queue)},i},re.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},re.timers=[],re.fx=R.prototype.init,re.fx.tick=function(){var e,n=re.timers,i=0;for(St=re.now();i<n.length;i++)(e=n[i])()||n[i]!==e||n.splice(i--,1);n.length||re.fx.stop(),St=t},re.fx.timer=function(e){e()&&re.timers.push(e)&&re.fx.start()},re.fx.interval=13,re.fx.start=function(){Ct||(Ct=setInterval(re.fx.tick,re.fx.interval))},re.fx.stop=function(){clearInterval(Ct),Ct=null},re.fx.speeds={slow:600,fast:200,_default:400},re.fx.step={},re.expr&&re.expr.filters&&(re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length}),re.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){re.offset.setOffset(this,e,t)});var n,i,r=this[0],o={top:0,left:0},s=r&&r.ownerDocument;if(s)return n=s.documentElement,re.contains(n,r)?(typeof r.getBoundingClientRect!==U&&(o=r.getBoundingClientRect()),i=z(s),{top:o.top+i.pageYOffset-n.clientTop,left:o.left+i.pageXOffset-n.clientLeft}):o},re.offset={setOffset:function(e,t,n){var i,r,o,s,a,u,l=re.css(e,"position"),c=re(e),h={};"static"===l&&(e.style.position="relative"),a=c.offset(),o=re.css(e,"top"),u=re.css(e,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(s=(i=c.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(u)||0),re.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(h.top=t.top-a.top+s),null!=t.left&&(h.left=t.left-a.left+r),"using"in t?t.using.call(e,h):c.css(h)}},re.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],i={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(i=e.offset()),i.top+=re.css(e[0],"borderTopWidth",!0),i.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-i.top-re.css(n,"marginTop",!0),left:t.left-i.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||H;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||H})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,i){var r="pageYOffset"===i;re.fn[n]=function(o){return re.access(this,function(n,o,s){var a=z(n);if(s===t)return a?a[i]:n[o];a?a.scrollTo(r?e.pageXOffset:s,r?s:e.pageYOffset):n[o]=s},n,o,arguments.length,null)}}),re.each({Height:"height",Width:"width"},function(e,n){re.each({padding:"inner"+e,content:n,"":"outer"+e},function(i,r){re.fn[r]=function(r,o){var s=arguments.length&&(i||"boolean"!=typeof r),a=i||(!0===r||!0===o?"margin":"border");return re.access(this,function(n,i,r){var o;return re.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):r===t?re.css(n,i,a):re.style(n,i,r,a)},n,s?r:t,s,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,"object"==typeof module&&"object"==typeof module.exports?module.exports=re:"function"==typeof define&&define.amd&&define("jquery",[],function(){return re}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=re)}(window),define("jquery/dist/jquery",function(){}),define("cobweb/Error",["jquery"],function(e){function t(n,i){e(function(){var r=e("X3DCanvas");r.each(function(){t.fallback(e(this))});for(var o=0;o<i.length;++o){var s=i[o];"function"==typeof s&&s(r,n)}})}function n(e){e.children().addClass("cobweb-fallback")}return t.fallback=n,t}),define("cobweb/Basic/X3DFieldDefinition",[],function(){function e(e,t,n){this.accessType=e,this.dataType=n.getType(),this.name=t,this.value=n,Object.preventExtensions(this),Object.freeze(this),Object.seal(this)}return e.prototype.constructor=e,e}),define("cobweb/Basic/FieldDefinitionArray",["jquery"],function(e){function t(e){this.array=e,this.index={};for(var t=0,i=e.length;t<i;++t)this.index[e[t].name]=e[t];return new Proxy(this,n)}var n={get:function(e,t){return t in e?e[t]:e.array[t]},set:function(e,t,n){return!1}};return e.extend(t.prototype,{constructor:t,add:function(e){this.array.push(e),this.index[e.name]=e},get:function(e){return this.index[e]},getValue:function(){return this.array}}),Object.defineProperty(t.prototype,"length",{get:function(){return this.array.length},enumerable:!1,configurable:!1}),t}),define("cobweb/Base/X3DObject",[],function(){function e(){return this._id}function t(){}var n=0;return t.prototype={constructor:t,_id:0,_name:"",_tainted:!1,_interests:{},getId:function(){return this.getId=e,this._id=++n},setName:function(e){this._name=e},getName:function(){return this._name},setTainted:function(e){this._tainted=e},getTainted:function(){return this._tainted},addInterest:function(e,t){this.hasOwnProperty("_interests")||(this._interests={});var n=Array.prototype.slice.call(arguments,0);n[0]=arguments[1],n[1]=this,this._interests[t.getId()+e]=Function.prototype.bind.apply(t[e],n)},removeInterest:function(e,t){delete this._interests[t.getId()+e]},getInterests:function(){return this._interests},processInterests:function(){var e=this._interests;for(var t in e)e[t]()},toVRMLString:function(){},toXMLString:function(){var e={string:""};return this.toXMLStream(e),e.string},dispose:function(){}},t}),define("cobweb/Base/X3DChildObject",["jquery","cobweb/Base/X3DObject"],function(e,t){function n(){t.call(this),this._parents={}}return n.prototype=e.extend(Object.create(t.prototype),{constructor:n,addEvent:function(){var e=this._parents;for(var t in e)e[t].addEvent(this)},addEventObject:function(e,t){var n=this._parents;for(var i in n)n[i].addEventObject(this,t)},addParent:function(e){this._parents[e.getId()]=e},removeParent:function(e){delete this._parents[e.getId()]},getParents:function(){return this._parents},addClones:Function.prototype,removeClones:Function.prototype,dispose:function(){t.prototype.dispose.call(this)}}),n}),define("cobweb/Bits/X3DConstants",[],function(){var e=0,t=0,n=0,i={NOT_STARTED_STATE:e++,IN_PROGRESS_STATE:e++,COMPLETE_STATE:e++,FAILED_STATE:e++,initializeOnly:parseInt("001",2),inputOnly:parseInt("010",2),outputOnly:parseInt("100",2),inputOutput:parseInt("111",2),SFBool:t++,SFColor:t++,SFColorRGBA:t++,SFDouble:t++,SFFloat:t++,SFImage:t++,SFInt32:t++,SFMatrix3d:t++,SFMatrix3f:t++,SFMatrix4d:t++,SFMatrix4f:t++,SFNode:t++,SFRotation:t++,SFString:t++,SFTime:t++,SFVec2d:t++,SFVec2f:t++,SFVec3d:t++,SFVec3f:t++,SFVec4d:t++,SFVec4f:t++,VrmlMatrix:t++,MFBool:t++,MFColor:t++,MFColorRGBA:t++,MFDouble:t++,MFFloat:t++,MFImage:t++,MFInt32:t++,MFMatrix3d:t++,MFMatrix3f:t++,MFMatrix4d:t++,MFMatrix4f:t++,MFNode:t++,MFRotation:t++,MFString:t++,MFTime:t++,MFVec2d:t++,MFVec2f:t++,MFVec3d:t++,MFVec3f:t++,MFVec4d:t++,MFVec4f:t++,Anchor:n++,Appearance:n++,Arc2D:n++,ArcClose2D:n++,AudioClip:n++,Background:n++,BallJoint:n++,Billboard:n++,BooleanFilter:n++,BooleanSequencer:n++,BooleanToggle:n++,BooleanTrigger:n++,BoundedPhysicsModel:n++,Box:n++,CADAssembly:n++,CADFace:n++,CADLayer:n++,CADPart:n++,Circle2D:n++,ClipPlane:n++,CollidableOffset:n++,CollidableShape:n++,Collision:n++,CollisionCollection:n++,CollisionSensor:n++,CollisionSpace:n++,Color:n++,ColorChaser:n++,ColorDamper:n++,ColorInterpolator:n++,ColorRGBA:n++,ComposedCubeMapTexture:n++,ComposedShader:n++,ComposedTexture3D:n++,Cone:n++,ConeEmitter:n++,Contact:n++,Contour2D:n++,ContourPolyline2D:n++,Coordinate:n++,CoordinateChaser:n++,CoordinateDamper:n++,CoordinateDouble:n++,CoordinateInterpolator:n++,CoordinateInterpolator2D:n++,Cylinder:n++,CylinderSensor:n++,DISEntityManager:n++,DISEntityTypeMapping:n++,DirectionalLight:n++,Disk2D:n++,DoubleAxisHingeJoint:n++,EaseInEaseOut:n++,ElevationGrid:n++,EspduTransform:n++,ExplosionEmitter:n++,Extrusion:n++,FillProperties:n++,FloatVertexAttribute:n++,Fog:n++,FogCoordinate:n++,FontStyle:n++,ForcePhysicsModel:n++,GeneratedCubeMapTexture:n++,GeoCoordinate:n++,GeoElevationGrid:n++,GeoLOD:n++,GeoLocation:n++,GeoMetadata:n++,GeoOrigin:n++,GeoPositionInterpolator:n++,GeoProximitySensor:n++,GeoTouchSensor:n++,GeoTransform:n++,GeoViewpoint:n++,Group:n++,HAnimDisplacer:n++,HAnimHumanoid:n++,HAnimJoint:n++,HAnimSegment:n++,HAnimSite:n++,ImageCubeMapTexture:n++,ImageTexture:n++,ImageTexture3D:n++,IndexedFaceSet:n++,IndexedLineSet:n++,IndexedQuadSet:n++,IndexedTriangleFanSet:n++,IndexedTriangleSet:n++,IndexedTriangleStripSet:n++,Inline:n++,IntegerSequencer:n++,IntegerTrigger:n++,KeySensor:n++,LOD:n++,Layer:n++,LayerSet:n++,Layout:n++,LayoutGroup:n++,LayoutLayer:n++,LinePickSensor:n++,LineProperties:n++,LineSet:n++,LoadSensor:n++,LocalFog:n++,Material:n++,Matrix3VertexAttribute:n++,Matrix4VertexAttribute:n++,MetadataBoolean:n++,MetadataDouble:n++,MetadataFloat:n++,MetadataInteger:n++,MetadataSet:n++,MetadataString:n++,MotorJoint:n++,MovieTexture:n++,MultiTexture:n++,MultiTextureCoordinate:n++,MultiTextureTransform:n++,NavigationInfo:n++,Normal:n++,NormalInterpolator:n++,NurbsCurve:n++,NurbsCurve2D:n++,NurbsOrientationInterpolator:n++,NurbsPatchSurface:n++,NurbsPositionInterpolator:n++,NurbsSet:n++,NurbsSurfaceInterpolator:n++,NurbsSweptSurface:n++,NurbsSwungSurface:n++,NurbsTextureCoordinate:n++,NurbsTrimmedSurface:n++,OrientationChaser:n++,OrientationDamper:n++,OrientationInterpolator:n++,OrthoViewpoint:n++,PackagedShader:n++,ParticleSystem:n++,PickableGroup:n++,PixelTexture:n++,PixelTexture3D:n++,PlaneSensor:n++,PointEmitter:n++,PointLight:n++,PointPickSensor:n++,PointSet:n++,Polyline2D:n++,PolylineEmitter:n++,Polypoint2D:n++,PositionChaser:n++,PositionChaser2D:n++,PositionDamper:n++,PositionDamper2D:n++,PositionInterpolator:n++,PositionInterpolator2D:n++,PrimitivePickSensor:n++,ProgramShader:n++,ProximitySensor:n++,QuadSet:n++,ReceiverPdu:n++,Rectangle2D:n++,RigidBody:n++,RigidBodyCollection:n++,ScalarChaser:n++,ScalarDamper:n++,ScalarInterpolator:n++,ScreenFontStyle:n++,ScreenGroup:n++,Script:n++,ShaderPart:n++,ShaderProgram:n++,Shape:n++,SignalPdu:n++,SingleAxisHingeJoint:n++,SliderJoint:n++,Sound:n++,Sphere:n++,SphereSensor:n++,SplinePositionInterpolator:n++,SplinePositionInterpolator2D:n++,SplineScalarInterpolator:n++,SpotLight:n++,SquadOrientationInterpolator:n++,StaticGroup:n++,StringSensor:n++,SurfaceEmitter:n++,Switch:n++,TexCoordChaser2D:n++,TexCoordDamper2D:n++,Text:n++,TextureBackground:n++,TextureCoordinate:n++,TextureCoordinate3D:n++,TextureCoordinate4D:n++,TextureCoordinateGenerator:n++,TextureProperties:n++,TextureTransform:n++,TextureTransform3D:n++,TextureTransformMatrix3D:n++,TimeSensor:n++,TimeTrigger:n++,TouchGroup:n++,TouchSensor:n++,Transform:n++,TransformSensor:n++,TransmitterPdu:n++,TriangleFanSet:n++,TriangleSet:n++,TriangleSet2D:n++,TriangleStripSet:n++,TwoSidedMaterial:n++,UniversalJoint:n++,Viewpoint:n++,ViewpointGroup:n++,Viewport:n++,VisibilitySensor:n++,VolumeEmitter:n++,VolumePickSensor:n++,WindPhysicsModel:n++,WorldInfo:n++,X3DBaseNode:n++,X3DAppearanceChildNode:n++,X3DAppearanceNode:n++,X3DBackgroundNode:n++,X3DBindableNode:n++,X3DBoundedObject:n++,X3DChaserNode:n++,X3DChildNode:n++,X3DColorNode:n++,X3DComposedGeometryNode:n++,X3DCoordinateNode:n++,X3DDamperNode:n++,X3DDragSensorNode:n++,X3DEnvironmentTextureNode:n++,X3DEnvironmentalSensorNode:n++,X3DFogObject:n++,X3DFollowerNode:n++,X3DFontStyleNode:n++,X3DGeometricPropertyNode:n++,X3DGeometryNode:n++,X3DGeospatialObject:n++,X3DGroupingNode:n++,X3DInfoNode:n++,X3DInterpolatorNode:n++,X3DKeyDeviceSensorNode:n++,X3DLayerNode:n++,X3DLayoutNode:n++,X3DLightNode:n++,X3DLineGeometryNode:n++,X3DMaterialNode:n++,X3DMetadataObject:n++,X3DNBodyCollidableNode:n++,X3DNBodyCollisionSpaceNode:n++,X3DNetworkSensorNode:n++,X3DNode:n++,X3DNormalNode:n++,X3DNurbsControlCurveNode:n++,X3DNurbsSurfaceGeometryNode:n++,X3DParametricGeometryNode:n++,X3DParticleEmitterNode:n++,X3DParticlePhysicsModelNode:n++,X3DPickSensorNode:n++,X3DPickableObject:n++,X3DPointingDeviceSensorNode:n++,X3DProductStructureChildNode:n++,X3DProgrammableShaderObject:n++,X3DPrototypeInstance:n++,X3DRigidJointNode:n++,X3DScriptNode:n++,X3DSensorNode:n++,X3DSequencerNode:n++,X3DShaderNode:n++,X3DShapeNode:n++,X3DSoundNode:n++,X3DSoundSourceNode:n++,X3DTexture2DNode:n++,X3DTexture3DNode:n++,X3DTextureCoordinateNode:n++,X3DTextureNode:n++,X3DTextureTransformNode:n++,X3DTimeDependentNode:n++,X3DTouchSensorNode:n++,X3DTransformMatrix3DNode:n++,X3DTransformNode:n++,X3DTriggerNode:n++,X3DUrlObject:n++,X3DVertexAttributeNode:n++,X3DViewpointNode:n++,X3DViewportNode:n++,X3DProtoDeclarationNode:n++,X3DProtoDeclaration:n++,X3DExternProtoDeclaration:n++};return Object.preventExtensions(i),Object.freeze(i),Object.seal(i),i}),define("cobweb/Base/Events",["jquery"],function(e){return{stack:[],create:function(e){if(this.stack.length){var t=this.stack.pop();return t.field=e,t}return{field:e,sources:{}}},copy:function(e){if(this.stack.length)(t=this.stack.pop()).field=e.field;else var t={field:e.field,sources:{}};var n=e.sources,i=t.sources;for(var r in n)i[r]=n[r];return t},push:function(e){var t=e.sources;for(var n in t)delete t[n];this.stack.push(e)},clear:function(){this.stack.length=0}}}),define("cobweb/Basic/X3DField",["jquery","cobweb/Base/X3DChildObject","cobweb/Bits/X3DConstants","cobweb/Base/Events"],function(e,t,n,i){function r(e){return t.call(this),this._value=e,this}return r.prototype=e.extend(Object.create(t.prototype),{constructor:r,_value:null,_references:{},_fieldInterests:{},_fieldCallbacks:{},_inputRoutes:{},_outputRoutes:{},_accessType:n.initializeOnly,_set:!1,_uniformLocation:null,clone:function(){return this.copy()},equals:function(e){return this._value===e.valueOf()},setValue:function(e){this.set(e instanceof this.constructor?e.getValue():e),this.addEvent()},set:function(e){this._value=e},getValue:function(){return this._value},setAccessType:function(e){this._accessType=e},getAccessType:function(){return this._accessType},isInitializable:function(){return this.getAccessType()&n.initializeOnly},isInput:function(){return this.getAccessType()&n.inputOnly},isOutput:function(){return this.getAccessType()&n.outputOnly},isReadable:function(){return this.getAccessType()!==n.inputOnly},isWritable:function(){return this.getAccessType()!==n.initializeOnly},setSet:function(e){return this._set=e},getSet:function(){return this._set},hasReferences:function(){return!!this.hasOwnProperty("_references")&&!e.isEmptyObject(this._references)},isReference:function(e){return e===this.getAccessType()||e===n.inputOutput},addReference:function(e){var t=this.getReferences();if(!t[e.getId()])switch(t[e.getId()]=e,this.getAccessType()&e.getAccessType()){case n.initializeOnly:return void this.set(e.getValue());case n.inputOnly:return void e.addFieldInterest(this);case n.outputOnly:return void this.addFieldInterest(e);case n.inputOutput:return e.addFieldInterest(this),this.addFieldInterest(e),void this.set(e.getValue())}},getReferences:function(){return this.hasOwnProperty("_references")||(this._references={}),this._references},updateReferences:function(){if(this.hasOwnProperty("_references"))for(var e in this._references){var t=this._references[e];switch(this.getAccessType()&t.getAccessType()){case n.inputOnly:case n.outputOnly:continue;case n.initializeOnly:case n.inputOutput:this.set(t.getValue());continue}}},addFieldInterest:function(e){this.hasOwnProperty("_fieldInterests")||(this._fieldInterests={}),this._fieldInterests[e.getId()]=e},removeFieldInterest:function(e){delete this._fieldInterests[e.getId()]},getFieldInterests:function(){return this._fieldInterests},addFieldCallback:function(e,t){this.hasOwnProperty("_fieldCallbacks")||(this._fieldCallbacks={}),this._fieldCallbacks[e]=t},removeFieldCallback:function(e){delete this._fieldCallbacks[e]},getFieldCallbacks:function(){return this._fieldCallbacks},addOutputRoute:function(e){this.hasOwnProperty("_outputRoutes")||(this._outputRoutes={}),this._outputRoutes[e.getId()]=e},removeOutputRoute:function(e){delete this._outputRoutes[e.getId()]},getOutputRoutes:function(){return this._outputRoutes},addInputRoute:function(e){this.hasOwnProperty("_inputRoutes")||(this._inputRoutes={}),this._inputRoutes[e.getId()]=e},removeInputRoute:function(e){delete this._inputRoutes[e.getId()]},getInputRoutes:function(){return this._inputRoutes},processEvent:function(e){if(!e.sources[this.getId()]){e.sources[this.getId()]=!0,this.setTainted(!1),e.field!==this&&this.set(e.field.getValue()),this.processInterests();var t=this._fieldInterests,n=!0;for(var r in t)n?(n=!1,t[r].addEventObject(this,e)):t[r].addEventObject(this,i.copy(e));n&&i.push(e);var o=this._fieldCallbacks;for(var r in o)o[r](this.valueOf())}},valueOf:function(){return this}}),r}),define("cobweb/InputOutput/Generator",["jquery","cobweb/Bits/X3DConstants"],function(e,t){return{indent:"",indentChar:"  ",executionContextStack:[null],importedNodesIndex:{},exportedNodesIndex:{},nodes:{},names:{},namesByNode:{},importedNames:{},routeNodes:{},level:0,newName:0,containerFields:[],Indent:function(){return this.indent},IncIndent:function(){this.indent+=this.indentChar},DecIndent:function(){this.indent=this.indent.substr(0,this.indent.length-this.indentChar.length)},PushExecutionContext:function(e){this.executionContextStack.push(e),this.importedNodesIndex[e.getId()]={},this.exportedNodesIndex[e.getId()]={}},PopExecutionContext:function(){this.executionContextStack.pop(),this.ExecutionContext()||(this.importedNodesIndex={},this.exportedNodesIndex={})},ExecutionContext:function(){return this.executionContextStack[this.executionContextStack.length-1]},EnterScope:function(){0===this.level&&(this.newName=0),++this.level},LeaveScope:function(){0===--this.level&&(this.nodes={},this.names={},this.namesByNode={},this.importedNames={},this.importedNodes={})},ExportedNodes:function(e){},ImportedNodes:function(e){var t=this.importedNodesIndex[this.ExecutionContext().getId()];for(var n in e)try{t[e[n].getInlineNode().getId()]=!0}catch(e){}},AddImportedNode:function(e,t){this.importedNames[e.getId()]=t},AddRouteNode:function(e){this.routeNodes[e.getId()]=!0},ExistsRouteNode:function(e){return!!this.routeNodes[e.getId()]},IsSharedNode:function(e){return!1},AddNode:function(e){this.nodes[e.getId()]=!0,this.AddRouteNode(e)},ExistsNode:function(e){return void 0!==this.nodes[e.getId()]},Name:function(e){if(void 0!==(t=this.namesByNode[e.getId()]))return t;if(0===e.getName().length){if(this.NeedsName(e)){var t=this.UniqueName();return this.names[t]=e,this.namesByNode[e.getId()]=t,t}return e.getName()}var n=/(_\d+$)/,i=null!==(t=e.getName()).match(n);if(0===(t=t.replace(n,"")).length){if(!this.NeedsName(e))return"";t=this.UniqueName()}else{for(var r=0,o=i?t+"_"+ ++r:t;void 0!==this.names[o];)o=t+"_"+ ++r;t=o}return this.names[t]=e,this.namesByNode[e.getId()]=t,t},NeedsName:function(e){if(e.getCloneCount()>1)return!0;if(e.hasRoutes())return!0;var t=e.getExecutionContext(),n=this.importedNodesIndex[t.getId()];return!(!n||!n[e.getId()])||!(!(n=this.exportedNodesIndex[t.getId()])||!n[e.getId()])},UniqueName:function(){for(;;){var e="_"+ ++this.newName;if(void 0===this.names[e])return e}},LocalName:function(e){var t=this.importedNames[e.getId()];if(void 0!==t)return t;if(this.ExistsNode(e))return this.Name(e);throw new Error("Couldn't get local name for node '"+e.getTypeName()+"'.")},PushContainerField:function(e){this.containerFields.push(e)},PopContainerField:function(){this.containerFields.pop()},ContainerField:function(){return this.containerFields.length?this.containerFields[this.containerFields.length-1]:null},AccessType:function(e){switch(e){case t.initializeOnly:return"initializeOnly";case t.inputOnly:return"inputOnly";case t.outputOnly:return"outputOnly";case t.inputOutput:return"inputOutput"}},XMLEncode:function(e){return e.replace(/&/g,"&amp;").replace(/#/g,"&#35;").replace(/\\/g,"&#92;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;")},escapeCDATA:function(e){return e.replace(/\]\]\>/g,"\\]\\]\\>")}}}),define("cobweb/Basic/X3DArrayField",["jquery","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i){function r(e){return t.call(this,[]),e[0]instanceof Array&&(e=e[0]),r.prototype.push.apply(this,e),new Proxy(this,o)}var o={get:function(e,t){try{if(t in e)return e[t];var n=e.getValue(),i=parseInt(t);return i>=n.length&&e.resize(i+1),n[i].valueOf()}catch(n){if("symbol"==typeof t)return;console.log(e,typeof t,t,n)}},set:function(e,t,n){try{if(t in e)return e[t]=n,!0;var i=e.getValue(),r=parseInt(t);return r>=i.length&&e.resize(r+1),i[r].setValue(n),!0}catch(n){return console.log(e,t,n),!1}},has:function(e,t){return t in e.getValue()},enumerate:function(e){return Object.keys(e.getValue())[Symbol.iterator]()}};return r.prototype=e.extend(new t([]),{constructor:r,copy:function(){var e=new this.constructor,t=this.getValue();return r.prototype.push.apply(e,t),e},equals:function(e){var t=this.getValue(),n=e.getValue(),i=t.length;if(t===n)return!0;if(i!==n.length)return!1;for(var r=0;r<i;++r)if(!t[r].equals(n[r]))return!1;return!0},setValue:function(e){this.set(e instanceof r?e.getValue():e),this.addEvent()},isDefaultValue:function(){return 0===this.length},set:function(e){this.resize(e.length,void 0,!0);for(var n=this.getValue(),i=0,r=e.length;i<r;++i)n[i].set(e[i]instanceof t?e[i].getValue():e[i])},unshift:function(e){for(var t=this.getValue(),n=arguments.length-1;n>=0;--n){var i=new this._valueType;i.setValue(arguments[n]),this.addChildObject(i),t.unshift(i)}return this.addEvent(),t.length},shift:function(){var e=this.getValue();if(e.length){var t=e.shift();return this.removeChild(t),this.addEvent(),t.valueOf()}},push:function(e){for(var t=this.getValue(),n=0,i=arguments.length;n<i;++n){var r=new this._valueType;r.setValue(arguments[n]),this.addChildObject(r),t.push(r)}return this.addEvent(),t.length},pop:function(){var e=this.getValue();if(e.length){var t=e.pop();return this.removeChild(t),this.addEvent(),t.valueOf()}},insert:function(e,t,n,i){for(var r=[e,0],o=n;o<i;++o){var s=new this._valueType;s.setValue(t[o]),this.addChildObject(s),r.push(s)}Array.prototype.splice.apply(this.getValue(),r),this.addEvent()},find:function(t,n,i){if(e.isFunction(i)){for(var r=this.getValue(),o=t;o<n;++o)if(i(r[o].valueOf()))return o;return n}for(var r=this.getValue(),o=t;o<n;++o)if(r[o].equals(i))return o;return n},remove:function(t,n,i){if(e.isFunction(i)){r=this.getValue();if((t=this.find(t,n,i))!==n)for(o=t;++o<n;)if(!i((s=r[o]).valueOf())){a=r[t];r[t++]=s,r[o]=a}return t}var r=this.getValue();if((t=this.find(t,n,i))!==n)for(var o=t;++o<n;){var s=r[o];if(!s.equals(i)){var a=r[t];r[t++]=s,r[o]=a}}return t},erase:function(e,t){for(var n=this.getValue().splice(e,t-e),i=0,r=n.length;i<r;++i)this.removeChild(n[i]);this.addEvent()},resize:function(e,t,n){var i=this.getValue();if(e<i.length){for(var r=e,o=i.length;r<o;++r)this.removeChild(i[r]);i.length=e,n||this.addEvent()}else if(e>i.length){for(r=i.length;r<e;++r){var s=new this._valueType;void 0!==t&&s.setValue(t),this.addChildObject(s),i.push(s)}n||this.addEvent()}},addChildObject:function(e){e.addParent(this)},removeChild:function(e){e.removeParent(this)},toString:function(){var e=this.getValue(),t="";switch(e.length){case 0:t+="[ ]";break;case 1:t+=e[0].toString();break;default:t+="[\n",i.IncIndent();for(var n=0,r=e.length-1;n<r;++n)t+=i.Indent(),t+=e[n].toString(),t+=",\n";t+=i.Indent(),t+=e[r].toString(),t+="\n",i.DecIndent(),t+=i.Indent(),t+="]"}return t},toXMLStream:function(e){var t=this.length;if(t){for(var n=this.getValue(),i=0,r=t-1;i<r;++i)n[i].toXMLStream(e),e.string+=", ";n[r].toXMLStream(e)}},dispose:function(){this.erase(0,this.length),t.prototype.dispose.call(this)}}),Object.defineProperty(r.prototype,"length",{get:function(){return this.getValue().length},set:function(e){this.resize(e)},enumerable:!1,configurable:!1}),r}),define("cobweb/Fields/SFBool",["jquery","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){return this instanceof i?t.call(this,Boolean(e)):t.call(Object.create(i.prototype),Boolean(e))}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},isDefaultValue:function(){return!1===this.getValue()},set:function(e){t.prototype.set.call(this,Boolean(e))},getTypeName:function(){return"SFBool"},getType:function(){return n.SFBool},valueOf:function(){return this.getValue()},toString:function(){return this.getValue()?"TRUE":"FALSE"},toXMLStream:function(e){e.string+=this.getValue()?"true":"false"}}),i}),define("standard/Math/Algorithm",[],function(){var e={signum:function(e){return(0<e)-(e<0)},radians:function(e){return e*(Math.PI/180)},degrees:function(e){return e*(180/Math.PI)},random:function(e,t){return e+Math.random()*(t-e)},clamp:function(e,t,n){return e<t?t:e>n?n:e},interval:function(e,t,n){return e>=n?(e-t)%(n-t)+t:e<t?(e-n)%(n-t)+n:e},lerp:function(e,t,n){return e+n*(t-e)},slerp:function(e,t,n){var i=e.dot(t);if(i<=-1)throw new Error("slerp is not possible: vectors are inverse collinear.");if(i>=1)return e;i<0&&(i=-i,t.negate());var r=Math.acos(i),o=Math.sin(r),s=Math.sin((1-n)*r)/o,a=Math.sin(n*r)/o;return e.x=e.x*s+t.x*a,e.y=e.y*s+t.y*a,e.z=e.z*s+t.z*a,e.w=e.w*s+t.w*a,e},simpleSlerp:function(e,t,n){var i=e.dot(t);if(i<=-1)throw new Error("slerp is not possible: vectors are inverse collinear.");if(i>=1)return e;var r=Math.acos(i),o=Math.sin(r),s=Math.sin((1-n)*r)/o,a=Math.sin(n*r)/o;return e.x=e.x*s+t.x*a,e.y=e.y*s+t.y*a,e.z=e.z*s+t.z*a,e.w=e.w*s+t.w*a,e},isPowerOfTwo:function(e){return 0==(e-1&e)},nextPowerOfTwo:function(e){--e;for(var t=1;!(32&t);t<<=1)e|=e>>t;return++e},less:function(e,t){return e<t},greater:function(e,t){return e>t},lowerBound:function(e,t,n,i,r){for(var o=0,s=0,a=n-t;a>0;)r(e[o=t+(s=a>>>1)],i)?(t=++o,a-=s+1):a=s;return t},upperBound:function(e,t,n,i,r){for(var o=0,s=0,a=n-t;a>0;)r(i,e[o=t+(s=a>>>1)])?a=s:(t=++o,a-=s+1);return t},set_difference:function(e,t,n){for(var i in e)i in t||(n[i]=e[i]);return n}};return Object.preventExtensions(e),Object.freeze(e),Object.seal(e),e}),define("standard/Math/Numbers/Color3",["jquery","standard/Math/Algorithm"],function(e,t){function n(e,t,n){arguments.length?(this.r_=i(e,0,1),this.g_=i(t,0,1),this.b_=i(n,0,1)):(this.r_=0,this.g_=0,this.b_=0)}var i=t.clamp;n.prototype={constructor:n,length:3,copy:function(){var e=Object.create(n.prototype);return e.r_=this.r_,e.g_=this.g_,e.b_=this.b_,e},assign:function(e){this.r_=e.r_,this.g_=e.g_,this.b_=e.b_},set:function(e,t,n){this.r_=i(e,0,1),this.g_=i(t,0,1),this.b_=i(n,0,1)},equals:function(e){return this.r_===e.r_&&this.g_===e.g_&&this.b_===e.b_},getHSV:function(e){var t,n,i,r=Math.min(this.r_,this.g_,this.b_),o=Math.max(this.r_,this.g_,this.b_);i=o;var s=o-r;return 0!==o&&0!==s?(n=s/o,t=this.r_===o?(this.g_-this.b_)/s:this.g_===o?2+(this.b_-this.r_)/s:4+(this.r_-this.g_)/s,(t*=Math.PI/3)<0&&(t+=2*Math.PI)):n=t=0,e[0]=t,e[1]=n,e[2]=i,e},setHSV:function(e,n,r){if(n=i(n,0,1),r=i(r,0,1),0===n)this.r_=this.g_=this.b_=r;else{var o=t.degrees(t.interval(e,0,2*Math.PI))/60,s=Math.floor(o),a=o-s,u=r*(1-n),l=r*(1-n*a),c=r*(1-n*(1-a));switch(s%6){case 0:this.r_=r,this.g_=c,this.b_=u;break;case 1:this.r_=l,this.g_=r,this.b_=u;break;case 2:this.r_=u,this.g_=r,this.b_=c;break;case 3:this.r_=u,this.g_=l,this.b_=r;break;case 4:this.r_=c,this.g_=u,this.b_=r;break;default:this.r_=r,this.g_=u,this.b_=l}}},toString:function(){return this.r_+" "+this.g_+" "+this.b_}};var r={get:function(){return this.r_},set:function(e){this.r_=i(e,0,1)},enumerable:!0,configurable:!1},o={get:function(){return this.g_},set:function(e){this.g_=i(e,0,1)},enumerable:!0,configurable:!1},s={get:function(){return this.b_},set:function(e){this.b_=i(e,0,1)},enumerable:!0,configurable:!1};return Object.defineProperty(n.prototype,"r",r),Object.defineProperty(n.prototype,"g",o),Object.defineProperty(n.prototype,"b",s),r.enumerable=!1,o.enumerable=!1,s.enumerable=!1,Object.defineProperty(n.prototype,"0",r),Object.defineProperty(n.prototype,"1",o),Object.defineProperty(n.prototype,"2",s),e.extend(n,{HSV:function(e,t,i){var r=new n(0,0,0);return r.setHSV(e,t,i),r},lerp:function(e,n,i,r){var o=Math.abs(n[0]-e[0]);if(o<=Math.PI)return r[0]=t.lerp(e[0],n[0],i),r[1]=t.lerp(e[1],n[1],i),r[2]=t.lerp(e[2],n[2],i),r;var s=2*Math.PI,a=(s-o)*i,u=e[0]<n[0]?e[0]-a:e[0]+a;return u<0?u+=s:u>s&&(u-=s),r[0]=u,r[1]=t.lerp(e[1],n[1],i),r[2]=t.lerp(e[2],n[2],i),r}}),n}),define("cobweb/Fields/SFColor",["jquery","standard/Math/Numbers/Color3","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e,i,o){return this instanceof r?arguments.length?arguments[0]instanceof t?n.call(this,arguments[0]):n.call(this,new t(+e,+i,+o)):n.call(this,new t):r.apply(Object.create(r.prototype),arguments)}r.prototype=e.extend(Object.create(n.prototype),{constructor:r,copy:function(){return new r(this.getValue().copy())},getTypeName:function(){return"SFColor"},getType:function(){return i.SFColor},equals:function(e){return this.getValue().equals(e.getValue())},isDefaultValue:function(){return 0===this.getValue().r&&0===this.getValue().g&&0===this.getValue().b},set:function(e){this.getValue().assign(e)},getHSV:function(){return this.getValue().getHSV([])},setHSV:function(e,t,n){this.getValue().setHSV(e,t,n),this.addEvent()},toString:function(){return this.getValue().toString()},toXMLStream:function(e){e.string+=this.getValue().toString()}});var o={get:function(){return this.getValue().r},set:function(e){this.getValue().r=e,this.addEvent()},enumerable:!0,configurable:!1},s={get:function(){return this.getValue().g},set:function(e){this.getValue().g=e,this.addEvent()},enumerable:!0,configurable:!1},a={get:function(){return this.getValue().b},set:function(e){this.getValue().b=e,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(r.prototype,"r",o),Object.defineProperty(r.prototype,"g",s),Object.defineProperty(r.prototype,"b",a),o.enumerable=!1,s.enumerable=!1,a.enumerable=!1,Object.defineProperty(r.prototype,"0",o),Object.defineProperty(r.prototype,"1",s),Object.defineProperty(r.prototype,"2",a),r}),define("standard/Math/Numbers/Color4",["jquery","standard/Math/Numbers/Color3","standard/Math/Algorithm"],function(e,t,n){function i(e,t,n,i){arguments.length?(this.r_=r(e,0,1),this.g_=r(t,0,1),this.b_=r(n,0,1),this.a_=r(i,0,1)):(this.r_=0,this.g_=0,this.b_=0,this.a_=0)}var r=n.clamp;i.prototype={constructor:i,length:4,copy:function(){var e=Object.create(i.prototype);return e.r_=this.r_,e.g_=this.g_,e.b_=this.b_,e.a_=this.a_,e},assign:function(e){this.r_=e.r_,this.g_=e.g_,this.b_=e.b_,this.a_=e.a_},set:function(e,t,n,i){this.r_=r(e,0,1),this.g_=r(t,0,1),this.b_=r(n,0,1),this.a_=r(i,0,1)},equals:function(e){return this.r_===e.r_&&this.g_===e.g_&&this.b_===e.b_&&this.a_===e.a_},getHSVA:function(e){return t.prototype.getHSV.call(this,e),e[3]=this.a_,e},setHSVA:function(e,n,i,o){t.prototype.setHSV.call(this,e,n,i),this.a_=r(o,0,1)},toString:function(){return this.r_+" "+this.g_+" "+this.b_+" "+this.a_}};var o={get:function(){return this.r_},set:function(e){this.r_=r(e,0,1)},enumerable:!0,configurable:!1},s={get:function(){return this.g_},set:function(e){this.g_=r(e,0,1)},enumerable:!0,configurable:!1},a={get:function(){return this.b_},set:function(e){this.b_=r(e,0,1)},enumerable:!0,configurable:!1},u={get:function(){return this.a_},set:function(e){this.a_=r(e,0,1)},enumerable:!0,configurable:!1};return Object.defineProperty(i.prototype,"r",o),Object.defineProperty(i.prototype,"g",s),Object.defineProperty(i.prototype,"b",a),Object.defineProperty(i.prototype,"a",u),o.enumerable=!1,s.enumerable=!1,a.enumerable=!1,u.enumerable=!1,Object.defineProperty(i.prototype,"0",o),Object.defineProperty(i.prototype,"1",s),Object.defineProperty(i.prototype,"2",a),Object.defineProperty(i.prototype,"3",u),i.HSVA=function(e,t,n,r){var o=new i(0,0,0,r);return o.setHSV(e,t,n),o},i}),define("cobweb/Fields/SFColorRGBA",["jquery","cobweb/Basic/X3DField","cobweb/Fields/SFColor","cobweb/Bits/X3DConstants","standard/Math/Numbers/Color4"],function(e,t,n,i,r){function o(e,n,i,s){return this instanceof o?arguments.length?arguments[0]instanceof r?t.call(this,arguments[0]):t.call(this,new r(+e,+n,+i,+s)):t.call(this,new r):o.apply(Object.create(o.prototype),arguments)}o.prototype=e.extend(Object.create(t.prototype),{constructor:o,copy:function(){return new o(this.getValue().copy())},getTypeName:function(){return"SFColorRGBA"},getType:function(){return i.SFColorRGBA},equals:n.prototype.equals,isDefaultValue:function(){return 0===this.getValue().r&&0===this.getValue().g&&0===this.getValue().b&&0===this.getValue().a},set:n.prototype.set,getHSVA:function(){return this.getValue().getHSVA([])},setHSVA:function(e,t,n,i){this.getValue().setHSVA(e,t,n,i),this.addEvent()},toString:n.prototype.toString,toXMLStream:n.prototype.toXMLStream});var s={get:function(){return this.getValue().r},set:function(e){this.getValue().r=e,this.addEvent()},enumerable:!0,configurable:!1},a={get:function(){return this.getValue().g},set:function(e){this.getValue().g=e,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().b},set:function(e){this.getValue().b=e,this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().a},set:function(e){this.getValue().a=e,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(o.prototype,"r",s),Object.defineProperty(o.prototype,"g",a),Object.defineProperty(o.prototype,"b",u),Object.defineProperty(o.prototype,"a",l),s.enumerable=!1,a.enumerable=!1,u.enumerable=!1,l.enumerable=!1,Object.defineProperty(o.prototype,"0",s),Object.defineProperty(o.prototype,"1",a),Object.defineProperty(o.prototype,"2",u),Object.defineProperty(o.prototype,"3",l),o}),define("cobweb/Fields/SFDouble",["jquery","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){return this instanceof i?t.call(this,arguments.length?+e:0):t.call(Object.create(i.prototype),arguments.length?+e:0)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},getTypeName:function(){return"SFDouble"},getType:function(){return n.SFDouble},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,+e)},valueOf:t.prototype.getValue,toString:function(){return String(this.getValue())},toXMLStream:function(e){e.string+=String(this.getValue())}}),i}),define("cobweb/Fields/SFFloat",["jquery","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){return this instanceof i?t.call(this,arguments.length?+e:0):t.call(Object.create(i.prototype),arguments.length?+e:0)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},getTypeName:function(){return"SFFloat"},getType:function(){return n.SFFloat},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,+e)},valueOf:t.prototype.getValue,toString:function(){return String(this.getValue())},toXMLStream:function(e){e.string+=String(this.getValue())}}),i}),define("cobweb/Fields/SFInt32",["jquery","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){return this instanceof i?t.call(this,~~e):t.call(Object.create(i.prototype),~~e)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},getTypeName:function(){return"SFInt32"},getType:function(){return n.SFInt32},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,~~e)},valueOf:t.prototype.getValue,toString:function(e){return this.getValue().toString(e)},toXMLStream:function(e){e.string+=this.getValue().toString()}}),i}),define("cobweb/Fields/SFMatrixPrototypeTemplate",["jquery","cobweb/Basic/X3DField"],function(e,t){return function(n,i){return e.extend(Object.create(t.prototype),{copy:function(){return new this.constructor(this.getValue().copy())},equals:function(e){return this.getValue().equals(e.getValue())},isDefaultValue:function(){return this.getValue().equals(n.Identity)},set:function(e){this.getValue().assign(e)},setTransform:function(e,t,n,i,r){e=e?e.getValue():null,t=t?t.getValue():null,n=n?n.getValue():null,i=i?i.getValue():null,r=r?r.getValue():null,this.getValue().set(e,t,n,i,r)},getTransform:function(e,t,n,i,r){e=e?e.getValue():null,t=t?t.getValue():null,n=n?n.getValue():null,i=i?i.getValue():null,r=r?r.getValue():null,this.getValue().get(e,t,n,i,r)},transpose:function(){return new this.constructor(n.transpose(this.getValue()))},inverse:function(){return new this.constructor(n.inverse(this.getValue()))},multLeft:function(e){return new this.constructor(n.multLeft(this.getValue(),e.getValue()))},multRight:function(e){return new this.constructor(n.multRight(this.getValue(),e.getValue()))},multVecMatrix:function(e){return new i(this.getValue().multVecMatrix(e.getValue().copy()))},multMatrixVec:function(e){return new i(this.getValue().multMatrixVec(e.getValue().copy()))},multDirMatrix:function(e){return new i(this.getValue().multDirMatrix(e.getValue().copy()))},multMatrixDir:function(e){return new i(this.getValue().multMatrixDir(e.getValue().copy()))},toString:function(){return this.getValue().toString()},toXMLStream:function(e){e.string+=this.getValue().toString()}})}}),define("cobweb/Fields/SFVecPrototypeTemplate",["jquery","cobweb/Basic/X3DField"],function(e,t){return function(n){return e.extend(Object.create(t.prototype),{copy:function(){return new this.constructor(this.getValue().copy())},equals:function(e){return this.getValue().equals(e.getValue())},isDefaultValue:function(e){return this.getValue().equals(n.Zero)},set:function(e){this.getValue().assign(e)},negate:function(){return new this.constructor(n.negate(this.getValue().copy()))},add:function(e){return new this.constructor(n.add(this.getValue(),e.getValue()))},subtract:function(e){return new this.constructor(n.subtract(this.getValue(),e.getValue()))},multiply:function(e){return new this.constructor(n.multiply(this.getValue(),e))},divide:function(e){return new this.constructor(n.divide(this.getValue(),e))},dot:function(e){return this.getValue().dot(e.getValue())},normalize:function(e){return new this.constructor(n.normalize(this.getValue()))},length:function(){return this.getValue().abs()},toString:function(){return this.getValue().toString()},toXMLStream:function(e){e.string+=this.getValue().toString()}})}}),define("standard/Math/Numbers/Vector2",["jquery","standard/Math/Algorithm"],function(e,t){function n(e,t){this.x=e,this.y=t}return n.prototype={constructor:n,length:2,copy:function(){var e=Object.create(n.prototype);return e.x=this.x,e.y=this.y,e},assign:function(e){return this.x=e.x,this.y=e.y,this},set:function(e,t){return this.x=e,this.y=t,this},equals:function(e){return this.x===e.x&&this.y===e.y},negate:function(){return this.x=-this.x,this.y=-this.y,this},add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.x-=e.x,this.y-=e.y,this},multiply:function(e){return this.x*=e,this.y*=e,this},multVec:function(e){return this.x*=e.x,this.y*=e.y,this},divide:function(e){return this.x/=e,this.y/=e,this},divVec:function(e){return this.x/=e.x,this.y/=e.y,this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y);return e&&(e=1/e,this.x*=e,this.y*=e),this},dot:function(e){return this.x*e.x+this.y*e.y},norm:function(){return this.x*this.x+this.y*this.y},abs:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},distance:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},lerp:function(e,t){return this.x=this.x+t*(e.x-this.x),this.y=this.y+t*(e.y-this.y),this},min:function(e){for(var t=0,n=arguments.length;t<n;++t){var e=arguments[t];this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y)}return this},max:function(e){for(var t=0,n=arguments.length;t<n;++t){var e=arguments[t];this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y)}return this},toString:function(){return this.x+" "+this.y}},Object.defineProperty(n.prototype,"0",{get:function(){return this.x},set:function(e){this.x=e},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"1",{get:function(){return this.y},set:function(e){this.y=e},enumerable:!1,configurable:!1}),e.extend(n,{Zero:new n(0,0),One:new n(1,1),negate:function(e){var t=Object.create(this.prototype);return t.x=-e.x,t.y=-e.y,t},add:function(e,t){var n=Object.create(this.prototype);return n.x=e.x+t.x,n.y=e.y+t.y,n},subtract:function(e,t){var n=Object.create(this.prototype);return n.x=e.x-t.x,n.y=e.y-t.y,n},multiply:function(e,t){var n=Object.create(this.prototype);return n.x=e.x*t,n.y=e.y*t,n},multVec:function(e,t){var n=Object.create(this.prototype);return n.x=e.x*t.x,n.y=e.y*t.y,n},divide:function(e,t){var n=Object.create(this.prototype);return n.x=e.x/t,n.y=e.y/t,n},divVec:function(e,t){var n=Object.create(this.prototype);return n.x=e.x/t.x,n.y=e.y/t.y,n},normalize:function(e){var t=Object.create(this.prototype),n=e.x,i=e.y,r=Math.sqrt(n*n+i*i);return r?(r=1/r,t.x=n*r,t.y=i*r):(t.x=0,t.y=0),t},dot:function(e,t){return e.dot(t)},lerp:function(e,i,r){return new n(t.lerp(e.x,i.x,r),t.lerp(e.y,i.y,r))},min:function(e,t){for(var i=e.x,r=e.y,o=1,s=arguments.length;o<s;++o){var a=arguments[o];i=Math.min(i,a.x),r=Math.min(r,a.y)}return new n(i,r)},max:function(e,t){for(var i=e.x,r=e.y,o=1,s=arguments.length;o<s;++o){var a=arguments[o];i=Math.max(i,a.x),r=Math.max(r,a.y)}return new n(i,r)}}),n}),define("cobweb/Fields/SFVec2",["jquery","cobweb/Basic/X3DField","cobweb/Fields/SFVecPrototypeTemplate","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(e,t,n,i,r){function o(i,o){function s(e,n){return arguments.length?arguments[0]instanceof r?t.call(this,arguments[0]):t.call(this,new r(+e,+n)):t.call(this,new r(0,0))}s.prototype=e.extend(Object.create(t.prototype),n(r),{constructor:s,getTypeName:function(){return i},getType:function(){return o}});var a={get:function(){return this.getValue().x},set:function(e){this.getValue().x=e,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().y},set:function(e){this.getValue().y=e,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",a),Object.defineProperty(s.prototype,"y",u),a.enumerable=!1,u.enumerable=!1,Object.defineProperty(s.prototype,"0",a),Object.defineProperty(s.prototype,"1",u),s}return{SFVec2d:o("SFVec2d",i.SFVec2d),SFVec2f:o("SFVec2f",i.SFVec2f)}}),define("standard/Math/Numbers/Vector3",["jquery","standard/Math/Algorithm"],function(e,t){function n(e,t,n){this.x=e,this.y=t,this.z=n}n.prototype={constructor:n,length:3,copy:function(){var e=Object.create(n.prototype);return e.x=this.x,e.y=this.y,e.z=this.z,e},assign:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},equals:function(e){return this.x===e.x&&this.y===e.y&&this.z===e.z},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},subtract:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this},multiply:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multVec:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this},divide:function(e){return this.x/=e,this.y/=e,this.z/=e,this},divVec:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},cross:function(e){var t=this.x,n=this.y,i=this.z;return this.x=n*e.z-i*e.y,this.y=i*e.x-t*e.z,this.z=t*e.y-n*e.x,this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return e&&(e=1/e,this.x*=e,this.y*=e,this.z*=e),this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},norm:function(){return this.x*this.x+this.y*this.y+this.z*this.z},abs:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},distance:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return Math.sqrt(t*t+n*n+i*i)},lerp:function(e,t){return this.x=this.x+t*(e.x-this.x),this.y=this.y+t*(e.y-this.y),this.z=this.z+t*(e.z-this.z),this},slerp:function(e,n){return t.simpleSlerp(this,i.assign(e),n)},min:function(e){for(var t=0,n=arguments.length;t<n;++t){var e=arguments[t];this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z)}return this},max:function(e){for(var t=0,n=arguments.length;t<n;++t){var e=arguments[t];this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z)}return this},toString:function(){return this.x+" "+this.y+" "+this.z}},Object.defineProperty(n.prototype,"0",{get:function(){return this.x},set:function(e){this.x=e},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"1",{get:function(){return this.y},set:function(e){this.y=e},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"2",{get:function(){return this.z},set:function(e){this.z=e},enumerable:!1,configurable:!1}),e.extend(n,{Zero:new n(0,0,0),One:new n(1,1,1),xAxis:new n(1,0,0),yAxis:new n(0,1,0),zAxis:new n(0,0,1),negate:function(e){var t=Object.create(this.prototype);return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},add:function(e,t){var n=Object.create(this.prototype);return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},subtract:function(e,t){var n=Object.create(this.prototype);return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},multiply:function(e,t){var n=Object.create(this.prototype);return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},multVec:function(e,t){var n=Object.create(this.prototype);return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},divide:function(e,t){var n=Object.create(this.prototype);return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},divVec:function(e,t){var n=Object.create(this.prototype);return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},cross:function(e,t){var n=Object.create(this.prototype);return n.x=e.y*t.z-e.z*t.y,n.y=e.z*t.x-e.x*t.z,n.z=e.x*t.y-e.y*t.x,n},normalize:function(e){var t=Object.create(this.prototype),n=e.x,i=e.y,r=e.z,o=Math.sqrt(n*n+i*i+r*r);return o?(o=1/o,t.x=n*o,t.y=i*o,t.z=r*o):(t.x=0,t.y=0,t.z=0),t},dot:function(e,t){return e.dot(t)},lerp:function(e,i,r){return new n(t.lerp(e.x,i.x,r),t.lerp(e.y,i.y,r),t.lerp(e.z,i.z,r))},slerp:function(e,n,r){return t.simpleSlerp(e.copy(),i.assign(n),r)},min:function(e,t){for(var i=e.x,r=e.y,o=e.z,s=1,a=arguments.length;s<a;++s){var u=arguments[s];i=Math.min(i,u.x),r=Math.min(r,u.y),o=Math.min(o,u.z)}return new n(i,r,o)},max:function(e,t){for(var i=e.x,r=e.y,o=e.z,s=1,a=arguments.length;s<a;++s){var u=arguments[s];i=Math.max(i,u.x),r=Math.max(r,u.y),o=Math.max(o,u.z)}return new n(i,r,o)}});var i=new n(0,0,0);return n}),define("standard/Math/Numbers/Matrix2",["jquery","standard/Math/Algorithm"],function(e,t){function n(){arguments.length?(this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3]):this.identity()}return n.prototype={constructor:n,order:2,length:4,copy:function(){var e=Object.create(n.prototype);return e[0]=this[0],e[1]=this[1],e[2]=this[2],e[3]=this[3],e},assign:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this},equals:function(e){return this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2]&&this[3]===e[3]},set1:function(e,t,n){this[e*this.order+t]=n},get1:function(e,t){return this[e*this.order+t]},set:function(){switch(arguments.length){case 0:this.identity();break;case 4:this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3]}},determinant1:function(){return this[0]},determinant:function(){return this[0]*this[3]-this[1]*this[2]},transpose:function(){var e=this[1];return this[1]=this[2],this[2]=e,this},inverse:function(){var e=this.determinant();if(0===e)throw new Error("Matrix2 .inverse: determinant is 0.");return this[0]=array[0]/e,this[1]=-array[1]/e,this[2]=-array[2]/e,this[3]=array[3]/e,this},multLeft:function(e){var t=this[0],n=this[1],i=this[2],r=this[3],o=e[0],s=e[1],a=e[2],u=e[3];return this[0]=t*o+i*s,this[1]=n*o+r*s,this[2]=t*a+i*u,this[3]=n*a+r*u,this},multRight:function(e){var t=this[0],n=this[1],i=this[2],r=this[3],o=e[0],s=e[1],a=e[2],u=e[3];return this[0]=o*t+a*n,this[1]=s*t+u*n,this[2]=o*i+a*r,this[3]=s*i+u*r,this},identity:function(){this[0]=1,this[1]=0,this[2]=0,this[3]=1},toString:function(){return this[0]+" "+this[1]+" "+this[2]+" "+this[3]}},Object.defineProperty(n.prototype,"x",{get:function(){return this[0]},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"origin",{get:function(){return nthis[2]},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"submatrix",{get:function(){return this.value[0]},enumerable:!1,configurable:!1}),e.extend(n,{Identity:new n}),n}),define("standard/Math/Algorithms/eigendecomposition",[],function(){return function(e){var t,n,i,r,o,s,a,u,l,c,h,d,p,f=e.order,g=new Array(f),m=new Array(f),b=new Array(f),w=new Array(f),y=new Array(f),x=e.length;for(d=0;d<f;++d)for(m[d]=new Array(f),b[d]=new Array(f),w[d]=g[d]=e.get1(d,d),y[d]=0,p=0;p<f;++p)m[d][p]=d===p?1:0,b[d][p]=e.get1(p,d);for(d=0;d<50;++d){for(t=0,c=0;c<f-1;++c)for(h=c+1;h<f;++h)t+=Math.abs(b[c][h]);if(0===t)break;for(l=d<3?.2*t/x:0,c=0;c<f-1;++c)for(h=c+1;h<f;++h)if(u=100*Math.abs(b[c][h]),d>3&&Math.abs(g[c])+u===Math.abs(g[c])&&Math.abs(g[h])+u===Math.abs(g[h]))b[c][h]=0;else if(Math.abs(b[c][h])>l){for(a=g[h]-g[c],Math.abs(a)+u===Math.abs(a)?o=b[c][h]/a:(n=.5*a/b[c][h],o=1/(Math.abs(n)+Math.sqrt(1+n*n)),n<0&&(o=-o)),s=(r=o*(i=1/Math.sqrt(1+o*o)))/(1+i),a=o*b[c][h],y[c]-=a,y[h]+=a,g[c]-=a,g[h]+=a,b[c][h]=0,p=0;p<c;++p)u=b[p][c],a=b[p][h],b[p][c]=u-r*(a+u*s),b[p][h]=a+r*(u-a*s);for(p=c+1;p<h;++p)u=b[c][p],a=b[p][h],b[c][p]=u-r*(a+u*s),b[p][h]=a+r*(u-a*s);for(p=h+1;p<f;++p)u=b[c][p],a=b[h][p],b[c][p]=u-r*(a+u*s),b[h][p]=a+r*(u-a*s);for(p=0;p<f;++p)u=m[p][c],a=m[p][h],m[p][c]=u-r*(a+u*s),m[p][h]=a+r*(u-a*s)}for(c=0;c<f;++c)g[c]=w[c]+=y[c],y[c]=0}return{values:g,vectors:m}}}),define("standard/Math/Numbers/Matrix3",["jquery","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix2","standard/Math/Algorithms/eigendecomposition"],function(e,t,n,i,r){function o(){arguments.length?(this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3],this[4]=arguments[4],this[5]=arguments[5],this[6]=arguments[6],this[7]=arguments[7],this[8]=arguments[8]):this.identity()}var s=new t(0,0),a=new n(0,0,0),u=new t(0,0),l=new n(0,0,0),c=new t(0,0),h=new i,d=new i,p=new i,f=new i,g=new t(0,0),m=new i;return o.prototype={constructor:o,order:3,length:9,copy:function(){var e=Object.create(o.prototype);return e[0]=this[0],e[1]=this[1],e[2]=this[2],e[3]=this[3],e[4]=this[4],e[5]=this[5],e[6]=this[6],e[7]=this[7],e[8]=this[8],e},assign:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this},equals:function(e){return this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2]&&this[3]===e[3]&&this[4]===e[4]&&this[5]===e[5]&&this[6]===e[6]&&this[7]===e[7]&&this[8]===e[8]},rotation:function(){return math.atan2(this[1],this[0])},set1:function(e,t,n){return this[e*this.order+t]=n,this},get1:function(e,t){return this[e*this.order+t]},set:function(e,n,i,r,o){switch(arguments.length){case 0:this.identity();break;case 1:null===e&&(e=t.Zero),this.identity(),this.translate(e);break;case 2:null===e&&(e=t.Zero),null===n&&(n=0),this.identity(),this.translate(e),0!==n&&this.rotate(n);break;case 3:null===e&&(e=t.Zero),null===n&&(n=0),null===i&&(i=t.One),this.identity(),this.translate(e),0!==n&&this.rotate(n),i.equals(t.One)||this.scale(i);break;case 4:null===e&&(e=t.Zero),null===n&&(n=0),null===i&&(i=t.One),null===r&&(r=0),this.identity(),this.translate(e),0!==n&&this.rotate(n),i.equals(t.One)||(0!==r?(this.rotate(r),this.scale(i),this.rotate(-r)):this.scale(i));break;case 5:null===e&&(e=t.Zero),null===n&&(n=0),null===i&&(i=t.One),null===r&&(r=0),null===o&&(o=t.Zero),this.identity(),this.translate(e);var s=!o.equals(t.Zero);s&&this.translate(o),0!==n&&this.rotate(n),i.equals(t.One)||(0!==r?(this.rotate(r),this.scale(i),this.rotate(-r)):this.scale(i)),s&&this.translate(t.negate(o));break;case 9:this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3],this[4]=arguments[4],this[5]=arguments[5],this[6]=arguments[6],this[7]=arguments[7],this[8]=arguments[8]}return this},get:function(e,t,n,i,r){switch(null===e&&(e=s),null===t&&(t=a),null===n&&(n=u),null===i&&(i=l),null===r&&(r=c),arguments.length){case 1:e.set(this[6],this[7]);break;case 2:this.factor(e,p,u,f),t[0]=p[0],t[1]=p[1],t[2]=Math.atan2(p[1],p[0]);break;case 3:this.factor(e,p,n,f),t[0]=p[0],t[1]=p[1],t[2]=Math.atan2(p[1],p[0]);break;case 4:this.factor(e,p,n,f),t[0]=p[0],t[1]=p[1],t[2]=Math.atan2(p[1],p[0]),i[0]=f[0],i[1]=f[1],i[2]=Math.atan2(f[1],f[0]);break;case 5:var h=new o;h.set(g.assign(r).negate()),h.multLeft(this),h.translate(r),h.get(e,t,n,i)}},factor:function(e,t,n,i){e.set(this[6],this[7]);var o=this.submatrix,s=o.determinant(),a=s<0?-1:1;if(0===s)return!1;m.assign(o).transpose().multLeft(o);var u=r(m);return i.set(u.vectors[0][0],u.vectors[0][1],u.vectors[1][0],u.vectors[1][1]),n.x=a*Math.sqrt(u.values[0]),n.y=a*Math.sqrt(u.values[1]),h[0]=1/n.x,h[3]=1/n.y,t.assign(d.assign(i).multRight(h).transpose().multLeft(i).multRight(o)),i.transpose(),!0},determinant2:function(){return this[0]*this[4]-this[1]*this[3]},determinant:function(){var e=this[0],t=this[1],n=this[2],i=this[3],r=this[4],o=this[5],s=this[6],a=this[7],u=this[8];return e*(r*u-o*a)-t*(i*u-o*s)+n*(i*a-r*s)},transpose:function(){var e;return e=this[1],this[1]=this[3],this[3]=e,e=this[2],this[2]=this[6],this[6]=e,e=this[5],this[5]=this[7],this[7]=e,this},inverse:function(){var e=this[0],t=this[1],n=this[2],i=this[3],r=this[4],o=this[5],s=this[6],a=this[7],u=this[8],l=e*r,c=e*a,h=i*t,d=i*a,p=s*t,f=s*r,g=l*u-c*o-h*u+d*n+p*o-f*n;if(0===g)throw new Error("Matrix3 .inverse: determinant is 0.");var m=(r*u-a*o)*(g=1/g),b=-(t*u-a*n)*g,w=(t*o-r*n)*g,y=-(i*u-s*o)*g,x=(e*u-s*n)*g,v=-(e*o-i*n)*g;return this[0]=m,this[1]=b,this[2]=w,this[3]=y,this[4]=x,this[5]=v,this[6]=(d-f)*g,this[7]=-(c-p)*g,this[8]=(l-h)*g,this},multLeft:function(e){var t=this[0],n=this[1],i=this[2],r=this[3],o=this[4],s=this[5],a=this[6],u=this[7],l=this[8],c=e[0],h=e[1],d=e[2],p=e[3],f=e[4],g=e[5],m=e[6],b=e[7],w=e[8];return this[0]=t*c+r*h+a*d,this[1]=n*c+o*h+u*d,this[2]=i*c+s*h+l*d,this[3]=t*p+r*f+a*g,this[4]=n*p+o*f+u*g,this[5]=i*p+s*f+l*g,this[6]=t*m+r*b+a*w,this[7]=n*m+o*b+u*w,this[8]=i*m+s*b+l*w,this},multRight:function(e){var t=this[0],n=this[1],i=this[2],r=this[3],o=this[4],s=this[5],a=this[6],u=this[7],l=this[8],c=e[0],h=e[1],d=e[2],p=e[3],f=e[4],g=e[5],m=e[6],b=e[7],w=e[8];return this[0]=t*c+n*p+i*m,this[1]=t*h+n*f+i*b,this[2]=t*d+n*g+i*w,this[3]=r*c+o*p+s*m,this[4]=r*h+o*f+s*b,this[5]=r*d+o*g+s*w,this[6]=a*c+u*p+l*m,this[7]=a*h+u*f+l*b,this[8]=a*d+u*g+l*w,this},multVecMatrix:function(e){if(2===e.length){var t=e.x,n=e.y,i=t*this[2]+n*this[5]+this[8];return e.x=(t*this[0]+n*this[3]+this[6])/i,e.y=(t*this[1]+n*this[4]+this[7])/i,e}var t=e.x,n=e.y,r=e.z;return e.x=t*this[0]+n*this[3]+r*this[6],e.y=t*this[1]+n*this[4]+r*this[7],e.z=t*this[2]+n*this[5]+r*this[8],e},multMatrixVec:function(e){if(2===e.length){var t=e.x,n=e.y,i=t*this[6]+n*this[7]+this[8];return e.x=(t*this[0]+n*this[1]+this[2])/i,e.y=(t*this[3]+n*this[4]+this[5])/i,e}var t=e.x,n=e.y,r=e.z;return e.x=t*this[0]+n*this[1]+r*this[2],e.y=t*this[3]+n*this[4]+r*this[5],e.z=t*this[6]+n*this[7]+r*this[8],e},multDirMatrix:function(e){var t=e.x,n=e.y;return e.x=t*this[0]+n*this[3],e.y=t*this[1]+n*this[4],e},multMatrixDir:function(e){var t=e.x,n=e.y;return e.x=t*this[0]+n*this[1],e.y=t*this[3]+n*this[4],e},identity:function(){this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=1,this[5]=0,this[6]=0,this[7]=0,this[8]=1},translate:function(e){var t=e.x,n=e.y;return this[6]+=this[0]*t+this[3]*n,this[7]+=this[1]*t+this[4]*n,this},rotate:function(e){return this.multLeft(o.Rotation(e)),this},scale:function(e){var t=e.x,n=e.y;return this[0]*=t,this[3]*=n,this[1]*=t,this[4]*=n,this},toString:function(){return this[0]+" "+this[1]+" "+this[2]+" "+this[3]+" "+this[4]+" "+this[5]+" "+this[6]+" "+this[7]+" "+this[8]}},Object.defineProperty(o.prototype,"x",{get:function(){return new t(this[0],this[1])},enumerable:!1,configurable:!1}),Object.defineProperty(o.prototype,"y",{get:function(){return new t(this[3],this[4])},enumerable:!1,configurable:!1}),Object.defineProperty(o.prototype,"origin",{get:function(){return new t(this[6],this[7])},enumerable:!1,configurable:!1}),Object.defineProperty(o.prototype,"submatrix",{get:function(){var e=Object.create(i.prototype);return e[0]=this[0],e[1]=this[1],e[2]=this[3],e[3]=this[4],e},enumerable:!1,configurable:!1}),e.extend(o,{Identity:new o,Rotation:function(e){var t=Math.sin(e),n=Math.cos(e);return new o(n,t,0,-t,n,0,0,0,1)},Matrix2:function(e){return new o(e[0],e[1],0,e[2],e[3],0,0,0,1)},transpose:function(e){var t=Object.create(this.prototype);return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t},inverse:function(e){var t=Object.create(this.prototype),n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],l=e[7],c=e[8],h=n*s,d=n*l,p=o*i,f=o*l,g=u*i,m=u*s,b=h*c-d*a-p*c+f*r+g*a-m*r;if(0===b)throw new Error("Matrix3 .inverse: determinant is 0.");var w=(s*c-l*a)*(b=1/b),y=-(i*c-l*r)*b,x=(i*a-s*r)*b,v=-(o*c-u*a)*b,_=(n*c-u*r)*b,S=-(n*a-o*r)*b;return t[0]=w,t[1]=y,t[2]=x,t[3]=v,t[4]=_,t[5]=S,t[6]=(f-m)*b,t[7]=-(d-g)*b,t[8]=(h-p)*b,t},multLeft:function(e,t){var n=Object.create(this.prototype),i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=t[0],p=t[1],f=t[2],g=t[3],m=t[4],b=t[5],w=t[6],y=t[7],x=t[8];return n[0]=i*d+s*p+l*f,n[1]=r*d+a*p+c*f,n[2]=o*d+u*p+h*f,n[3]=i*g+s*m+l*b,n[4]=r*g+a*m+c*b,n[5]=o*g+u*m+h*b,n[6]=i*w+s*y+l*x,n[7]=r*w+a*y+c*x,n[8]=o*w+u*y+h*x,n},multRight:function(e,t){var n=Object.create(this.prototype),i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=t[0],p=t[1],f=t[2],g=t[3],m=t[4],b=t[5],w=t[6],y=t[7],x=t[8];return n[0]=i*d+r*g+o*w,n[1]=i*p+r*m+o*y,n[2]=i*f+r*b+o*x,n[3]=s*d+a*g+u*w,n[4]=s*p+a*m+u*y,n[5]=s*f+a*b+u*x,n[6]=l*d+c*g+h*w,n[7]=l*p+c*m+h*y,n[8]=l*f+c*b+h*x,n}}),o}),define("cobweb/Fields/SFMatrix3",["jquery","cobweb/Basic/X3DField","cobweb/Fields/SFMatrixPrototypeTemplate","cobweb/Fields/SFVec2","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix3"],function(e,t,n,i,r,o){function s(i,r,s){function a(e,n,i,r,s,a,u,l,c){return arguments.length?arguments[0]instanceof o?t.call(this,arguments[0]):t.call(this,new o(+e,+n,+i,+r,+s,+a,+u,+l,+c)):t.call(this,new o)}a.prototype=e.extend(Object.create(t.prototype),n(o,s),{constructor:a,getTypeName:function(){return i},getType:function(){return r},setTransform:function(e,t,n,i,r){e=e?e.getValue():null,t=t||0,n=n?n.getValue():null,i=i||0,r=r?r.getValue():null,this.getValue().set(e,t,n,i,r)}});for(var u=0;u<o.prototype.length;++u)!function(e){Object.defineProperty(a.prototype,e,{get:function(){return this.getValue()[e]},set:function(t){this.getValue()[e]=t,this.addEvent()},enumerable:!1,configurable:!1})}(u);return a}return{SFMatrix3d:s("SFMatrix3d",r.SFMatrix3d,i.SFVec2d),SFMatrix3f:s("SFMatrix3f",r.SFMatrix3f,i.SFVec2f)}}),define("cobweb/Fields/SFVec3",["jquery","cobweb/Basic/X3DField","cobweb/Fields/SFVecPrototypeTemplate","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r){function o(i,o){function s(e,n,i){return arguments.length?arguments[0]instanceof r?t.call(this,arguments[0]):t.call(this,new r(+e,+n,+i)):t.call(this,new r(0,0,0))}s.prototype=e.extend(Object.create(t.prototype),n(r),{constructor:s,getTypeName:function(){return i},getType:function(){return o},cross:function(e){return new this.constructor(r.cross(this.getValue(),e.getValue()))}});var a={get:function(){return this.getValue().x},set:function(e){this.getValue().x=e,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().y},set:function(e){this.getValue().y=e,this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().z},set:function(e){this.getValue().z=e,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",a),Object.defineProperty(s.prototype,"y",u),Object.defineProperty(s.prototype,"z",l),a.enumerable=!1,u.enumerable=!1,l.enumerable=!1,Object.defineProperty(s.prototype,"0",a),Object.defineProperty(s.prototype,"1",u),Object.defineProperty(s.prototype,"2",l),s}return{SFVec3d:o("SFVec3d",i.SFVec3d),SFVec3f:o("SFVec3f",i.SFVec3f)}}),define("standard/Math/Numbers/Vector4",["jquery","standard/Math/Algorithm"],function(e,t){function n(e,t,n,i){this.x=e,this.y=t,this.z=n,this.w=i}return n.prototype={constructor:n,length:4,copy:function(){var e=Object.create(n.prototype);return e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w,e},assign:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},equals:function(e){return this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},subtract:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},multiply:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},multVec:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},divide:function(e){return this.x/=e,this.y/=e,this.z/=e,this.w/=e,this},divVec:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return e&&(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},norm:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},abs:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},distance:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z,r=this.w-e.w;return Math.sqrt(t*t+n*n+i*i+r*r)},lerp:function(e,t){return this.x=this.x+t*(e.x-this.x),this.y=this.y+t*(e.y-this.y),this.z=this.z+t*(e.z-this.z),this.w=this.w+t*(e.w-this.w),this},min:function(e){for(var t=0,n=arguments.length;t<n;++t){var e=arguments[t];this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w)}return this},max:function(e){for(var t=0,n=arguments.length;t<n;++t){var e=arguments[t];this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w)}return this},toString:function(){return this.x+" "+this.y+" "+this.z+" "+this.w}},Object.defineProperty(n.prototype,"0",{get:function(){return this.x},set:function(e){this.x=e},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"1",{get:function(){return this.y},set:function(e){this.y=e},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"2",{get:function(){return this.z},set:function(e){this.z=e},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"3",{get:function(){return this.w},set:function(e){this.w=e},enumerable:!1,configurable:!1}),e.extend(n,{Zero:new n(0,0,0,0),One:new n(1,1,1,1),negate:function(e){var t=Object.create(this.prototype);return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},add:function(e,t){var n=Object.create(this.prototype);return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},subtract:function(e,t){var n=Object.create(this.prototype);return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},multiply:function(e,t){var n=Object.create(this.prototype);return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},multVec:function(e,t){var n=Object.create(this.prototype);return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},divide:function(e,t){var n=Object.create(this.prototype);return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},divVec:function(e,t){var n=Object.create(this.prototype);return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},normalize:function(e){var t=Object.create(this.prototype),n=e.x,i=e.y,r=e.z,o=e.w,s=Math.sqrt(n*n+i*i+r*r+o*o);return s?(s=1/s,t.x=n*s,t.y=i*s,t.z=r*s,t.w=o*s):(t.x=0,t.y=0,t.z=0,t.w=0),t},dot:function(e,t){return e.dot(t)},lerp:function(e,i,r){return new n(t.lerp(e.x,i.x,r),t.lerp(e.y,i.y,r),t.lerp(e.z,i.z,r),t.lerp(e.w,i.w,r))},min:function(e,t){for(var i=e.x,r=e.y,o=e.z,s=e.w,a=1,u=arguments.length;a<u;++a){var l=arguments[a];i=Math.min(i,l.x),r=Math.min(r,l.y),o=Math.min(o,l.z),s=Math.min(s,l.w)}return new n(i,r,o,s)},max:function(e,t){for(var i=e.x,r=e.y,o=e.z,s=e.w,a=1,u=arguments.length;a<u;++a){var l=arguments[a];i=Math.max(i,l.x),r=Math.max(r,l.y),o=Math.max(o,l.z),s=Math.max(s,l.w)}return new n(i,r,o,s)}}),n}),define("standard/Math/Numbers/Quaternion",["jquery","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(t,n,i){function r(e,t,n,i){this.x=e,this.y=t,this.z=n,this.w=i}var o=new n(0,0,0);r.prototype={constructor:r,length:4,copy:function(){var e=Object.create(r.prototype);return e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w,e},assign:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setMatrix:function(e){var t;t=e[0]>e[4]?e[0]>e[8]?0:2:e[4]>e[8]?1:2;var n=e[0]+e[4]+e[8];if(n>e[3*t+t]){this[3]=Math.sqrt(n+1)/2;o=4*this[3];this[0]=(e[5]-e[7])/o,this[1]=(e[6]-e[2])/o,this[2]=(e[1]-e[3])/o}else{var i=(t+1)%3,r=(t+2)%3;this[t]=Math.sqrt(e[3*t+t]-e[3*i+i]-e[3*r+r]+1)/2;var o=4*this[t];this[i]=(e[3*t+i]+e[3*i+t])/o,this[r]=(e[3*t+r]+e[3*r+t])/o,this[3]=(e[3*i+r]-e[3*r+i])/o}return this},getMatrix:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,o=t*t,s=t*n,a=n*n,u=n*i,l=i*t,c=i*i,h=r*t,d=r*n,p=r*i;return e[0]=1-2*(a+c),e[1]=2*(s+p),e[2]=2*(l-d),e[3]=2*(s-p),e[4]=1-2*(c+o),e[5]=2*(u+h),e[6]=2*(l+d),e[7]=2*(u-h),e[8]=1-2*(a+o),e},isReal:function(){return!(this.x||this.y||this.z)},isImag:function(){return!this.w},equals:function(e){return this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},inverse:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},subtract:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},multiply:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},multLeft:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,o=e.x,s=e.y,a=e.z,u=e.w;return this.x=r*o+t*u+n*a-i*s,this.y=r*s+n*u+i*o-t*a,this.z=r*a+i*u+t*s-n*o,this.w=r*u-t*o-n*s-i*a,this},multRight:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,o=e.x,s=e.y,a=e.z,u=e.w;return this.x=u*t+o*r+s*i-a*n,this.y=u*n+s*r+a*t-o*i,this.z=u*i+a*r+o*n-s*t,this.w=u*r-o*t-s*n-a*i,this},divide:function(e){return this.x/=e,this.y/=e,this.z/=e,this.w/=e,this},multVecQuat:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,o=e.x,s=e.y,a=e.z,u=r*r-t*t-n*n-i*i,l=2*(o*t+s*n+a*i),c=2*r;return e.x=u*o+l*t+c*(n*a-i*s),e.y=u*s+l*n+c*(i*o-t*a),e.z=u*a+l*i+c*(t*s-n*o),e},multQuatVec:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,o=e.x,s=e.y,a=e.z,u=r*r-t*t-n*n-i*i,l=2*(o*t+s*n+a*i),c=2*r;return e.x=u*o+l*t-c*(n*a-i*s),e.y=u*s+l*n-c*(i*o-t*a),e.z=u*a+l*i-c*(t*s-n*o),e},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return e&&(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},norm:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},abs:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},pow:function(t){if(t instanceof r)return this.assign(e.assign(t).multRight(this.log()).exp());if(this.isReal())return this.set(0,0,0,Math.pow(this.w,t));var n=this.abs(),i=Math.acos(this.w/n),o=this.imag.abs(),s=Math.pow(n,t),a=t*i,u=s/o*Math.sin(a);return this.x*=u,this.y*=u,this.z*=u,this.w=s*Math.cos(a),this},log:function(){if(this.isReal())return this.w>0?this.set(0,0,0,Math.log(this.w)):this.set(Math.PI,0,0,Math.log(-this.w));var e=this.abs(),t=this.imag.normalize().multiply(Math.acos(this.w/e)),n=Math.log(e);return this.x=t.x,this.y=t.y,this.z=t.z,this.w=n,this},exp:function(){if(this.isReal())return this.set(0,0,0,Math.exp(this.w));var e=this.imag,t=e.abs(),n=Math.exp(this.w),i=n*Math.cos(t),r=e.multiply(n*Math.sin(t)/t);return this.x=r.x,this.y=r.y,this.z=r.z,this.w=i,this},slerp:function(e,t){return i.slerp(this,s.assign(e),t)},squad:function(e,t,n,r){return i.slerp(i.slerp(this,s.assign(n),r),i.slerp(a.assign(e),u.assign(t),r),2*r*(1-r))},toString:function(){return this.x+" "+this.y+" "+this.z+" "+this.w}},Object.defineProperty(r.prototype,"0",{get:function(){return this.x},set:function(e){this.x=e},enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"1",{get:function(){return this.y},set:function(e){this.y=e},enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"2",{get:function(){return this.z},set:function(e){this.z=e},enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"3",{get:function(){return this.w},set:function(e){this.w=e},enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"real",{get:function(){return this.w},enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"imag",{get:function(){return o.set(this.x,this.y,this.z)},enumerable:!1,configurable:!1}),t.extend(r,{negate:function(e){var t=Object.create(this.prototype);return t.x=-this.x,t.y=-this.y,t.z=-this.z,t.w=-this.w,t},inverse:function(e){var t=Object.create(this.prototype);return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},add:function(e,t){var n=Object.create(this.prototype);return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},subtract:function(e,t){var n=Object.create(this.prototype);return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},multiply:function(e,t){var n=Object.create(this.prototype);return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},multLeft:function(e,t){var n=Object.create(this.prototype),i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,u=t.y,l=t.z,c=t.w;return n.x=s*a+i*c+r*l-o*u,n.y=s*u+r*c+o*a-i*l,n.z=s*l+o*c+i*u-r*a,n.w=s*c-i*a-r*u-o*l,n},multRight:function(e,t){var n=Object.create(this.prototype),i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,u=t.y,l=t.z,c=t.w;return n.x=c*i+a*s+u*o-l*r,n.y=c*r+u*s+l*i-a*o,n.z=c*o+l*s+a*r-u*i,n.w=c*s-a*i-u*r-l*o,n},divide:function(e,t){var n=Object.create(this.prototype);return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},normalize:function(e){var t=Object.create(this.prototype),n=e.x,i=e.y,r=e.z,o=e.w,s=Math.sqrt(n*n+i*i+r*r+o*o);return s?(s=1/s,t.x=n*s,t.y=i*s,t.z=r*s,t.w=o*s):(t.x=0,t.y=0,t.z=0,t.w=0),t},slerp:function(e,t,n){return i.slerp(e.copy(),a.assign(t),n)},squad:function(e,t,n,r,o){return i.slerp(i.slerp(e.copy(),s.assign(r),o),i.slerp(a.assign(t),u.assign(n),o),2*o*(1-o))},spline:function(e,t,n){return l.assign(e),c.assign(t),h.assign(n),l.dot(c)<0&&l.negate(),h.dot(c)<0&&h.negate(),d.assign(c).inverse(),c.multRight(s.assign(d).multRight(l).log().add(a.assign(d).multRight(h).log()).divide(-4).exp()).normalize().copy()}});var s=new r(0,0,0,1),a=new r(0,0,0,1),u=new r(0,0,0,1),l=new r(0,0,0,1),c=new r(0,0,0,1),h=new r(0,0,0,1),d=new r(0,0,0,1);return r}),define("standard/Math/Numbers/Rotation4",["jquery","standard/Math/Numbers/Quaternion","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Algorithm"],function(e,t,n,i,r){function o(e,i,r,o){switch(arguments.length){case 0:return void(this.value=new t(0,0,0,1));case 1:return void(this.value=arguments[0]);case 2:var s=arguments[0],a=arguments[1];return this.value=new t(0,0,0,1),a instanceof n?this.setFromToVec(s,a):void this.set(s.x,s.y,s.z,a);case 4:return this.value=new t(0,0,0,1),void this.set(e,i,r,o)}}var s=new n(1,0,0),a=new n(0,1,0),u=new n(0,0,1),l=new n(0,0,0),c=new n(0,0,0),h=new n(0,0,0),d=new n(0,0,0),p=new i(0,0,1,0),f=new i(0,0,0,0);o.prototype={constructor:o,length:4,copy:function(){var e=Object.create(o.prototype);return e.value=this.value.copy(),e},assign:function(e){return this.value.assign(e.value),this},set:function(e,t,n,i){if(0===(s=Math.sqrt(e*e+t*t+n*n)))return this.value.set(0,0,0,1),this;var o=r.interval(i/2,0,Math.PI),s=Math.sin(o)/s;return this.value.set(e*s,t*s,n*s,Math.cos(o)),this},get:function(){var e=this.value;if(Math.abs(e.w)>=1)return p;var t=e.imag.normalize();return f.set(t.x,t.y,t.z,2*Math.acos(e.w))},setAxisAngle:function(e,t){return this.set(e.x,e.y,e.z,t)},setFromToVec:function(e,t){l.assign(e).normalize(),c.assign(t).normalize();var n=r.clamp(l.dot(c),-1,1),i=h.assign(l).cross(c).normalize();return 0===i.abs()?n>0?this.value.set(0,0,0,1):(d.assign(l).cross(s),0===d.norm()&&d.assign(l).cross(a),d.normalize(),this.value.set(d.x,d.y,d.z,0)):(i.multiply(Math.sqrt(Math.abs(1-n)/2)),this.value.set(i.x,i.y,i.z,Math.sqrt((1+n)/2))),this},setAxis:function(e){this.set(e.x,e.y,e.z,this.angle)},getAxis:function(){return Math.abs(this.value.w)>=1?u:this.value.imag.normalize()},setMatrix:function(e){return this.value.setMatrix(e).normalize(),this},getMatrix:function(e){return this.value.getMatrix(e)},equals:function(e){return this.value.equals(e.value)},inverse:function(){return this.value.inverse(),this},multLeft:function(e){return this.value.multLeft(e.value).normalize(),this},multRight:function(e){return this.value.multRight(e.value).normalize(),this},multVecRot:function(e){return this.value.multVecQuat(e)},multRotVec:function(e){return this.value.multQuatVec(e)},slerp:function(e,t){return this.value.slerp(e.value,t),this},squad:function(e,t,n,i){return this.value.squad(e.value,t.value,n.value,i),this},toString:function(){var e=this.get();return e.x+" "+e.y+" "+e.z+" "+e.w}};var g={get:function(){return this.getAxis().x},set:function(e){var t=this.get();this.set(e,t[1],t[2],t[3])},enumerable:!0,configurable:!1},m={get:function(){return this.getAxis().y},set:function(e){var t=this.get();this.set(t[0],e,t[2],t[3])},enumerable:!0,configurable:!1},b={get:function(){return this.getAxis().z},set:function(e){var t=this.get();this.set(t[0],t[1],e,t[3])},enumerable:!0,configurable:!1},w={get:function(){return Math.abs(this.value.w)>=1?0:2*Math.acos(this.value.w)},set:function(e){var t=this.getAxis();this.set(t.x,t.y,t.z,e)},enumerable:!0,configurable:!1};return Object.defineProperty(o.prototype,"x",g),Object.defineProperty(o.prototype,"y",m),Object.defineProperty(o.prototype,"z",b),Object.defineProperty(o.prototype,"angle",w),g.enumerable=!1,m.enumerable=!1,b.enumerable=!1,w.enumerable=!1,Object.defineProperty(o.prototype,"0",g),Object.defineProperty(o.prototype,"1",m),Object.defineProperty(o.prototype,"2",b),Object.defineProperty(o.prototype,"3",w),e.extend(o,{Identity:new o,inverse:function(e){var n=Object.create(this.prototype);return n.value=t.inverse(e.value),n},multRight:function(e,n){var i=Object.create(this.prototype);return i.value=t.multRight(e.value,n.value),i},slerp:function(e,n,i){var r=Object.create(this.prototype);return r.value=t.slerp(e.value,n.value,i),r},squad:function(e,n,i,r,o){var s=Object.create(this.prototype);return s.value=t.squad(e.value,n,i,r.value,o),s},bezier:function(e,n,i,r,o){var s=Object.create(this.prototype);return s.value=t.bezier(e.value,n,i,r.value,o),s},spline:function(e,n,i){var r=Object.create(this.prototype);return r.value=t.spline(e.value,n.value,i.value),r}}),o}),define("standard/Math/Numbers/Matrix4",["jquery","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix3","standard/Math/Algorithms/eigendecomposition"],function(e,t,n,i,r,o){function s(){arguments.length?(this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3],this[4]=arguments[4],this[5]=arguments[5],this[6]=arguments[6],this[7]=arguments[7],this[8]=arguments[8],this[9]=arguments[9],this[10]=arguments[10],this[11]=arguments[11],this[12]=arguments[12],this[13]=arguments[13],this[14]=arguments[14],this[15]=arguments[15]):this.identity()}var a=new t(0,0,0),u=new i,l=new t(0,0,0),c=new i,h=new t(0,0,0),d=new r,p=new r,f=new r,g=new r,m=new t(0,0,0),b=new r;s.prototype={constructor:s,order:4,length:16,copy:function(){var e=Object.create(s.prototype);return e[0]=this[0],e[1]=this[1],e[2]=this[2],e[3]=this[3],e[4]=this[4],e[5]=this[5],e[6]=this[6],e[7]=this[7],e[8]=this[8],e[9]=this[9],e[10]=this[10],e[11]=this[11],e[12]=this[12],e[13]=this[13],e[14]=this[14],e[15]=this[15],e},assign:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this},equals:function(e){return this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2]&&this[3]===e[3]&&this[4]===e[4]&&this[5]===e[5]&&this[6]===e[6]&&this[7]===e[7]&&this[8]===e[8]&&this[9]===e[9]&&this[10]===e[10]&&this[11]===e[11]&&this[12]===e[12]&&this[13]===e[13]&&this[14]===e[14]&&this[15]===e[15]},set1:function(e,t,n){return this[e*this.order+t]=n,this},get1:function(e,t){return this[e*this.order+t]},set:function(e,n,r,o,s){switch(arguments.length){case 0:this.identity();break;case 1:null===e&&(e=t.Zero),this.identity(),this.translate(e);break;case 2:null===e&&(e=t.Zero),null===n&&(n=i.Identity),this.identity(),this.translate(e),n.equals(i.Identity)||this.rotate(n);break;case 3:null===e&&(e=t.Zero),null===n&&(n=i.Identity),null===r&&(r=t.One),this.identity(),this.translate(e),n.equals(i.Identity)||this.rotate(n),r.equals(t.One)||this.scale(r);break;case 4:null===e&&(e=t.Zero),null===n&&(n=i.Identity),null===r&&(r=t.One),null===o&&(o=i.Identity),this.identity(),this.translate(e),n.equals(i.Identity)||this.rotate(n),r.equals(t.One)||(!o.equals(i.Identity)?(this.rotate(o),this.scale(r),this.rotate(i.inverse(o))):this.scale(r));break;case 5:null===e&&(e=t.Zero),null===n&&(n=i.Identity),null===r&&(r=t.One),null===o&&(o=i.Identity),null===s&&(s=t.Zero),this.identity(),this.translate(e);var a=!s.equals(t.Zero);a&&this.translate(s),n.equals(i.Identity)||this.rotate(n),r.equals(t.One)||(o.equals(i.Identity)?this.scale(r):(this.rotate(o),this.scale(r),this.rotate(i.inverse(o)))),a&&this.translate(t.negate(s));break;case 16:this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3],this[4]=arguments[4],this[5]=arguments[5],this[6]=arguments[6],this[7]=arguments[7],this[8]=arguments[8],this[9]=arguments[9],this[10]=arguments[10],this[11]=arguments[11],this[12]=arguments[12],this[13]=arguments[13],this[14]=arguments[14],this[15]=arguments[15]}return this},get:function(e,t,n,i,r){switch(null===e&&(e=a),null===t&&(t=u),null===n&&(n=l),null===i&&(i=c),null===r&&(r=h),arguments.length){case 1:e.set(this[12],this[13],this[14]);break;case 2:this.factor(e,d,l,p),t.setMatrix(d);break;case 3:this.factor(e,d,n,p),t.setMatrix(d);break;case 4:this.factor(e,d,n,p),t.setMatrix(d),i.setMatrix(p);break;case 5:var o=new s;o.set(m.assign(r).negate()),o.multLeft(this),o.translate(r),o.get(e,t,n,i)}},setRotation:function(e){return this.setQuaternion(e.value)},setQuaternion:function(e){var t=e.x,n=e.y,i=e.z,r=e.w,o=n*n,s=i*i,a=t*n,u=i*r,l=i*t,c=n*r,h=t*t,d=n*i,p=t*r;return this[0]=1-2*(o+s),this[1]=2*(a+u),this[2]=2*(l-c),this[3]=0,this[4]=2*(a-u),this[5]=1-2*(s+h),this[6]=2*(d+p),this[7]=0,this[8]=2*(l+c),this[9]=2*(d-p),this[10]=1-2*(o+h),this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},factor:function(e,t,n,i){e.set(this[12],this[13],this[14]);var r=this.submatrix,s=r.determinant(),a=s<0?-1:1;if(0===s)return!1;b.assign(r).transpose().multLeft(r);var u=o(b);return i.set(u.vectors[0][0],u.vectors[0][1],u.vectors[0][2],u.vectors[1][0],u.vectors[1][1],u.vectors[1][2],u.vectors[2][0],u.vectors[2][1],u.vectors[2][2]),n.x=a*Math.sqrt(u.values[0]),n.y=a*Math.sqrt(u.values[1]),n.z=a*Math.sqrt(u.values[2]),f[0]=1/n.x,f[4]=1/n.y,f[8]=1/n.z,t.assign(g.assign(i).multRight(f).transpose().multLeft(i).multRight(r)),i.transpose(),!0},determinant3:function(){var e=this[0],t=this[1],n=this[2],i=this[4],r=this[5],o=this[6],s=this[8],a=this[9],u=this[10];return e*(r*u-o*a)-t*(i*u-o*s)+n*(i*a-r*s)},determinant:function(){var e=this[0],t=this[1],n=this[2],i=this[3],r=this[4],o=this[5],s=this[6],a=this[7],u=this[8],l=this[9],c=this[10],h=this[11],d=this[12],p=this[13],f=this[14],g=this[15],m=c*g,b=f*h,w=s*g,y=f*a,x=s*h,v=c*a,_=n*g,S=f*i,C=n*h,F=c*i,T=n*a,N=s*i;return e*(m*o+y*l+x*p-b*o-w*l-v*p)+r*(b*t+_*l+F*p-m*t-S*l-C*p)+u*(w*t+S*o+T*p-y*t-_*o-N*p)+d*(v*t+C*o+N*l-x*t-F*o-T*l)},transpose:function(){var e;return e=this[1],this[1]=this[4],this[1]=e,e=this[2],this[2]=this[8],this[2]=e,e=this[3],this[3]=this[12],this[3]=e,e=this[6],this[6]=this[9],this[6]=e,e=this[7],this[7]=this[13],this[7]=e,e=this[11],this[11]=this[14],this[11]=e,this},inverse:function(){var e=this[0],t=this[1],n=this[2],i=this[3],r=this[4],o=this[5],s=this[6],a=this[7],u=this[8],l=this[9],c=this[10],h=this[11],d=this[12],p=this[13],f=this[14],g=this[15],m=c*g,b=f*h,w=s*g,y=f*a,x=s*h,v=c*a,_=n*g,S=f*i,C=n*h,F=c*i,T=n*a,N=s*i,O=u*p,M=d*l,V=r*p,D=d*o,I=r*l,B=u*o,E=e*p,A=d*t,P=e*l,L=u*t,R=e*o,k=r*t,z=m*o+y*l+x*p-(b*o+w*l+v*p),j=b*t+_*l+F*p-(m*t+S*l+C*p),X=w*t+S*o+T*p-(y*t+_*o+N*p),U=v*t+C*o+N*l-(x*t+F*o+T*l),G=e*z+r*j+u*X+d*U;if(0===G)throw new Error("Matrix4 .inverse: determinant is 0.");return G=1/G,this[0]=G*z,this[1]=G*j,this[2]=G*X,this[3]=G*U,this[4]=G*(b*r+w*u+v*d-m*r-y*u-x*d),this[5]=G*(m*e+S*u+C*d-b*e-_*u-F*d),this[6]=G*(y*e+_*r+N*d-w*e-S*r-T*d),this[7]=G*(x*e+F*r+T*u-v*e-C*r-N*u),this[8]=G*(O*a+D*h+I*g-M*a-V*h-B*g),this[9]=G*(M*i+E*h+L*g-O*i-A*h-P*g),this[10]=G*(V*i+A*a+R*g-D*i-E*a-k*g),this[11]=G*(B*i+P*a+k*h-I*i-L*a-R*h),this[12]=G*(V*c+B*f+M*s-I*f-O*s-D*c),this[13]=G*(P*f+O*n+A*c-E*c-L*f-M*n),this[14]=G*(E*s+k*f+D*n-R*f-V*n-A*s),this[15]=G*(R*c+I*n+L*s-P*s-k*c-B*n),this},multLeft:function(e){var t=this[0],n=this[1],i=this[2],r=this[3],o=this[4],s=this[5],a=this[6],u=this[7],l=this[8],c=this[9],h=this[10],d=this[11],p=this[12],f=this[13],g=this[14],m=this[15],b=e[0],w=e[1],y=e[2],x=e[3],v=e[4],_=e[5],S=e[6],C=e[7],F=e[8],T=e[9],N=e[10],O=e[11],M=e[12],V=e[13],D=e[14],I=e[15];return this[0]=t*b+o*w+l*y+p*x,this[1]=n*b+s*w+c*y+f*x,this[2]=i*b+a*w+h*y+g*x,this[3]=r*b+u*w+d*y+m*x,this[4]=t*v+o*_+l*S+p*C,this[5]=n*v+s*_+c*S+f*C,this[6]=i*v+a*_+h*S+g*C,this[7]=r*v+u*_+d*S+m*C,this[8]=t*F+o*T+l*N+p*O,this[9]=n*F+s*T+c*N+f*O,this[10]=i*F+a*T+h*N+g*O,this[11]=r*F+u*T+d*N+m*O,this[12]=t*M+o*V+l*D+p*I,this[13]=n*M+s*V+c*D+f*I,this[14]=i*M+a*V+h*D+g*I,this[15]=r*M+u*V+d*D+m*I,this},multRight:function(e){var t=this[0],n=this[1],i=this[2],r=this[3],o=this[4],s=this[5],a=this[6],u=this[7],l=this[8],c=this[9],h=this[10],d=this[11],p=this[12],f=this[13],g=this[14],m=this[15],b=e[0],w=e[1],y=e[2],x=e[3],v=e[4],_=e[5],S=e[6],C=e[7],F=e[8],T=e[9],N=e[10],O=e[11],M=e[12],V=e[13],D=e[14],I=e[15];return this[0]=t*b+n*v+i*F+r*M,this[1]=t*w+n*_+i*T+r*V,this[2]=t*y+n*S+i*N+r*D,this[3]=t*x+n*C+i*O+r*I,this[4]=o*b+s*v+a*F+u*M,this[5]=o*w+s*_+a*T+u*V,this[6]=o*y+s*S+a*N+u*D,this[7]=o*x+s*C+a*O+u*I,this[8]=l*b+c*v+h*F+d*M,this[9]=l*w+c*_+h*T+d*V,this[10]=l*y+c*S+h*N+d*D,this[11]=l*x+c*C+h*O+d*I,this[12]=p*b+f*v+g*F+m*M,this[13]=p*w+f*_+g*T+m*V,this[14]=p*y+f*S+g*N+m*D,this[15]=p*x+f*C+g*O+m*I,this},multVecMatrix:function(e){if(3===e.length){var t=e.x,n=e.y,i=e.z,r=1/(t*this[3]+n*this[7]+i*this[11]+this[15]);return e.x=(t*this[0]+n*this[4]+i*this[8]+this[12])*r,e.y=(t*this[1]+n*this[5]+i*this[9]+this[13])*r,e.z=(t*this[2]+n*this[6]+i*this[10]+this[14])*r,e}var t=e.x,n=e.y,i=e.z,r=e.w;return e.x=t*this[0]+n*this[4]+i*this[8]+r*this[12],e.y=t*this[1]+n*this[5]+i*this[9]+r*this[13],e.z=t*this[2]+n*this[6]+i*this[10]+r*this[14],e.w=t*this[3]+n*this[7]+i*this[11]+r*this[15],e},multMatrixVec:function(e){if(3===e.length){var t=e.x,n=e.y,i=e.z,r=1/(t*this[12]+n*this[13]+i*this[14]+this[15]);return e.x=(t*this[0]+n*this[1]+i*this[2]+this[3])*r,e.y=(t*this[4]+n*this[5]+i*this[6]+this[7])*r,e.z=(t*this[8]+n*this[9]+i*this[10]+this[11])*r,e}var t=e.x,n=e.y,i=e.z,r=e.w;return e.x=t*this[0]+n*this[1]+i*this[2]+r*this[3],e.y=t*this[4]+n*this[5]+i*this[6]+r*this[7],e.z=t*this[8]+n*this[9]+i*this[10]+r*this[11],e.w=t*this[12]+n*this[13]+i*this[14]+r*this[15],e},multDirMatrix:function(e){var t=e.x,n=e.y,i=e.z;return e.x=t*this[0]+n*this[4]+i*this[8],e.y=t*this[1]+n*this[5]+i*this[9],e.z=t*this[2]+n*this[6]+i*this[10],e},multMatrixDir:function(e){var t=e.x,n=e.y,i=e.z;return e.x=t*this[0]+n*this[1]+i*this[2],e.y=t*this[4]+n*this[5]+i*this[6],e.z=t*this[8]+n*this[9]+i*this[10],e},identity:function(){this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=0,this[5]=1,this[6]=0,this[7]=0,this[8]=0,this[9]=0,this[10]=1,this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1},translate:function(e){var t=e.x,n=e.y,i=e.z;return this[12]+=this[0]*t+this[4]*n+this[8]*i,this[13]+=this[1]*t+this[5]*n+this[9]*i,this[14]+=this[2]*t+this[6]*n+this[10]*i,this},rotate:function(e){return this.multLeft(w.setQuaternion(e.value)),this},scale:function(e){var t=e.x,n=e.y,i=e.z;return this[0]*=t,this[4]*=n,this[8]*=i,this[1]*=t,this[5]*=n,this[9]*=i,this[2]*=t,this[6]*=n,this[10]*=i,this},getDepth:function(e){var t=e.x,n=e.y,i=e.z,r=1/(t*this[3]+n*this[7]+i*this[11]+this[15]);return(t*this[2]+n*this[6]+i*this[10]+this[14])*r},toString:function(){return this[0]+" "+this[1]+" "+this[2]+" "+this[3]+" "+this[4]+" "+this[5]+" "+this[6]+" "+this[7]+" "+this[8]+" "+this[9]+" "+this[10]+" "+this[11]+" "+this[12]+" "+this[13]+" "+this[14]+" "+this[15]}},Object.defineProperty(s.prototype,"x",{get:function(){return new t(this[0],this[1],this[2])},enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"y",{get:function(){return new t(this[4],this[5],this[6])},enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"z",{get:function(){return new t(this[8],this[9],this[10])},enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"origin",{get:function(){return new t(this[12],this[13],this[14])},enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"submatrix",{get:function(){var e=Object.create(r.prototype);return e[0]=this[0],e[1]=this[1],e[2]=this[2],e[3]=this[4],e[4]=this[5],e[5]=this[6],e[6]=this[8],e[7]=this[9],e[8]=this[10],e},enumerable:!1,configurable:!1}),e.extend(s,{Identity:new s,Rotation:function(e){return Object.create(this.prototype).setQuaternion(e.value)},Quaternion:function(e){return Object.create(this.prototype).setQuaternion(e)},Matrix3:function(e){return new s(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1)},transpose:function(e){var t=Object.create(this.prototype);return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t},inverse:function(e){var t=Object.create(this.prototype),n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],l=e[7],c=e[8],h=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],b=e[15],w=d*b,y=m*p,x=u*b,v=m*l,_=u*p,S=d*l,C=r*b,F=m*o,T=r*p,N=d*o,O=r*l,M=u*o,V=c*g,D=f*h,I=s*g,B=f*a,E=s*h,A=c*a,P=n*g,L=f*i,R=n*h,k=c*i,z=n*a,j=s*i,X=w*a+v*h+_*g-(y*a+x*h+S*g),U=y*i+C*h+N*g-(w*i+F*h+T*g),G=x*i+F*a+O*g-(v*i+C*a+M*g),q=S*i+T*a+M*h-(_*i+N*a+O*h),H=n*X+s*U+c*G+f*q;if(0==H)throw new Error("Matrix4 .inverse: determinant is 0.");return H=1/H,t[0]=H*X,t[1]=H*U,t[2]=H*G,t[3]=H*q,t[4]=H*(y*s+x*c+S*f-w*s-v*c-_*f),t[5]=H*(w*n+F*c+T*f-y*n-C*c-N*f),t[6]=H*(v*n+C*s+M*f-x*n-F*s-O*f),t[7]=H*(_*n+N*s+O*c-S*n-T*s-M*c),t[8]=H*(V*l+B*p+E*b-D*l-I*p-A*b),t[9]=H*(D*o+P*p+k*b-V*o-L*p-R*b),t[10]=H*(I*o+L*l+z*b-B*o-P*l-j*b),t[11]=H*(A*o+R*l+j*p-E*o-k*l-z*p),t[12]=H*(I*d+A*m+D*u-E*m-V*u-B*d),t[13]=H*(R*m+V*r+L*d-P*d-k*m-D*r),t[14]=H*(P*u+j*m+B*r-z*m-I*r-L*u),t[15]=H*(z*d+E*r+k*u-R*u-j*d-A*r),t},multLeft:function(e,t){var n=Object.create(this.prototype),i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],b=e[14],w=e[15],y=t[0],x=t[1],v=t[2],_=t[3],S=t[4],C=t[5],F=t[6],T=t[7],N=t[8],O=t[9],M=t[10],V=t[11],D=t[12],I=t[13],B=t[14],E=t[15];return n[0]=i*y+a*x+h*v+g*_,n[1]=r*y+u*x+d*v+m*_,n[2]=o*y+l*x+p*v+b*_,n[3]=s*y+c*x+f*v+w*_,n[4]=i*S+a*C+h*F+g*T,n[5]=r*S+u*C+d*F+m*T,n[6]=o*S+l*C+p*F+b*T,n[7]=s*S+c*C+f*F+w*T,n[8]=i*N+a*O+h*M+g*V,n[9]=r*N+u*O+d*M+m*V,n[10]=o*N+l*O+p*M+b*V,n[11]=s*N+c*O+f*M+w*V,n[12]=i*D+a*I+h*B+g*E,n[13]=r*D+u*I+d*B+m*E,n[14]=o*D+l*I+p*B+b*E,n[15]=s*D+c*I+f*B+w*E,n},multRight:function(e,t){var n=Object.create(this.prototype),i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],b=e[14],w=e[15],y=t[0],x=t[1],v=t[2],_=t[3],S=t[4],C=t[5],F=t[6],T=t[7],N=t[8],O=t[9],M=t[10],V=t[11],D=t[12],I=t[13],B=t[14],E=t[15];return n[0]=i*y+r*S+o*N+s*D,n[1]=i*x+r*C+o*O+s*I,n[2]=i*v+r*F+o*M+s*B,n[3]=i*_+r*T+o*V+s*E,n[4]=a*y+u*S+l*N+c*D,n[5]=a*x+u*C+l*O+c*I,n[6]=a*v+u*F+l*M+c*B,n[7]=a*_+u*T+l*V+c*E,n[8]=h*y+d*S+p*N+f*D,n[9]=h*x+d*C+p*O+f*I,n[10]=h*v+d*F+p*M+f*B,n[11]=h*_+d*T+p*V+f*E,n[12]=g*y+m*S+b*N+w*D,n[13]=g*x+m*C+b*O+w*I,n[14]=g*v+m*F+b*M+w*B,n[15]=g*_+m*T+b*V+w*E,n}});var w=new s;return s}),define("cobweb/Fields/SFMatrix4",["jquery","cobweb/Basic/X3DField","cobweb/Fields/SFMatrixPrototypeTemplate","cobweb/Fields/SFVec3","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o){function s(i,r,s){function a(e,n,i,r,s,a,u,l,c,h,d,p,f,g,m,b){return arguments.length?arguments[0]instanceof o?t.call(this,arguments[0]):t.call(this,new o(+e,+n,+i,+r,+s,+a,+u,+l,+c,+h,+d,+p,+f,+g,+m,+b)):t.call(this,new o)}a.prototype=e.extend(Object.create(t.prototype),n(o,s),{constructor:a,getTypeName:function(){return i},getType:function(){return r}});for(var u=0;u<o.prototype.length;++u)!function(e){Object.defineProperty(a.prototype,e,{get:function(){return this.getValue()[e]},set:function(t){this.getValue()[e]=t,this.addEvent()},enumerable:!1,configurable:!1})}(u);return a}return{SFMatrix4d:s("SFMatrix4d",r.SFMatrix4d,i.SFVec3d),SFMatrix4f:s("SFMatrix4f",r.SFMatrix4f,i.SFVec3f),VrmlMatrix:s("VrmlMatrix",r.VrmlMatrix,i.SFVec3f)}}),define("cobweb/Fields/SFNode",["jquery","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){return this instanceof i?(e?(e.addParent(this),t.call(this,e)):t.call(this,null),new Proxy(this,r)):i.call(Object.create(i.prototype),e)}var r={get:function(e,t){if(t in e)return e[t];try{var i=e.getValue().getField(t);if(i.getAccessType()===n.inputOnly)return;return i.valueOf()}catch(e){return}},set:function(e,t,i){if(t in e)return e[t]=i,!0;try{var r=e.getValue().getField(t);return r.getAccessType()&n.inputOnly&&r.setValue(i),!0}catch(n){return console.error(e,t,n),!1}}};return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,_cloneCount:0,clone:function(){return new i(this.getValue())},copy:function(e){var t=this.getValue();return t?new i(t.copy(e)):new i},getTypeName:function(){return"SFNode"},getType:function(){return n.SFNode},equals:function(e){return e?this.getValue()===e.getValue():null===this.getValue()},isDefaultValue:function(){return null===this.getValue()},set:function(e){var n=this.getValue();n&&(n.removeClones(this._cloneCount),n.removeParent(this)),e?(e.addParent(this),e.addClones(this._cloneCount),t.prototype.set.call(this,e)):t.prototype.set.call(this,null)},getNodeTypeName:function(){var e=this.getValue();if(e)return e.getTypeName();throw new Error("SFNode.getNodeTypeName: node is null.")},getNodeName:function(){var e=this.getValue();if(e)return e.getName();throw new Error("SFNode.getNodeName: node is null.")},getNodeType:function(){var e=this.getValue();if(e)return e.getType().slice();throw new Error("SFNode.getNodeType: node is null.")},getFieldDefinitions:function(){var e=this.getValue();if(e)return e.getFieldDefinitions();throw new Error("SFNode.getFieldDefinitions: node is null.")},addClones:function(e){var t=this.getValue();this._cloneCount+=e,t&&t.addClones(e)},removeClones:function(e){var t=this.getValue();this._cloneCount-=e,t&&t.removeClones(e)},valueOf:function(){return this.getValue()?this:null},toString:function(){var e=this.getValue();return e?e.toString():"NULL"},toVRMLString:function(){var e=this.getValue();return e?e.toVRMLString():"NULL"},toXMLStream:function(e){var t=this.getValue();e.string+=t?t.toXMLString():"NULL"},dispose:function(){this.set(null),t.prototype.dispose.call(this)}}),i}),define("cobweb/Fields/SFRotation",["jquery","cobweb/Fields/SFVec3","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants","standard/Math/Numbers/Rotation4"],function(e,t,n,i,r){function o(e,t,i,a){if(this instanceof o)switch(arguments.length){case 1:return n.call(this,arguments[0]);case 2:return arguments[1]instanceof s?n.call(this,new r(arguments[0].getValue(),arguments[1].getValue())):n.call(this,new r(arguments[0].getValue(),+arguments[1]));case 4:return n.call(this,new r(+e,+t,+i,+a));default:return n.call(this,new r)}return o.apply(Object.create(o.prototype),arguments)}var s=t.SFVec3f;o.prototype=e.extend(Object.create(n.prototype),{constructor:o,copy:function(){return new o(this.getValue().copy())},equals:function(e){return this.getValue().equals(e.getValue())},isDefaultValue:function(){return this.getValue().equals(r.Identity)},getTypeName:function(){return"SFRotation"},getType:function(){return i.SFRotation},set:function(e){this.getValue().assign(e)},setAxis:function(e){this.getValue().setAxis(e.getValue()),this.addEvent()},getAxis:function(){return new s(this.getValue().getAxis().copy())},inverse:function(){return new o(r.inverse(this.getValue()))},multiply:function(e){return new o(r.multRight(this.getValue(),e.getValue()))},multVec:function(e){return new s(this.getValue().multVecRot(e.getValue().copy()))},slerp:function(e,t){return new o(r.slerp(this.getValue(),e.getValue(),t))},toString:function(){return this.getValue().toString()},toXMLStream:function(e){e.string+=this.getValue().toString()}});var a={get:function(){return this.getValue().x},set:function(e){this.getValue().x=e,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().y},set:function(e){this.getValue().y=e,this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().z},set:function(e){this.getValue().z=e,this.addEvent()},enumerable:!0,configurable:!1},c={get:function(){return this.getValue().angle},set:function(e){this.getValue().angle=e,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(o.prototype,"x",a),Object.defineProperty(o.prototype,"y",u),Object.defineProperty(o.prototype,"z",l),Object.defineProperty(o.prototype,"angle",c),a.enumerable=!1,u.enumerable=!1,l.enumerable=!1,c.enumerable=!1,Object.defineProperty(o.prototype,"0",a),Object.defineProperty(o.prototype,"1",u),Object.defineProperty(o.prototype,"2",l),Object.defineProperty(o.prototype,"3",c),o}),define("cobweb/Fields/SFString",["jquery","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i){function r(e){return this instanceof r?t.call(this,arguments.length?String(e):""):t.call(Object.create(r.prototype),arguments.length?String(e):"")}var o=/\\([\\"])/g,s=/([\\"])/g;return e.extend(r,{unescape:function(e){return e.replace(o,"$1")},escape:function(e){return e.replace(s,"\\$1")}}),r.prototype=e.extend(Object.create(t.prototype),{constructor:r,copy:function(){return new r(this.getValue())},getTypeName:function(){return"SFString"},getType:function(){return n.SFString},isDefaultValue:function(){return""===this.getValue()},set:function(e){t.prototype.set.call(this,String(e))},valueOf:t.prototype.getValue,toString:function(){return'"'+r.escape(this.getValue())+'"'},toXMLStream:function(e){e.string+=i.XMLEncode(this.getValue())}}),Object.defineProperty(r.prototype,"length",{get:function(){return this.getValue().length},enumerable:!0,configurable:!1}),r}),define("cobweb/Fields/SFTime",["jquery","cobweb/Basic/X3DField","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){return this instanceof i?t.call(this,arguments.length?+e:0):t.call(Object.create(i.prototype),arguments.length?+e:0)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},getTypeName:function(){return"SFTime"},getType:function(){return n.SFTime},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,+e)},valueOf:t.prototype.getValue,toString:function(){return String(this.getValue())},toXMLStream:function(e){e.string+=String(this.getValue())}}),i}),define("cobweb/Fields/SFVec4",["jquery","cobweb/Basic/X3DField","cobweb/Fields/SFVecPrototypeTemplate","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(e,t,n,i,r){function o(i,o){function s(e,n,i,o){return arguments.length?arguments[0]instanceof r?t.call(this,arguments[0]):t.call(this,new r(+e,+n,+i,+o)):t.call(this,new r(0,0,0,0))}s.prototype=e.extend(Object.create(t.prototype),n(r),{constructor:s,getTypeName:function(){return i},getType:function(){return o}});var a={get:function(){return this.getValue().x},set:function(e){this.getValue().x=e,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().y},set:function(e){this.getValue().y=e,this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().z},set:function(e){this.getValue().z=e,this.addEvent()},enumerable:!0,configurable:!1},c={get:function(){return this.getValue().w},set:function(e){this.getValue().w=e,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",a),Object.defineProperty(s.prototype,"y",u),Object.defineProperty(s.prototype,"z",l),Object.defineProperty(s.prototype,"w",c),a.enumerable=!1,u.enumerable=!1,l.enumerable=!1,c.enumerable=!1,Object.defineProperty(s.prototype,"0",a),Object.defineProperty(s.prototype,"1",u),Object.defineProperty(s.prototype,"2",l),Object.defineProperty(s.prototype,"3",c),s}return{SFVec4d:o("SFVec4d",i.SFVec4d),SFVec4f:o("SFVec4f",i.SFVec4f)}}),define("cobweb/Fields/ArrayFields",["jquery","cobweb/Fields/SFBool","cobweb/Fields/SFColor","cobweb/Fields/SFColorRGBA","cobweb/Fields/SFDouble","cobweb/Fields/SFFloat","cobweb/Fields/SFImage","cobweb/Fields/SFInt32","cobweb/Fields/SFMatrix3","cobweb/Fields/SFMatrix4","cobweb/Fields/SFNode","cobweb/Fields/SFRotation","cobweb/Fields/SFString","cobweb/Fields/SFTime","cobweb/Fields/SFVec2","cobweb/Fields/SFVec3","cobweb/Fields/SFVec4","cobweb/Basic/X3DArrayField","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b,w,y){function x(e){return this instanceof x?b.call(this,arguments):b.call(Object.create(x.prototype),arguments)}function v(t,n,i){function r(e){return this instanceof r?b.call(this,arguments):b.call(Object.create(r.prototype),arguments)}return r.prototype=e.extend(Object.create(b.prototype),{constructor:r,_valueType:i,getTypeName:function(){return t},getType:function(){return n}}),r}function _(e){return this instanceof _?b.call(this,arguments):b.call(Object.create(_.prototype),arguments)}var S=u.SFMatrix3d,C=u.SFMatrix3f,F=l.SFMatrix4d,T=l.SFMatrix4f,N=f.SFVec2d,O=f.SFVec2f,M=g.SFVec3d,V=g.SFVec3f,D=m.SFVec4d,I=m.SFVec4f;x.prototype=e.extend(Object.create(b.prototype),{constructor:x,_valueType:c,_cloneCount:0,getTypeName:function(){return"MFNode"},getType:function(){return w.MFNode},clone:function(){var e=new x;return e.setValue(this),e},copy:function(e){for(var t=new x,n=this.getValue(),i=t.getValue(),r=0,o=n.length;r<o;++r){var s=n[r].copy(e);s.addParent(t),i.push(s)}return t},addClones:function(e){var t=this.getValue();this._cloneCount+=e;for(var n=0,i=t.length;n<i;++n)t[n].addClones(e)},removeClones:function(e){var t=this.getValue();this._cloneCount+=e;for(var n=0,i=t.length;n<i;++n)t[n].removeClones(e)},addChildObject:function(e){b.prototype.addChildObject.call(this,e),e.addClones(this._cloneCount)},removeChild:function(e){b.prototype.removeChild.call(this,e),e.removeClones(this._cloneCount)},toXMLStream:function(e){var t=this.length;if(t){y.EnterScope();for(var n=this.getValue(),i=0,r=t-1;i<r;++i)(o=n[i].getValue())?(o.toXMLStream(e),e.string+="\n"):(e.string+=y.Indent(),e.string+="\x3c!-- NULL --\x3e\n");var o=n[r].getValue();o?o.toXMLStream(e):(e.string+=y.Indent(),e.string+="\x3c!-- NULL --\x3e"),y.LeaveScope()}}}),_.prototype=e.extend(Object.create(b.prototype),{constructor:_,_valueType:d,getTypeName:function(){return"MFString"},getType:function(){return w.MFString},toXMLStream:function(e){var t=this.length;if(t){for(var n=this.getValue(),i=0,r=t-1;i<r;++i)e.string+='"',n[i].toXMLStream(e),e.string+='"',e.string+=", ";e.string+='"',n[r].toXMLStream(e),e.string+='"'}}});var B={MFBool:v("MFBool",w.MFBool,t),MFColor:v("MFColor",w.MFColor,n),MFColorRGBA:v("MFColorRGBA",w.MFColorRGBA,i),MFDouble:v("MFDouble",w.MFDouble,r),MFFloat:v("MFFloat",w.MFFloat,o),MFImage:v("MFImage",w.MFImage,s),MFInt32:v("MFInt32",w.MFInt32,a),MFMatrix3d:v("MFMatrix3d",w.MFMatrix3d,S),MFMatrix3f:v("MFMatrix3f",w.MFMatrix3f,C),MFMatrix4d:v("MFMatrix4d",w.MFMatrix4d,F),MFMatrix4f:v("MFMatrix4f",w.MFMatrix4f,T),MFNode:x,MFRotation:v("MFRotation",w.MFRotation,h),MFString:_,MFTime:v("MFTime",w.MFTime,p),MFVec2d:v("MFVec2d",w.MFVec2d,N),MFVec2f:v("MFVec2f",w.MFVec2f,O),MFVec3d:v("MFVec3d",w.MFVec3d,M),MFVec3f:v("MFVec3f",w.MFVec3f,V),MFVec4d:v("MFVec4d",w.MFVec4d,D),MFVec4f:v("MFVec4f",w.MFVec4f,I)};return Object.preventExtensions(B),Object.freeze(B),Object.seal(B),B}),define("cobweb/Fields/SFImage",["jquery","cobweb/Basic/X3DField","cobweb/Fields/ArrayFields","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e,t,n,i){this.width=e,this.height=t,this.comp=n,this.array=new s,this.array.setValue(i),this.array.length=e*t}function o(e,n,i,a){return this instanceof o?(4===arguments.length?t.call(this,new r(+e,+n,+i,a)):t.call(this,new r(0,0,0,new s)),this.getValue().getArray().addParent(this),this.addInterest("set_size__",this),this):o.apply(Object.create(o.prototype),arguments)}var s=n.MFInt32;r.prototype={constructor:r,copy:function(){return new r(this.width,this.height,this.comp,this.array)},equals:function(e){return this.width===e.width&&this.height===e.height&&this.comp===e.comp&&this.array.equals(e.array)},assign:function(e){this.width=e.width,this.height=e.height,this.comp=e.comp,this.array.set(e.array.getValue())},set:function(e,t,n,i){this.width=e,this.height=t,this.comp=n,this.array.set(i)},setWidth:function(e){this.width=e,this.array.length=this.width*this.height},getWidth:function(){return this.width},setHeight:function(e){this.height=e,this.array.length=this.width*this.height},getHeight:function(){return this.height},setComp:function(e){this.comp=e},getComp:function(){return this.comp},setArray:function(e){this.array.setValue(e),this.array.length=this.width*this.height},getArray:function(){return this.array}},o.prototype=e.extend(Object.create(t.prototype),{constructor:o,set_size__:function(){this.getValue().getArray().length=this.width*this.height},copy:function(){return new o(this.getValue())},equals:function(e){return this.getValue().equals(e.getValue())},isDefaultValue:function(){return 0===this.width&&0===this.height&&0===this.comp},set:function(e){this.getValue().assign(e)},getTypeName:function(){return"SFImage"},getType:function(){return i.SFImage},toString:function(){for(var e=this.width+" "+this.height+" "+this.comp,t=this.array.getValue(),n=0,i=this.width*this.height;n<i;++n)e+=" 0x"+t[n].toString(16);return e},toXMLStream:function(e){e.string+=this.toString()}});var a={get:function(){return this.getValue().getWidth()},set:function(e){this.getValue().setWidth(e),this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().getHeight()},set:function(e){this.getValue().setHeight(e),this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().getComp()},set:function(e){this.getValue().setComp(e),this.addEvent()},enumerable:!0,configurable:!1},c={get:function(){return this.getValue().getArray()},set:function(e){this.getValue().setArray(e),this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(o.prototype,"width",a),Object.defineProperty(o.prototype,"height",u),Object.defineProperty(o.prototype,"comp",l),Object.defineProperty(o.prototype,"array",c),a.enumerable=!1,u.enumerable=!1,Object.defineProperty(o.prototype,"x",a),Object.defineProperty(o.prototype,"y",u),o}),define("cobweb/Fields",["jquery","cobweb/Fields/SFBool","cobweb/Fields/SFColor","cobweb/Fields/SFColorRGBA","cobweb/Fields/SFDouble","cobweb/Fields/SFFloat","cobweb/Fields/SFImage","cobweb/Fields/SFInt32","cobweb/Fields/SFMatrix3","cobweb/Fields/SFMatrix4","cobweb/Fields/SFNode","cobweb/Fields/SFRotation","cobweb/Fields/SFString","cobweb/Fields/SFTime","cobweb/Fields/SFVec2","cobweb/Fields/SFVec3","cobweb/Fields/SFVec4","cobweb/Fields/ArrayFields"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b){var w=e.extend({SFBool:t,SFColor:n,SFColorRGBA:i,SFDouble:r,SFFloat:o,SFImage:s,SFInt32:a,SFMatrix3d:u.SFMatrix3d,SFMatrix3f:u.SFMatrix3f,SFMatrix4d:l.SFMatrix4d,SFMatrix4f:l.SFMatrix4f,SFNode:c,SFRotation:h,SFString:d,SFTime:p,SFVec2d:f.SFVec2d,SFVec2f:f.SFVec2f,SFVec3d:g.SFVec3d,SFVec3f:g.SFVec3f,SFVec4d:m.SFVec4d,SFVec4f:m.SFVec4f,VrmlMatrix:l.VrmlMatrix},b);return Object.preventExtensions(w),Object.freeze(w),Object.seal(w),w}),define("cobweb/Browser/VERSION",[],function(){return"3.3"}),define("cobweb/Base/X3DEventObject",["jquery","cobweb/Base/X3DChildObject","cobweb/Base/Events"],function(e,t,n){function i(e){t.call(this),this._browser=e}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,getBrowser:function(){return this._browser},getExtendedEventHandling:function(){return!0},addEvent:function(e){e.setSet(!0),e.getTainted()||(e.setTainted(!0),this.addEventObject(e,n.create(e)))},addEventObject:function(e,t){this.getBrowser().addBrowserEvent(),this.getBrowser().addTaintedField(e,t),this.getTainted()||(e.isInput()||this.getExtendedEventHandling()&&!e.isOutput())&&(this.setTainted(!0),this.getBrowser().addTaintedNode(this))},addNodeEvent:function(){this.getTainted()||(this.setTainted(!0),this.getBrowser().addTaintedNode(this),this.getBrowser().addBrowserEvent())},processEvents:function(){this.setTainted(!1),this.processInterests()}}),i}),define("cobweb/Basic/X3DBaseNode",["jquery","cobweb/Base/X3DEventObject","cobweb/Base/Events","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Fields","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i,r,o,s,a){function u(){return this.isLive_}function l(e){if(!this.hasOwnProperty("_executionContext")){t.call(this,e.getBrowser()),this._executionContext=e,this._type=[s.X3DBaseNode],this._fields={},this._predefinedFields={},this._userDefinedFields={},this._cloneCount=0,this.hasUserDefinedFields()&&(this.fieldDefinitions=new r(this.fieldDefinitions.getValue().slice()));for(var n=this.fieldDefinitions.getValue(),i=0,o=n.length;i<o;++i)this.addField(n[i])}}return l.prototype=e.extend(Object.create(t.prototype),{constructor:l,fieldDefinitions:new r([]),_private:!1,_live:!0,_initialized:!1,setExecutionContext:function(e){this._executionContext=e},getScene:function(){for(var e=this._executionContext;!e.isRootContext();)e=e.getExecutionContext();return e},getExecutionContext:function(){return this._executionContext},addType:function(e){this._type.push(e)},getType:function(){return this._type},getInnerNode:function(){return this},isLive:function(){return this.isLive=u,this.addChildObjects("isLive",new o.SFBool(this.getLiveState())),this.isLive_.removeParent(this),this._executionContext!==this&&this._executionContext.isLive().addInterest("_set_live__",this),this.isLive()},setLive:function(e){this._live=e.valueOf(),this._set_live__()},getLive:function(){return this._live},getLiveState:function(){return this!==this._executionContext?this.getLive()&&this._executionContext.isLive().getValue():this.getLive()},_set_live__:function(){var e=this.getLiveState(),t=this.isLive();if(e){if(t.getValue())return;t.setValue(!0),t.processEvent(n.create(t))}else t.getValue()&&(t.setValue(!1),t.processEvent(n.create(t)))},isInitialized:function(){return this._initialized},setup:function(){if(!this._initialized){this._initialized=!0;for(var e=this.fieldDefinitions.getValue(),t=0,n=e.length;t<n;++t){var i=this._fields[e[t].name];i.updateReferences(),i.setTainted(!1)}this.initialize()}},initialize:function(){},eventsProcessed:function(){},create:function(e){return new this.constructor(e)},copy:function(e){if((i=this.getName()).length)try{return e.getNamedNode(i).getValue()}catch(e){}var t=this.create(e);i.length&&e.updateNamedNode(i,t);var n=this.getPredefinedFields();for(var i in n)try{var r=n[i];if((u=t.getField(i)).setSet(r.getSet()),r.hasReferences()){l=r.getReferences();for(var o in l)try{c=l[o];u.addReference(e.getField(c.getName()))}catch(e){console.error(e.message)}}else if(r.getAccessType()&s.initializeOnly)switch(r.getType()){case s.SFNode:case s.MFNode:u.set(r.copy(e).getValue());break;default:u.set(r.getValue())}}catch(e){console.log(e.message)}var a=this.getUserDefinedFields();for(var i in a){var u=(r=a[i]).copy(e);if(t.addUserDefinedField(r.getAccessType(),r.getName(),u),u.setSet(r.getSet()),r.hasReferences()){var l=r.getReferences();for(var o in l)try{var c=l[o];u.addReference(e.getField(c.getName()))}catch(t){console.error("No reference '"+c.getName()+"' inside execution context "+e.getTypeName()+" '"+e.getName()+"'.")}}}return e.addUninitializedNode(t),t},addChildObjects:function(e,t){for(var n=0,i=arguments.length;n<i;n+=2)this.addChildObject(arguments[n],arguments[n+1])},addChildObject:function(e,t){t.addParent(this),t.setName(e),Object.defineProperty(this,e+"_",{get:function(){return t},set:function(e){return t.setValue(e)},enumerable:!0,configurable:!1})},addField:function(e){var t=e.accessType,n=e.name,i=e.value.clone();i.setTainted(!0),i.addParent(this),i.setName(n),i.setAccessType(t),this.setField(n,i)},setField:function(e,t,n){t.getAccessType()===s.inputOutput&&(this._fields["set_"+e]=t,this._fields[e+"_changed"]=t),this._fields[e]=t,this.getPrivate()||t.addClones(1),n?this._userDefinedFields[e]=t:(this._predefinedFields[e]=t,Object.defineProperty(this,e+"_",{get:function(){return t},set:function(e){return t.setValue(e)},enumerable:!0,configurable:!0}))},removeField:function(e){var t=this._fields[e];if(t){t.getAccessType()===s.inputOutput&&(delete this._fields["set_"+t.getName()],delete this._fields[t.getName()+"_changed"]),delete this._fields[e],delete this._userDefinedFields[e];for(var n=this.fieldDefinitions.getValue(),i=0,r=n.length;i<r;++i)if(n[i].name===e){n.splice(i,1);break}this.getPrivate()||t.removeClones(1)}},getField:function(e){var t=this._fields[e];if(t)return t;throw new Error("Unkown field '"+e+"' in node class "+this.getTypeName()+".")},getFieldDefinitions:function(){return this.fieldDefinitions},hasUserDefinedFields:function(){return!1},addUserDefinedField:function(e,t,n){this._fields[t]&&this.removeField(t),n.setTainted(!0),n.addParent(this),n.setName(t),n.setAccessType(e),this.fieldDefinitions.add(new i(e,t,n)),this.setField(t,n,!0)},getUserDefinedFields:function(){return this._userDefinedFields},getPredefinedFields:function(){return this._predefinedFields},getChangedFields:function(){var t=[],n=this.getPredefinedFields();for(var i in n){var r=n[i];if(e.isEmptyObject(r.getReferences())){if(!r.isInitializable())continue;if(this.isDefaultValue(r))continue}t.push(r)}return t},isDefaultValue:function(e){var t=this.getFieldDefinitions().get(e.getName());return t?t.value.equals(e):!e.getSet()},getFields:function(){return this._fields},getSourceText:function(){return null},hasRoutes:function(){for(var t=this.getFieldDefinitions(),n=0,i=t.length;n<i;++n){var r=this.getField(t[n].name);if(!e.isEmptyObject(r.getInputRoutes())||!e.isEmptyObject(r.getOutputRoutes()))return!0}return!1},getPrivate:function(){return this._private},setPrivate:function(e){if(this._private=e,e)for(var t=0,n=(i=this.getFieldDefinitions()).length;t<n;++t)this.getField(i[t].name).removeClones(1);else for(var i=this.getFieldDefinitions(),t=0,n=i.length;t<n;++t)this.getField(i[t].name).addClones(1)},getCloneCount:function(){return this._cloneCount},addClones:function(e){0!==e&&(this._cloneCount+=e)},removeClones:function(e){0!==e&&(this._cloneCount-=e)},traverse:function(){},toString:function(){return this.getTypeName()+" { }"},toXMLStream:function(t){if(a.IsSharedNode(this))return t.string+=a.Indent(),void(t.string+="\x3c!-- NULL --\x3e");if(a.EnterScope(),(b=a.Name(this)).length&&a.ExistsNode(this))return t.string+=a.Indent(),t.string+="<",t.string+=this.getTypeName(),t.string+=" ",t.string+="USE='",t.string+=a.XMLEncode(b),t.string+="'",(n=a.ContainerField())&&n.getName()!==this.getContainerField()&&(t.string+=" ",t.string+="containerField='",t.string+=a.XMLEncode(n.getName()),t.string+="'"),t.string+="/>",void a.LeaveScope();t.string+=a.Indent(),t.string+="<",t.string+=this.getTypeName(),b.length&&(a.AddNode(this),t.string+=" ",t.string+="DEF='",t.string+=a.XMLEncode(b),t.string+="'");var n=a.ContainerField();n&&n.getName()!==this.getContainerField()&&(t.string+=" ",t.string+="containerField='",t.string+=a.XMLEncode(n.getName()),t.string+="'");var i=this.getChangedFields(),r=this.getUserDefinedFields(),o=[],u=[],l=this.getSourceText();l&&0===l.length&&(l=null),a.IncIndent(),a.IncIndent();for(var c=0,h=i.length;c<h;++c){var d=i[c],p=!1;if(a.ExecutionContext()&&d.getAccessType()===s.inputOutput&&!e.isEmptyObject(d.getReferences())){var f=!1,g=d.getReferences();for(var m in g)f|=g[m].isInitializable();f||(p=!0)}if(e.isEmptyObject(d.getReferences())||!a.ExecutionContext()||p){if(p&&o.push(d),d.isInitializable())switch(d.getType()){case s.SFNode:case s.MFNode:u.push(d);break;default:if(d===l)break;t.string+="\n",t.string+=a.Indent(),t.string+=d.getName(),t.string+="='",d.toXMLStream(t),t.string+="'"}}else o.push(d)}if(a.DecIndent(),a.DecIndent(),this.hasUserDefinedFields()&&0!==r.length||0!==o.length||0!==u.length||l){if(t.string+=">\n",a.IncIndent(),this.hasUserDefinedFields())for(var b in r){d=r[b];t.string+=a.Indent(),t.string+="<field",t.string+=" ",t.string+="accessType='",t.string+=a.AccessType(d.getAccessType()),t.string+="'",t.string+=" ",t.string+="type='",t.string+=d.getTypeName(),t.string+="'",t.string+=" ",t.string+="name='",t.string+=a.XMLEncode(d.getName()),t.string+="'";p=!1;if(d.getAccessType()===s.inputOutput&&!e.isEmptyObject(d.getReferences())){var f=!1,g=d.getReferences();for(var m in g)f|=g[m].isInitializable();f||(p=!0)}if(e.isEmptyObject(d.getReferences())||!a.ExecutionContext()||p)if(p&&a.ExecutionContext()&&o.push(d),!d.isInitializable()||d.isDefaultValue())t.string+="/>\n";else switch(d.getType()){case s.SFNode:case s.MFNode:a.PushContainerField(null),t.string+=">\n",a.IncIndent(),d.toXMLStream(t),t.string+="\n",a.DecIndent(),t.string+=a.Indent(),t.string+="</field>\n",a.PopContainerField();break;default:t.string+=" ",t.string+="value='",d.toXMLStream(t),t.string+="'",t.string+="/>\n"}else a.ExecutionContext()&&o.push(d),t.string+="/>\n"}if(o.length){t.string+=a.Indent(),t.string+="<IS>",t.string+="\n",a.IncIndent();for(var c=0,h=o.length;c<h;++c){var w=(d=o[c]).getReferences();for(var m in w){var y=w[m];t.string+=a.Indent(),t.string+="<connect",t.string+=" ",t.string+="nodeField='",t.string+=a.XMLEncode(d.getName()),t.string+="'",t.string+=" ",t.string+="protoField='",t.string+=a.XMLEncode(y.getName()),t.string+="'",t.string+="/>\n"}}a.DecIndent(),t.string+=a.Indent(),t.string+="</IS>\n"}for(var c=0,h=u.length;c<h;++c){d=u[c];a.PushContainerField(d),d.toXMLStream(t),t.string+="\n",a.PopContainerField()}if(l)for(var c=0,h=l.length;c<h;++c){var x=l[c];t.string+="<![CDATA[",t.string+=a.escapeCDATA(x),t.string+="]]>\n"}a.DecIndent(),t.string+=a.Indent(),t.string+="</",t.string+=this.getTypeName(),t.string+=">"}else t.string+="/>";a.LeaveScope()},dispose:function(){var e=this.getPredefinedFields(),t=this.getUserDefinedFields();for(var n in e)e[n].dispose();for(var n in t)t[n].dispose();var i=this.getParents();for(var r in i){var s=i[r];if(s instanceof o.SFNode){var a=s.getParents();for(var u in a){var l=a[u];if(l instanceof o.MFNode){var c=l.length;l.erase(l.remove(0,c,s),c)}}s.setValue(null)}}}}),l.prototype.addAlias=l.prototype.setField,l}),define("cobweb/Browser/Core/PrimitiveQuality",[],function(){var e=0,t={LOW:e++,MEDIUM:e++,HIGH:e++};return Object.preventExtensions(t),Object.freeze(t),Object.seal(t),t}),define("cobweb/Browser/Core/TextureQuality",[],function(){var e=0,t={LOW:e++,MEDIUM:e++,HIGH:e++};return Object.preventExtensions(t),Object.freeze(t),Object.seal(t),t}),define("cobweb/Browser/Core/BrowserOptions",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Basic/X3DBaseNode","cobweb/Bits/X3DConstants","cobweb/Browser/Core/PrimitiveQuality","cobweb/Browser/Core/TextureQuality"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addAlias("AntiAliased",this.Antialiased_),this.setAttributeSplashScreen(),this.primitiveQuality=s.MEDIUM,this.textureQuality=a.MEDIUM}return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"SplashScreen",new t.SFBool(!0)),new n(o.inputOutput,"Dashboard",new t.SFBool(!0)),new n(o.inputOutput,"Rubberband",new t.SFBool(!0)),new n(o.inputOutput,"EnableInlineViewpoints",new t.SFBool(!0)),new n(o.inputOutput,"Antialiased",new t.SFBool(!0)),new n(o.inputOutput,"TextureQuality",new t.SFString("MEDIUM")),new n(o.inputOutput,"PrimitiveQuality",new t.SFString("MEDIUM")),new n(o.inputOutput,"QualityWhenMoving",new t.SFString("MEDIUM")),new n(o.inputOutput,"Shading",new t.SFString("GOURAUD")),new n(o.inputOutput,"MotionBlur",new t.SFBool),new n(o.inputOutput,"Gravity",new t.SFFloat(9.80665))]),getTypeName:function(){return"BrowserOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"browserOptions"},initialize:function(){r.prototype.initialize.call(this),this.SplashScreen_.addInterest("set_splashScreen__",this),this.Rubberband_.addInterest("set_rubberband__",this),this.PrimitiveQuality_.addInterest("set_primitiveQuality__",this),this.TextureQuality_.addInterest("set_textureQuality__",this),this.Shading_.addInterest("set_shading__",this),this.getBrowser().shutdown().addInterest("configure",this),this.configure()},configure:function(){for(var e=this.getFieldDefinitions(),t=0;t<e.length;++t){var n=e[t],i=this.getField(n.name);void 0===this.getBrowser().getDataStorage()["BrowserOptions."+n.name]&&(i.equals(n.value)||i.setValue(n.value))}var r=this.getBrowser().getDataStorage()["BrowserOptions.Rubberband"],o=this.getBrowser().getDataStorage()["BrowserOptions.PrimitiveQuality"],s=this.getBrowser().getDataStorage()["BrowserOptions.TextureQuality"];this.setAttributeSplashScreen(),void 0!==r&&r!==this.Rubberband_.getValue()&&(this.Rubberband_=r),void 0!==o&&o!==this.PrimitiveQuality_.getValue()&&(this.PrimitiveQuality_=o),void 0!==s&&s!==this.TextureQuality_.getValue()&&(this.TextureQuality_=s)},setAttributeSplashScreen:function(){this.SplashScreen_.set(this.getSplashScreen())},getSplashScreen:function(){return"false"!==this.getBrowser().getElement().attr("splashScreen")},getNotifications:function(){return"false"!==this.getBrowser().getElement().attr("notifications")},getTimings:function(){return"false"!==this.getBrowser().getElement().attr("timings")},getContextMenu:function(){return"false"!==this.getBrowser().getElement().attr("contextMenu")},getCache:function(){return"false"!==this.getBrowser().getElement().attr("cache")},getPrimitiveQuality:function(){return this.primitiveQuality},getTextureQuality:function(){return this.textureQuality},getShading:function(){return this.Shading_.getValue()},set_splashScreen__:function(e){this.getBrowser().getElement().attr("splashScreen",e.getValue()?"true":"false")},set_rubberband__:function(e){this.getBrowser().getDataStorage()["BrowserOptions.Rubberband"]=e.getValue()},set_primitiveQuality__:function(e){this.getBrowser().getDataStorage()["BrowserOptions.PrimitiveQuality"]=e.getValue();var t=this.getBrowser().getArc2DOptions(),n=this.getBrowser().getArcClose2DOptions(),i=this.getBrowser().getCircle2DOptions(),r=this.getBrowser().getDisk2DOptions(),o=this.getBrowser().getConeOptions(),a=this.getBrowser().getCylinderOptions(),u=this.getBrowser().getSphereOptions();switch(e.getValue()){case"LOW":this.primitiveQuality=s.LOW,t.dimension_=20,n.dimension_=20,i.dimension_=20,r.dimension_=20,o.xDimension_=16,a.xDimension_=16,u.xDimension_=20,u.yDimension_=9;break;case"HIGH":this.primitiveQuality=s.HIGH,t.dimension_=80,n.dimension_=80,i.dimension_=80,r.dimension_=80,o.xDimension_=32,a.xDimension_=32,u.xDimension_=64,u.yDimension_=31;break;default:this.primitiveQuality=s.MEDIUM,t.dimension_=40,n.dimension_=40,i.dimension_=40,r.dimension_=40,o.xDimension_=20,a.xDimension_=20,u.xDimension_=32,u.yDimension_=15}},set_textureQuality__:function(e){this.getBrowser().getDataStorage()["BrowserOptions.TextureQuality"]=e.getValue();var t=this.getBrowser().getDefaultTextureProperties();switch(e.getValue()){case"LOW":this.textureQuality=a.LOW,t.magnificationFilter_="AVG_PIXEL",t.minificationFilter_="AVG_PIXEL",t.textureCompression_="FASTEST",t.generateMipMaps_=!0;break;case"HIGH":this.textureQuality=a.HIGH,t.magnificationFilter_="NICEST",t.minificationFilter_="NICEST",t.textureCompression_="NICEST",t.generateMipMaps_=!0;break;default:this.textureQuality=a.MEDIUM,t.magnificationFilter_="NICEST",t.minificationFilter_="AVG_PIXEL_AVG_MIPMAP",t.textureCompression_="NICEST",t.generateMipMaps_=!0}},set_shading__:function(e){this.getBrowser().setShading(e.getValue())}}),u}),define("cobweb/Browser/Core/BrowserProperties",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Basic/X3DBaseNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.initializeOnly,"ABSTRACT_NODES",new t.SFBool(!0)),new n(o.initializeOnly,"CONCRETE_NODES",new t.SFBool(!0)),new n(o.initializeOnly,"EXTERNAL_INTERACTIONS",new t.SFBool(!0)),new n(o.initializeOnly,"PROTOTYPE_CREATE",new t.SFBool(!0)),new n(o.initializeOnly,"DOM_IMPORT",new t.SFBool(!0)),new n(o.initializeOnly,"XML_ENCODING",new t.SFBool(!0)),new n(o.initializeOnly,"CLASSIC_VRML_ENCODING",new t.SFBool(!0)),new n(o.initializeOnly,"BINARY_ENCODING",new t.SFBool)]),getTypeName:function(){return"BrowserProperties"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"browserProperties"}}),s}),define("cobweb/Browser/Core/RenderingProperties",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Basic/X3DBaseNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addAlias("AntiAliased",this.Antialiased_)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.initializeOnly,"Shading",new t.SFString),new n(o.initializeOnly,"MaxTextureSize",new t.SFInt32),new n(o.initializeOnly,"TextureUnits",new t.SFInt32),new n(o.initializeOnly,"MaxLights",new t.SFInt32),new n(o.initializeOnly,"Antialiased",new t.SFBool(!0)),new n(o.initializeOnly,"ColorDepth",new t.SFInt32),new n(o.initializeOnly,"TextureMemory",new t.SFDouble)]),getTypeName:function(){return"RenderingProperties"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"renderingProperties"},initialize:function(){r.prototype.initialize.call(this);var e=this.getBrowser();this.MaxTextureSize_=e.getMaxTextureSize(),this.TextureUnits_=e.getCombinedTextureUnits(),this.MaxLights_=e.getMaxLights(),this.ColorDepth_=e.getColorDepth(),this.TextureMemory_=e.getTextureMemory(),e.getBrowserOptions().Shading_.addInterest("set_shading__",this),this.set_shading__(e.getBrowserOptions().Shading_)},set_shading__:function(e){this.Shading_=e}}),s}),define("cobweb/Browser/Core/Notification",["jquery","cobweb/Fields/SFString","cobweb/Basic/X3DBaseNode"],function(e,t,n){function i(e){n.call(this,e)}return e.fn.textWidth=function(t){var n=e(this).children(),i="<span>"+e(this).html()+"</span>";e(this).html(i);var r=e(this).find("span:first").width();return e(this).empty(),e(this).append(n),r},i.prototype=e.extend(Object.create(n.prototype),{constructor:i,initialize:function(){n.prototype.initialize.call(this),this.addChildObjects("string",new t),this.element=e("<div></div>").addClass("cobweb-notification").appendTo(this.getBrowser().getElement().find(".cobweb-surface")).animate({width:0}),e("<span></span>").appendTo(this.element),this.string_.addInterest("set_string__",this)},set_string__:function(){this.getBrowser().getBrowserOptions().getNotifications()&&0!==this.string_.length&&(this.element.children().text(this.string_.getValue()),this.element.stop(!0,!0).fadeIn(0).animate({width:this.element.textWidth()}).animate({delay:1},5e3).animate({width:0}).fadeOut(0))}}),i}),define("text/text",["module"],function(e){var t,n,i=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,o=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,s="undefined"!=typeof location&&location.href,a=s&&location.protocol&&location.protocol.replace(/\:/,""),u=s&&location.hostname,l=s&&(location.port||void 0),c=[],h=e.config&&e.config()||{};return t={version:"2.0.2+",strip:function(e){if(e){var t=(e=e.replace(r,"")).match(o);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:h.createXhr||function(){var e,t,n;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;t<3;t+=1){n=i[t];try{e=new ActiveXObject(n)}catch(e){}if(e){i=[n];break}}return e},parseName:function(e){var t=!1,n=e.indexOf("."),i=e.substring(0,n),r=e.substring(n+1,e.length);return-1!==(n=r.indexOf("!"))&&(t="strip"===(t=r.substring(n+1,r.length)),r=r.substring(0,n)),{moduleName:i,ext:r,strip:t}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,i,r){var o,s,a,u=t.xdRegExp.exec(e);return!u||(o=u[2],s=u[3],s=s.split(":"),a=s[1],s=s[0],!(o&&o!==n||s&&s.toLowerCase()!==i.toLowerCase()||(a||s)&&a!==r))},finishLoad:function(e,n,i,r){i=n?t.strip(i):i,h.isBuild&&(c[e]=i),r(i)},load:function(e,n,i,r){if(!r.isBuild||r.inlineText){h.isBuild=r.isBuild;var o=t.parseName(e),c=o.moduleName+"."+o.ext,d=n.toUrl(c),p=h.useXhr||t.useXhr;!s||p(d,a,u,l)?t.get(d,function(n){t.finishLoad(e,o.strip,n,i)},function(e){i.error&&i.error(e)}):n([c],function(e){t.finishLoad(o.moduleName+"."+o.ext,o.strip,e,i)})}else i()},write:function(e,n,i,r){if(c.hasOwnProperty(n)){var o=t.jsEscape(c[n]);i.asModule(e+"!"+n,"define(function () { return '"+o+"';});\n")}},writeFile:function(e,n,i,r,o){var s=t.parseName(n),a=s.moduleName+"."+s.ext,u=i.toUrl(s.moduleName+"."+s.ext)+".js";t.load(a,i,function(n){var i=function(e){return r(u,e)};i.asModule=function(e,t){return r.asModule(e,u,t)},t.write(e,a,i,o)},o)}},"node"===h.env||!h.env&&"undefined"!=typeof process&&process.versions&&process.versions.node?(n=require.nodeRequire("fs"),t.get=function(e,t){var i=n.readFileSync(e,"utf8");0===i.indexOf("\ufeff")&&(i=i.substring(1)),t(i)}):"xhr"===h.env||!h.env&&t.createXhr()?t.get=function(e,n,i){var r=t.createXhr();r.open("GET",e,!0),h.onXhr&&h.onXhr(r,e),r.onreadystatechange=function(t){var o,s;4===r.readyState&&((o=r.status)>399&&o<600?((s=new Error(e+" HTTP status: "+o)).xhr=r,i(s)):n(r.responseText))},r.send(null)}:("rhino"===h.env||!h.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java)&&(t.get=function(e,t){var n,i,r=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(r),"utf-8")),a="";try{for(n=new java.lang.StringBuffer,(i=s.readLine())&&i.length()&&65279===i.charAt(0)&&(i=i.substring(1)),n.append(i);null!==(i=s.readLine());)n.append(o),n.append(i);a=String(n.toString())}finally{s.close()}t(a)}),t}),define("text",["text/text"],function(e){return e}),define("text!locale/de.po",[],function(){return'msgid ""\nmsgstr ""\n"Project-Id-Version: Cobweb\\n"\n"POT-Creation-Date: 2015-12-23 04:56+0100\\n"\n"PO-Revision-Date: 2015-12-23 04:57+0100\\n"\n"Last-Translator: Holger Seelig <holger.seelig@yahoo.de>\\n"\n"Language-Team: \\n"\n"Language: de\\n"\n"MIME-Version: 1.0\\n"\n"Content-Type: text/plain; charset=UTF-8\\n"\n"Content-Transfer-Encoding: 8bit\\n"\n"X-Generator: Poedit 1.8.4\\n"\n"X-Poedit-Basepath: ../cobweb\\n"\n"Plural-Forms: nplurals=2; plural=(n != 1);\\n"\n"X-Poedit-SourceCharset: UTF-8\\n"\n"X-Poedit-SearchPath-0: .\\n"\n\n#: Browser/Core/BrowserTimings.js:96\nmsgid "Less Properties"\nmsgstr "Weniger Eigenschaften"\n\n#: Browser/Core/BrowserTimings.js:98\nmsgid "More Properties"\nmsgstr "Mehr Eigenschaften"\n\n#: Browser/Core/BrowserTimings.js:124\nmsgid "Frame rate"\nmsgstr "Bildrate"\n\n#: Browser/Core/BrowserTimings.js:124\nmsgid "fps"\nmsgstr "BpS"\n\n#: Browser/Core/BrowserTimings.js:125\nmsgid "Speed"\nmsgstr "Geschwindigkeit"\n\n#: Browser/Core/BrowserTimings.js:125\nmsgid "m/s"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:125\nmsgid "km/h"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:150\nmsgid "Browser"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:150 Browser/Core/BrowserTimings.js:151\n#: Browser/Core/BrowserTimings.js:152 Browser/Core/BrowserTimings.js:153\n#: Browser/Core/BrowserTimings.js:154 Browser/Core/BrowserTimings.js:155\n#: Browser/Core/BrowserTimings.js:156\nmsgid "ms"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:151\nmsgid "X3D"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:152\nmsgid "Routing"\nmsgstr "Routen"\n\n#: Browser/Core/BrowserTimings.js:153\nmsgid "Picking"\nmsgstr "Zeigegerät"\n\n#: Browser/Core/BrowserTimings.js:154\nmsgid "Camera"\nmsgstr "Kamera"\n\n#: Browser/Core/BrowserTimings.js:155\nmsgid "Collision"\nmsgstr "Kollision"\n\n#: Browser/Core/BrowserTimings.js:156\nmsgid "Display"\nmsgstr "Anzeige"\n\n#: Browser/Core/BrowserTimings.js:157\nmsgid "Shapes"\nmsgstr "Formen"\n\n#: Browser/Core/BrowserTimings.js:158\nmsgid "Sensors"\nmsgstr "Sensoren"\n\n#: Browser/Core/BrowserTimings.js:163 Browser/Core/ContextMenu.js:210\nmsgid "Browser Timings"\nmsgstr "Zeitberechnung"\n\n#: Browser/Core/ContextMenu.js:19\nmsgid "Cobweb X3D Browser"\nmsgstr ""\n\n#: Browser/Core/ContextMenu.js:59\nmsgid "Viewpoints"\nmsgstr "Ansichtspunkte"\n\n#: Browser/Core/ContextMenu.js:87\nmsgid "Available Viewers"\nmsgstr "Verfügbare Betrachter"\n\n#: Browser/Core/ContextMenu.js:95 Browser/Core/ContextMenu.js:107\n#: Browser/Core/ContextMenu.js:121 Browser/Core/ContextMenu.js:135\nmsgid "Primitive Quality"\nmsgstr "Qualität der Grundobjekte"\n\n#: Browser/Core/ContextMenu.js:99 Browser/Core/ContextMenu.js:147\nmsgid "High"\nmsgstr "Hoch"\n\n#: Browser/Core/ContextMenu.js:107 Browser/Core/ContextMenu.js:155\nmsgid "high"\nmsgstr "hoch"\n\n#: Browser/Core/ContextMenu.js:113 Browser/Core/ContextMenu.js:161\nmsgid "Medium"\nmsgstr "Mittel"\n\n#: Browser/Core/ContextMenu.js:121 Browser/Core/ContextMenu.js:169\nmsgid "medium"\nmsgstr "mittel"\n\n#: Browser/Core/ContextMenu.js:127 Browser/Core/ContextMenu.js:175\nmsgid "Low"\nmsgstr "Niedrig"\n\n#: Browser/Core/ContextMenu.js:135 Browser/Core/ContextMenu.js:183\nmsgid "low"\nmsgstr "niedrig"\n\n#: Browser/Core/ContextMenu.js:143 Browser/Core/ContextMenu.js:155\n#: Browser/Core/ContextMenu.js:169 Browser/Core/ContextMenu.js:183\nmsgid "Texture Quality"\nmsgstr "Textur Qualität"\n\n#: Browser/Core/ContextMenu.js:191\nmsgid "Display Rubberband"\nmsgstr "Gummiband anzeigen"\n\n#: Browser/Core/ContextMenu.js:202 Browser/Core/ContextMenu.js:204\nmsgid "Rubberband"\nmsgstr "Gummiband"\n\n#: Browser/Core/ContextMenu.js:202\nmsgid "on"\nmsgstr "an"\n\n#: Browser/Core/ContextMenu.js:204\nmsgid "off"\nmsgstr "aus"\n\n#: Browser/Core/ContextMenu.js:225\nmsgid "Mute Browser"\nmsgstr "Browser stumm schalten"\n\n#: Browser/Core/ContextMenu.js:233\nmsgid "Browser muted"\nmsgstr "Browser stumm geschalten"\n\n#: Browser/Core/ContextMenu.js:233\nmsgid "Browser unmuted"\nmsgstr "Browser Ton an"\n\n#: Browser/Core/ContextMenu.js:239\nmsgid "Leave Fullscreen"\nmsgstr "Vollbild verlassen"\n\n#: Browser/Core/ContextMenu.js:239\nmsgid "Fullscreen"\nmsgstr "Vollbild"\n\n#: Browser/Core/ContextMenu.js:249\nmsgid "About Cobweb"\nmsgstr "Über Cobweb"\n\n#: Browser/Core/ContextMenu.js:342\nmsgid "Examine Viewer"\nmsgstr "Untersuchen"\n\n#: Browser/Core/ContextMenu.js:344\nmsgid "Walk Viewer"\nmsgstr "Laufen"\n\n#: Browser/Core/ContextMenu.js:346\nmsgid "Fly Viewer"\nmsgstr "Fliegen"\n\n#: Browser/Core/ContextMenu.js:348\nmsgid "Plane Viewer"\nmsgstr "Ebenen Betrachter"\n\n#: Browser/Core/ContextMenu.js:350\n#, fuzzy\nmsgid "Look At Viewer"\nmsgstr "Auf Objekte zielen"\n\n#: Browser/Core/ContextMenu.js:352\nmsgid "None Viewer"\nmsgstr "Kein Betrachter"\n\n#: Browser/Networking/X3DNetworkingContext.js:101\n#, javascript-format\nmsgid "Loading %d file"\nmsgstr "Lade %d Datei"\n\n#: Browser/Networking/X3DNetworkingContext.js:101\n#, javascript-format\nmsgid "Loading %d files"\nmsgstr "Lade %d Dateien"\n\n#: Browser/Networking/X3DNetworkingContext.js:104\nmsgid "Loading done"\nmsgstr "Fertig mit Laden"\n\n#: Browser/X3DBrowser.js:313\nmsgid "Failed loading world."\nmsgstr "Laden der Dateien fehlgeschlagen."\n\n#~ msgid "Look At"\n#~ msgstr "Auf Objekte zielen"\n'}),define("text!locale/fr.po",[],function(){return'msgid ""\nmsgstr ""\n"Project-Id-Version: Cobweb\\n"\n"POT-Creation-Date: 2015-12-23 04:58+0100\\n"\n"PO-Revision-Date: 2015-12-23 05:07+0100\\n"\n"Last-Translator: Holger Seelig <holger.seelig@yahoo.de>\\n"\n"Language-Team: \\n"\n"Language: fr\\n"\n"MIME-Version: 1.0\\n"\n"Content-Type: text/plain; charset=UTF-8\\n"\n"Content-Transfer-Encoding: 8bit\\n"\n"X-Generator: Poedit 1.8.4\\n"\n"X-Poedit-Basepath: ../cobweb\\n"\n"Plural-Forms: nplurals=2; plural=(n != 1);\\n"\n"X-Poedit-SourceCharset: UTF-8\\n"\n"X-Poedit-SearchPath-0: .\\n"\n\n#: Browser/Core/BrowserTimings.js:96\nmsgid "Less Properties"\nmsgstr "Moins de propriétés"\n\n#: Browser/Core/BrowserTimings.js:98\nmsgid "More Properties"\nmsgstr "Plus de propriétés"\n\n#: Browser/Core/BrowserTimings.js:124\nmsgid "Frame rate"\nmsgstr "Fréquence"\n\n#: Browser/Core/BrowserTimings.js:124\nmsgid "fps"\nmsgstr "fps"\n\n#: Browser/Core/BrowserTimings.js:125\nmsgid "Speed"\nmsgstr "Vélocité"\n\n#: Browser/Core/BrowserTimings.js:125\nmsgid "m/s"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:125\nmsgid "km/h"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:150\n#, fuzzy\nmsgid "Browser"\nmsgstr "Cobweb X3D Navigateur"\n\n#: Browser/Core/BrowserTimings.js:150 Browser/Core/BrowserTimings.js:151\n#: Browser/Core/BrowserTimings.js:152 Browser/Core/BrowserTimings.js:153\n#: Browser/Core/BrowserTimings.js:154 Browser/Core/BrowserTimings.js:155\n#: Browser/Core/BrowserTimings.js:156\nmsgid "ms"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:151\nmsgid "X3D"\nmsgstr ""\n\n#: Browser/Core/BrowserTimings.js:152\nmsgid "Routing"\nmsgstr "Routes"\n\n#: Browser/Core/BrowserTimings.js:153\nmsgid "Picking"\nmsgstr "Pointeur"\n\n#: Browser/Core/BrowserTimings.js:154\nmsgid "Camera"\nmsgstr "Caméra"\n\n#: Browser/Core/BrowserTimings.js:155\nmsgid "Collision"\nmsgstr "Collision"\n\n#: Browser/Core/BrowserTimings.js:156\nmsgid "Display"\nmsgstr "Visualisation"\n\n#: Browser/Core/BrowserTimings.js:157\nmsgid "Shapes"\nmsgstr "Formes"\n\n#: Browser/Core/BrowserTimings.js:158\nmsgid "Sensors"\nmsgstr "Senseurs"\n\n#: Browser/Core/BrowserTimings.js:163 Browser/Core/ContextMenu.js:210\nmsgid "Browser Timings"\nmsgstr "Calcul du temps"\n\n#: Browser/Core/ContextMenu.js:19\nmsgid "Cobweb X3D Browser"\nmsgstr "Cobweb X3D Navigateur"\n\n#: Browser/Core/ContextMenu.js:59\nmsgid "Viewpoints"\nmsgstr "Points de vue"\n\n#: Browser/Core/ContextMenu.js:87\nmsgid "Available Viewers"\nmsgstr "Visionneurs disponibles"\n\n#: Browser/Core/ContextMenu.js:95 Browser/Core/ContextMenu.js:107\n#: Browser/Core/ContextMenu.js:121 Browser/Core/ContextMenu.js:135\nmsgid "Primitive Quality"\nmsgstr "Qualité des objets simples"\n\n#: Browser/Core/ContextMenu.js:99 Browser/Core/ContextMenu.js:147\nmsgid "High"\nmsgstr "Haut"\n\n#: Browser/Core/ContextMenu.js:107 Browser/Core/ContextMenu.js:155\nmsgid "high"\nmsgstr "haut"\n\n#: Browser/Core/ContextMenu.js:113 Browser/Core/ContextMenu.js:161\nmsgid "Medium"\nmsgstr "Moyenne"\n\n#: Browser/Core/ContextMenu.js:121 Browser/Core/ContextMenu.js:169\nmsgid "medium"\nmsgstr "moyenne"\n\n#: Browser/Core/ContextMenu.js:127 Browser/Core/ContextMenu.js:175\nmsgid "Low"\nmsgstr "Faible"\n\n#: Browser/Core/ContextMenu.js:135 Browser/Core/ContextMenu.js:183\nmsgid "low"\nmsgstr "faible"\n\n#: Browser/Core/ContextMenu.js:143 Browser/Core/ContextMenu.js:155\n#: Browser/Core/ContextMenu.js:169 Browser/Core/ContextMenu.js:183\nmsgid "Texture Quality"\nmsgstr "Qualité des textures"\n\n#: Browser/Core/ContextMenu.js:191\nmsgid "Display Rubberband"\nmsgstr "Présenter le bande élastique"\n\n#: Browser/Core/ContextMenu.js:202 Browser/Core/ContextMenu.js:204\nmsgid "Rubberband"\nmsgstr "Bande élastique"\n\n#: Browser/Core/ContextMenu.js:202\nmsgid "on"\nmsgstr "marche"\n\n#: Browser/Core/ContextMenu.js:204\nmsgid "off"\nmsgstr "arrêt"\n\n#: Browser/Core/ContextMenu.js:225\nmsgid "Mute Browser"\nmsgstr "Rendre navigateur muet"\n\n#: Browser/Core/ContextMenu.js:233\nmsgid "Browser muted"\nmsgstr "Navigateur muet"\n\n#: Browser/Core/ContextMenu.js:233\nmsgid "Browser unmuted"\nmsgstr "Son de navigateur réactivé"\n\n#: Browser/Core/ContextMenu.js:239\nmsgid "Leave Fullscreen"\nmsgstr "Sortie en plein écran"\n\n#: Browser/Core/ContextMenu.js:239\nmsgid "Fullscreen"\nmsgstr "Plein écran"\n\n#: Browser/Core/ContextMenu.js:249\nmsgid "About Cobweb"\nmsgstr "À propos de Cobweb"\n\n#: Browser/Core/ContextMenu.js:342\nmsgid "Examine Viewer"\nmsgstr "Examiner"\n\n#: Browser/Core/ContextMenu.js:344\nmsgid "Walk Viewer"\nmsgstr "Aller"\n\n#: Browser/Core/ContextMenu.js:346\nmsgid "Fly Viewer"\nmsgstr "Voler"\n\n#: Browser/Core/ContextMenu.js:348\nmsgid "Plane Viewer"\nmsgstr "Visionneur de la plaine"\n\n#: Browser/Core/ContextMenu.js:350\n#, fuzzy\nmsgid "Look At Viewer"\nmsgstr "Regarder un objet de près"\n\n#: Browser/Core/ContextMenu.js:352\nmsgid "None Viewer"\nmsgstr "Pas de visionneur"\n\n#: Browser/Networking/X3DNetworkingContext.js:101\n#, javascript-format\nmsgid "Loading %d file"\nmsgstr "Télécharger %d fichier"\n\n#: Browser/Networking/X3DNetworkingContext.js:101\n#, javascript-format\nmsgid "Loading %d files"\nmsgstr "Télécharger %d fichiers"\n\n#: Browser/Networking/X3DNetworkingContext.js:104\nmsgid "Loading done"\nmsgstr "Téléchargement fini"\n\n#: Browser/X3DBrowser.js:313\nmsgid "Failed loading world."\nmsgstr "Le chargement des fichiers ayant échoué."\n\n#~ msgid "Look At"\n#~ msgstr "Regarder un objet de près"\n'}),define("lib/gettext",["text!locale/de.po","text!locale/fr.po"],function(e,t){function n(e,t){for(var n=null,i=[];n=e.exec(t);)i.push(n);return i}function i(e){var t=r[s];if(void 0===t)return e;var n=t[e];return void 0===n?e:n}var r={en:"C",de:e,fr:t},o=/msgid\s+"(.*?)"\nmsgstr\s+"(.*?)"\n/g,s=function(){for(var e=0;e<navigator.languages;++e){var t=navigator.languages[e].split("-")[0];if(r[t])return t}return(navigator.language||navigator.userLanguage).split("-")[0]}();return function(e){if(r[e])for(var t=n(o,r[e]),i=r[e]={},s=0,a=t.length;s<a;++s)t[s][2].length&&(i[t[s][1]]=t[s][2])}(s),i}),define("cobweb/Browser/Core/BrowserTimings",["jquery","cobweb/Fields/SFBool","cobweb/Basic/X3DBaseNode","lib/gettext"],function(e,t,n,i){function r(e){return Math.floor(100*e)/100}function o(e){n.call(this,e),this.addChildObjects("enabled",new t)}return o.prototype=e.extend(Object.create(n.prototype),{constructor:o,getTypeName:function(){return"BrowserTimings"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"browserTimings"},initialize:function(){n.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this),this.localeOptions={minimumFractionDigits:2,maximumFractionDigits:2},this.type=this.getBrowser().getDataStorage()["BrowserTimings.type"]||"LESS",this.startTime=0,this.frames=0,this.element=e("<div></div>").addClass("cobweb-browser-timings").appendTo(this.getBrowser().getElement().find(".cobweb-surface")),this.table=e("<table></table>").appendTo(this.element),this.header=e("<thead></thead>").append(e("<tr></tr>").append(e("<th colspan='2'></th>"))).appendTo(this.table),this.body=e("<tbody></tbody>").appendTo(this.table),this.footer=e("<tfoot></tfoot>").append(e("<tr></tr>").append(e("<td colspan='2'></td>"))).appendTo(this.table),this.button=e("<button></button>").click(this.set_type__.bind(this)).appendTo(this.footer.find("td")),this.rows=[],this.set_button__(),this.getBrowser().getDataStorage()["BrowserTimings.enabled"]&&(this.enabled_=!0)},set_enabled__:function(e){this.getBrowser().getBrowserOptions().getTimings()&&(this.getBrowser().getDataStorage()["BrowserTimings.enabled"]=e.getValue(),e.getValue()?(this.element.fadeIn(),this.getBrowser().prepareEvents().addInterest("update",this),this.update()):(this.element.fadeOut(),this.getBrowser().prepareEvents().removeInterest("update",this)))},set_type__:function(){"MORE"===this.type?this.type="LESS":this.type="MORE",this.getBrowser().getDataStorage()["BrowserTimings.type"]=this.type,this.set_button__(),this.build()},set_button__:function(){"MORE"===this.type?this.button.text(i("Less Properties")):this.button.text(i("More Properties"))},update:function(){var e=this.getBrowser().getCurrentTime();e-this.startTime>1?(this.build(),this.frames=0,this.startTime=e):++this.frames},build:function(){var t=this.getBrowser(),n=t.getCurrentTime(),o=navigator.language||navigator.userLanguage,s=this.localeOptions,a=this.rows,u=0;if(a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Frame rate")+":")).append(e("<td></td>").text(r(this.frames/(n-this.startTime)).toLocaleString(o,s)+" "+i("fps"))),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Speed")+":")).append(e("<td></td>").text(r(this.getSpeed(t.currentSpeed)).toLocaleString(o,s)+" "+this.getSpeedUnit(t.currentSpeed))),"MORE"===this.type){for(var l=t.getWorld().getLayerSet().getLayers(),c=t.getActiveLayer(),h=t.systemTime,d=c&&t.getCollisionCount()?c.collisionTime:0,p=t.collisionTime+d,f=t.browserTime-(t.cameraTime+t.collisionTime+t.displayTime+d),g=Object.keys(t.prepareEvents().getInterests()).length-1,m=Object.keys(t.sensors().getInterests()).length,b=0,w=0,y=0;y<l.length;++y){var x=l[y];b+=x.numOpaqueShapes,w+=x.numTransparentShapes}a[1].addClass("cobweb-more"),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Browser")+":")).append(e("<td></td>").text(r(h).toLocaleString(o,s)+" "+i("ms"))),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("X3D")+":")).append(e("<td></td>").text(r(t.browserTime).toLocaleString(o,s)+" "+i("ms"))),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Routing")+":")).append(e("<td></td>").text(r(f).toLocaleString(o,s)+" "+i("ms"))),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Picking")+":")).append(e("<td></td>").text(r(t.pickingTime).toLocaleString(o,s)+" "+i("ms"))),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Camera")+":")).append(e("<td></td>").text(r(t.cameraTime).toLocaleString(o,s)+" "+i("ms"))),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Collision")+":")).append(e("<td></td>").text(r(p).toLocaleString(o,s)+" "+i("ms"))),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Display")+":")).append(e("<td></td>").text(r(t.displayTime).toLocaleString(o,s)+" "+i("ms"))),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Shapes")+":")).append(e("<td></td>").text(b+" + "+w)),a[u++]=e("<tr></tr>").append(e("<td></td>").text(i("Sensors")+":")).append(e("<td></td>").text(g+m))}a.length=u,this.header.find("th").text(i("Browser Timings")),this.body.empty(),this.body.append(a)},getSpeed:function(e){return e<15?e:3.6*e},getSpeedUnit:function(e){return i(e<15?"m/s":"km/h")}}),o}),function(e){"function"==typeof define&&define.amd?define("lib/jquery-contextMenu/dist/jquery.contextMenu",["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function t(e){for(var t,n=e.split(/\s+/),i=[],r=0;t=n[r];r++)t=t.charAt(0).toUpperCase(),i.push(t);return i}function n(t){return t.id&&e('label[for="'+t.id+'"]').val()||t.name}function i(t,r,o){return o||(o=0),r.each(function(){var r,s,a=e(this),u=this,l=this.nodeName.toLowerCase();switch("label"===l&&a.find("input, textarea, select").length&&(r=a.text(),l=(u=(a=a.children().first()).get(0)).nodeName.toLowerCase()),l){case"menu":s={name:a.attr("label"),items:{}},o=i(s.items,a.children(),o);break;case"a":case"button":s={name:a.text(),disabled:!!a.attr("disabled"),callback:function(){return function(){a.click()}}()};break;case"menuitem":case"command":switch(a.attr("type")){case void 0:case"command":case"menuitem":s={name:a.attr("label"),disabled:!!a.attr("disabled"),icon:a.attr("icon"),callback:function(){return function(){a.click()}}()};break;case"checkbox":s={type:"checkbox",disabled:!!a.attr("disabled"),name:a.attr("label"),selected:!!a.attr("checked")};break;case"radio":s={type:"radio",disabled:!!a.attr("disabled"),name:a.attr("label"),radio:a.attr("radiogroup"),value:a.attr("id"),selected:!!a.attr("checked")};break;default:s=void 0}break;case"hr":s="-------";break;case"input":switch(a.attr("type")){case"text":s={type:"text",name:r||n(u),disabled:!!a.attr("disabled"),value:a.val()};break;case"checkbox":s={type:"checkbox",name:r||n(u),disabled:!!a.attr("disabled"),selected:!!a.attr("checked")};break;case"radio":s={type:"radio",name:r||n(u),disabled:!!a.attr("disabled"),radio:!!a.attr("name"),value:a.val(),selected:!!a.attr("checked")};break;default:s=void 0}break;case"select":s={type:"select",name:r||n(u),disabled:!!a.attr("disabled"),selected:a.val(),options:{}},a.children().each(function(){s.options[this.value]=e(this).text()});break;case"textarea":s={type:"textarea",name:r||n(u),disabled:!!a.attr("disabled"),value:a.val()};break;case"label":break;default:s={type:"html",html:a.clone(!0)}}s&&(t["key"+ ++o]=s)}),o}e.support.htmlMenuitem="HTMLMenuItemElement"in window,e.support.htmlCommand="HTMLCommandElement"in window,e.support.eventSelectstart="onselectstart"in document.documentElement,e.ui&&e.widget||(e.cleanData=function(t){return function(n){var i,r,o;for(o=0;null!=(r=n[o]);o++)try{(i=e._data(r,"events"))&&i.remove&&e(r).triggerHandler("remove")}catch(e){}t(n)}}(e.cleanData));var r=null,o=!1,s=e(window),a=0,u={},l={},c={},h={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,classNames:{hover:"hover",disabled:"disabled",visible:"visible",notSelectable:"not-selectable",icon:"icon",iconEdit:"icon-edit",iconCut:"icon-cut",iconCopy:"icon-copy",iconPaste:"icon-paste",iconDelete:"icon-delete",iconAdd:"icon-add",iconQuit:"icon-quit"},determinePosition:function(t){if(e.ui&&e.ui.position)t.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var n=this.offset();n.top+=this.outerHeight(),n.left+=this.outerWidth()/2-t.outerWidth()/2,t.css(n)}},position:function(e,t,n){var i;if(t||n){i="maintain"===t&&"maintain"===n?e.$menu.position():{top:n,left:t};var r=s.scrollTop()+s.height(),o=s.scrollLeft()+s.width(),a=e.$menu.outerHeight(),u=e.$menu.outerWidth();i.top+a>r&&(i.top-=a),i.top<0&&(i.top=0),i.left+u>o&&(i.left-=u),e.$menu.css(i)}else e.determinePosition.call(this,e.$menu)},positionSubmenu:function(t){if(e.ui&&e.ui.position)t.css("display","block").position({my:"left top",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var n={top:0,left:this.outerWidth()};t.css(n)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:e.noop,hide:e.noop},callback:null,items:{}},d={timer:null,pageX:null,pageY:null},p=function(e){for(var t=0,n=e;;)if(t=Math.max(t,parseInt(n.css("z-index"),10)||0),!(n=n.parent())||!n.length||"html body".indexOf(n.prop("nodeName").toLowerCase())>-1)break;return t},f={abortevent:function(e){e.preventDefault(),e.stopImmediatePropagation()},contextmenu:function(t){var n=e(this);if("right"===t.data.trigger&&(t.preventDefault(),t.stopImmediatePropagation()),!("right"!==t.data.trigger&&"demand"!==t.data.trigger&&t.originalEvent||n.hasClass("context-menu-active")||n.hasClass("context-menu-disabled"))){if(r=n,t.data.build){var i=t.data.build(r,t);if(!1===i)return;if(t.data=e.extend(!0,{},h,t.data,i||{}),!t.data.items||e.isEmptyObject(t.data.items))throw window.console&&(console.error||console.log).call(console,"No items specified to show in contextMenu"),new Error("No Items specified");t.data.$trigger=r,g.create(t.data)}var o=!1;for(var s in t.data.items)if(t.data.items.hasOwnProperty(s)){(e.isFunction(t.data.items[s].visible)?t.data.items[s].visible.call(e(t.currentTarget),s,t.data):void 0===s.visible||!0===t.data.items[s].visible)&&(o=!0)}o&&g.show.call(n,t.data,t.pageX,t.pageY)}},click:function(t){t.preventDefault(),t.stopImmediatePropagation(),e(this).trigger(e.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))},mousedown:function(t){var n=e(this);r&&r.length&&!r.is(n)&&r.data("contextMenu").$menu.trigger("contextmenu:hide"),2===t.button&&(r=n.data("contextMenuActive",!0))},mouseup:function(t){var n=e(this);n.data("contextMenuActive")&&r&&r.length&&r.is(n)&&!n.hasClass("context-menu-disabled")&&(t.preventDefault(),t.stopImmediatePropagation(),r=n,n.trigger(e.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))),n.removeData("contextMenuActive")},mouseenter:function(t){var n=e(this),i=e(t.relatedTarget),o=e(document);i.is(".context-menu-list")||i.closest(".context-menu-list").length||r&&r.length||(d.pageX=t.pageX,d.pageY=t.pageY,d.data=t.data,o.on("mousemove.contextMenuShow",f.mousemove),d.timer=setTimeout(function(){d.timer=null,o.off("mousemove.contextMenuShow"),r=n,n.trigger(e.Event("contextmenu",{data:d.data,pageX:d.pageX,pageY:d.pageY}))},t.data.delay))},mousemove:function(e){d.pageX=e.pageX,d.pageY=e.pageY},mouseleave:function(t){var n=e(t.relatedTarget);if(!n.is(".context-menu-list")&&!n.closest(".context-menu-list").length){try{clearTimeout(d.timer)}catch(t){}d.timer=null}},layerClick:function(t){var n,i,r=e(this).data("contextMenuRoot"),o=t.button,a=t.pageX,u=t.pageY;t.preventDefault(),t.stopImmediatePropagation(),setTimeout(function(){var l,c="left"===r.trigger&&0===o||"right"===r.trigger&&2===o;if(document.elementFromPoint&&(r.$layer.hide(),n=document.elementFromPoint(a-s.scrollLeft(),u-s.scrollTop()),r.$layer.show()),r.reposition&&c)if(document.elementFromPoint){if(r.$trigger.is(n)||r.$trigger.has(n).length)return void r.position.call(r.$trigger,r,a,u)}else if(i=r.$trigger.offset(),l=e(window),i.top+=l.scrollTop(),i.top<=t.pageY&&(i.left+=l.scrollLeft(),i.left<=t.pageX&&(i.bottom=i.top+r.$trigger.outerHeight(),i.bottom>=t.pageY&&(i.right=i.left+r.$trigger.outerWidth(),i.right>=t.pageX))))return void r.position.call(r.$trigger,r,a,u);n&&c&&r.$trigger.one("contextmenu:hidden",function(){e(n).contextMenu({x:a,y:u})}),r.$menu.trigger("contextmenu:hide")},50)},keyStop:function(e,t){t.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){var t={};switch(r&&(t=r.data("contextMenu")||{}),e.keyCode){case 9:case 38:if(f.keyStop(e,t),t.isInput){if(9===e.keyCode&&e.shiftKey)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void t.$menu.trigger("prevcommand");if(38===e.keyCode&&"checkbox"===t.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault()}else if(9!==e.keyCode||e.shiftKey)return void t.$menu.trigger("prevcommand");case 40:if(f.keyStop(e,t),!t.isInput)return void t.$menu.trigger("nextcommand");if(9===e.keyCode)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void t.$menu.trigger("nextcommand");if(40===e.keyCode&&"checkbox"===t.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault();break;case 37:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;if(!t.$selected.parent().hasClass("context-menu-root")){var n=t.$selected.parent().parent();return t.$selected.trigger("contextmenu:blur"),void(t.$selected=n)}break;case 39:if(f.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;var i=t.$selected.data("contextMenu")||{};if(i.$menu&&t.$selected.hasClass("context-menu-submenu"))return t.$selected=null,i.$selected=null,void i.$menu.trigger("nextcommand");break;case 35:case 36:return t.$selected&&t.$selected.find("input, textarea, select").length?void 0:((t.$selected&&t.$selected.parent()||t.$menu).children(":not(."+t.classNames.disabled+", ."+t.classNames.notSelectable+")")[36===e.keyCode?"first":"last"]().trigger("contextmenu:focus"),void e.preventDefault());case 13:if(f.keyStop(e,t),t.isInput){if(t.$selected&&!t.$selected.is("textarea, select"))return void e.preventDefault();break}return void(void 0!==t.$selected&&t.$selected.trigger("mouseup"));case 32:case 33:case 34:return void f.keyStop(e,t);case 27:return f.keyStop(e,t),void t.$menu.trigger("contextmenu:hide");default:var o=String.fromCharCode(e.keyCode).toUpperCase();if(t.accesskeys&&t.accesskeys[o])return void t.accesskeys[o].$node.trigger(t.accesskeys[o].$menu?"contextmenu:focus":"mouseup")}e.stopPropagation(),void 0!==t.$selected&&t.$selected.trigger(e)},prevItem:function(t){t.stopPropagation();var n=e(this).data("contextMenu")||{},i=e(this).data("contextMenuRoot")||{};if(n.$selected){var r=n.$selected;(n=n.$selected.parent().data("contextMenu")||{}).$selected=r}for(var o=n.$menu.children(),s=n.$selected&&n.$selected.prev().length?n.$selected.prev():o.last(),a=s;s.hasClass(i.classNames.disabled)||s.hasClass(i.classNames.notSelectable);)if((s=s.prev().length?s.prev():o.last()).is(a))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(s.get(0),t);var u=s.find("input, textarea, select");u.length&&u.focus()},nextItem:function(t){t.stopPropagation();var n=e(this).data("contextMenu")||{},i=e(this).data("contextMenuRoot")||{};if(n.$selected){var r=n.$selected;(n=n.$selected.parent().data("contextMenu")||{}).$selected=r}for(var o=n.$menu.children(),s=n.$selected&&n.$selected.next().length?n.$selected.next():o.first(),a=s;s.hasClass(i.classNames.disabled)||s.hasClass(i.classNames.notSelectable);)if((s=s.next().length?s.next():o.first()).is(a))return;n.$selected&&f.itemMouseleave.call(n.$selected.get(0),t),f.itemMouseenter.call(s.get(0),t);var u=s.find("input, textarea, select");u.length&&u.focus()},focusInput:function(){var t=e(this).closest(".context-menu-item"),n=t.data(),i=n.contextMenu,r=n.contextMenuRoot;r.$selected=i.$selected=t,r.isInput=i.isInput=!0},blurInput:function(){var t=e(this).closest(".context-menu-item").data(),n=t.contextMenu;t.contextMenuRoot.isInput=n.isInput=!1},menuMouseenter:function(){e(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(t){var n=e(this).data().contextMenuRoot;n.$layer&&n.$layer.is(t.relatedTarget)&&(n.hovering=!1)},itemMouseenter:function(t){var n=e(this),i=n.data(),r=i.contextMenu,o=i.contextMenuRoot;o.hovering=!0,t&&o.$layer&&o.$layer.is(t.relatedTarget)&&(t.preventDefault(),t.stopImmediatePropagation()),(r.$menu?r:o).$menu.children(".hover").trigger("contextmenu:blur"),n.hasClass(o.classNames.disabled)||n.hasClass(o.classNames.notSelectable)?r.$selected=null:n.trigger("contextmenu:focus")},itemMouseleave:function(t){var n=e(this),i=n.data(),r=i.contextMenu,o=i.contextMenuRoot;if(o!==r&&o.$layer&&o.$layer.is(t.relatedTarget))return void 0!==o.$selected&&o.$selected.trigger("contextmenu:blur"),t.preventDefault(),t.stopImmediatePropagation(),void(o.$selected=r.$selected=r.$node);n.trigger("contextmenu:blur")},itemClick:function(t){var n,i=e(this),r=i.data(),o=r.contextMenu,s=r.contextMenuRoot,a=r.contextMenuKey;if(o.items[a]&&!i.is("."+s.classNames.disabled+", .context-menu-submenu, .context-menu-separator, ."+s.classNames.notSelectable)){if(t.preventDefault(),t.stopImmediatePropagation(),e.isFunction(s.callbacks[a])&&Object.prototype.hasOwnProperty.call(s.callbacks,a))n=s.callbacks[a];else{if(!e.isFunction(s.callback))return;n=s.callback}!1!==n.call(s.$trigger,a,s)?s.$menu.trigger("contextmenu:hide"):s.$menu.parent().length&&g.update.call(s.$trigger,s)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(t,n){var i=e(this).data("contextMenuRoot");g.hide.call(i.$trigger,i,n&&n.force)},focusItem:function(t){t.stopPropagation();var n=e(this),i=n.data(),r=i.contextMenu,o=i.contextMenuRoot;n.addClass([o.classNames.hover,o.classNames.visible].join(" ")).siblings().removeClass(o.classNames.visible).filter(o.classNames.hover).trigger("contextmenu:blur"),r.$selected=o.$selected=n,r.$node&&o.positionSubmenu.call(r.$node,r.$menu)},blurItem:function(t){t.stopPropagation();var n=e(this),i=n.data(),r=i.contextMenu,o=i.contextMenuRoot;r.autoHide&&n.removeClass(o.classNames.visible),n.removeClass(o.classNames.hover),r.$selected=null}},g={show:function(t,n,i){var o=e(this),s={};e("#context-menu-layer").trigger("mousedown"),t.$trigger=o,!1!==t.events.show.call(o,t)?(g.update.call(o,t),t.position.call(o,t,n,i),t.zIndex&&(s.zIndex=p(o)+t.zIndex),g.layer.call(t.$menu,t,s.zIndex),t.$menu.find("ul").css("zIndex",s.zIndex+1),t.$menu.css(s)[t.animation.show](t.animation.duration,function(){o.trigger("contextmenu:visible")}),o.data("contextMenu",t).addClass("context-menu-active"),e(document).off("keydown.contextMenu").on("keydown.contextMenu",f.key),t.autoHide&&e(document).on("mousemove.contextMenuAutoHide",function(e){var n=o.offset();n.right=n.left+o.outerWidth(),n.bottom=n.top+o.outerHeight(),!t.$layer||t.hovering||e.pageX>=n.left&&e.pageX<=n.right&&e.pageY>=n.top&&e.pageY<=n.bottom||t.$menu.trigger("contextmenu:hide")})):r=null},hide:function(t,n){var i=e(this);if(t||(t=i.data("contextMenu")||{}),n||!t.events||!1!==t.events.hide.call(i,t)){if(i.removeData("contextMenu").removeClass("context-menu-active"),t.$layer){setTimeout(function(e){return function(){e.remove()}}(t.$layer),10);try{delete t.$layer}catch(e){t.$layer=null}}r=null,t.$menu.find("."+t.classNames.hover).trigger("contextmenu:blur"),t.$selected=null,e(document).off(".contextMenuAutoHide").off("keydown.contextMenu"),t.$menu&&t.$menu[t.animation.hide](t.animation.duration,function(){t.build&&(t.$menu.remove(),e.each(t,function(e){switch(e){case"ns":case"selector":case"build":case"trigger":return!0;default:t[e]=void 0;try{delete t[e]}catch(e){}return!0}})),setTimeout(function(){i.trigger("contextmenu:hidden")},10)})}},create:function(n,i){void 0===i&&(i=n),n.$menu=e('<ul class="context-menu-list"></ul>').addClass(n.className||"").data({contextMenu:n,contextMenuRoot:i}),e.each(["callbacks","commands","inputs"],function(e,t){n[t]={},i[t]||(i[t]={})}),i.accesskeys||(i.accesskeys={}),e.each(n.items,function(r,o){var s=e('<li class="context-menu-item"></li>').addClass(o.className||""),a=null,u=null;if(s.on("click",e.noop),"string"==typeof o&&(o={type:"cm_seperator"}),o.$node=s.data({contextMenu:n,contextMenuRoot:i,contextMenuKey:r}),void 0!==o.accesskey)for(var l,h=t(o.accesskey),d=0;l=h[d];d++)if(!i.accesskeys[l]){i.accesskeys[l]=o,o._name=o.name.replace(new RegExp("("+l+")","i"),'<span class="context-menu-accesskey">$1</span>');break}if(o.type&&c[o.type])c[o.type].call(s,o,n,i),e.each([n,i],function(t,n){n.commands[r]=o,e.isFunction(o.callback)&&(n.callbacks[r]=o.callback)});else{switch("cm_seperator"===o.type?s.addClass("context-menu-separator "+n.classNames.notSelectable):"html"===o.type?s.addClass("context-menu-html "+n.classNames.notSelectable):o.type?(a=e("<label></label>").appendTo(s),e("<span></span>").html(o._name||o.name).appendTo(a),s.addClass("context-menu-input"),n.hasTypes=!0,e.each([n,i],function(e,t){t.commands[r]=o,t.inputs[r]=o})):o.items&&(o.type="sub"),o.type){case"seperator":break;case"text":u=e('<input type="text" value="1" name="" />').attr("name","context-menu-input-"+r).val(o.value||"").appendTo(a);break;case"textarea":u=e('<textarea name=""></textarea>').attr("name","context-menu-input-"+r).val(o.value||"").appendTo(a),o.height&&u.height(o.height);break;case"checkbox":u=e('<input type="checkbox" value="1" name="" />').attr("name","context-menu-input-"+r).val(o.value||"").prop("checked",!!o.selected).prependTo(a);break;case"radio":u=e('<input type="radio" value="1" name="" />').attr("name","context-menu-input-"+o.radio).val(o.value||"").prop("checked",!!o.selected).prependTo(a);break;case"select":u=e('<select name=""></select>').attr("name","context-menu-input-"+r).appendTo(a),o.options&&(e.each(o.options,function(t,n){e("<option></option>").val(t).text(n).appendTo(u)}),u.val(o.selected));break;case"sub":e("<span></span>").html(o._name||o.name).appendTo(s),o.appendTo=o.$node,g.create(o,i),s.data("contextMenu",o).addClass("context-menu-submenu"),o.callback=null;break;case"html":e(o.html).appendTo(s);break;default:e.each([n,i],function(t,n){n.commands[r]=o,e.isFunction(o.callback)&&(n.callbacks[r]=o.callback)}),e("<span></span>").html(o._name||o.name||"").appendTo(s)}o.type&&"sub"!==o.type&&"html"!==o.type&&"cm_seperator"!==o.type&&(u.on("focus",f.focusInput).on("blur",f.blurInput),o.events&&u.on(o.events,n)),o.icon&&(e.isFunction(o.icon)?o._icon=o.icon.call(this,s,r,o):o._icon=n.classNames.icon+" "+n.classNames.icon+"-"+o.icon,s.addClass(o._icon))}o.$input=u,o.$label=a,s.appendTo(n.$menu),!n.hasTypes&&e.support.eventSelectstart&&s.on("selectstart.disableTextSelect",f.abortevent)}),n.$node||n.$menu.css("display","none").addClass("context-menu-root"),n.$menu.appendTo(n.appendTo||document.body)},resize:function(t,n){t.css({position:"absolute",display:"block"}),t.data("width",Math.ceil(t.width())),t.css({position:"static",minWidth:"0px",maxWidth:"100000px"}),t.find("> li > ul").each(function(){g.resize(e(this),!0)}),n||t.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).width(function(){return e(this).data("width")})},update:function(t,n){var i=this;void 0===n&&(n=t,g.resize(t.$menu)),t.$menu.children().each(function(){var r,o=e(this),s=o.data("contextMenuKey"),a=t.items[s],u=e.isFunction(a.disabled)&&a.disabled.call(i,s,n)||!0===a.disabled;if(r=e.isFunction(a.visible)?a.visible.call(i,s,n):void 0===a.visible||!0===a.visible,o[r?"show":"hide"](),o[u?"addClass":"removeClass"](n.classNames.disabled),e.isFunction(a.icon)&&(o.removeClass(a._icon),a._icon=a.icon.call(this,i,s,a),o.addClass(a._icon)),a.type)switch(o.find("input, select, textarea").prop("disabled",u),a.type){case"text":case"textarea":a.$input.val(a.value||"");break;case"checkbox":case"radio":a.$input.val(a.value||"").prop("checked",!!a.selected);break;case"select":a.$input.val(a.selected||"")}a.$menu&&g.update.call(i,a,n)})},layer:function(t,n){var i=t.$layer=e('<div id="context-menu-layer" style="position:fixed; z-index:'+n+'; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>').css({height:s.height(),width:s.width(),display:"block"}).data("contextMenuRoot",t).insertBefore(this).on("contextmenu",f.abortevent).on("mousedown",f.layerClick);return void 0===document.body.style.maxWidth&&i.css({position:"absolute",height:e(document).height()}),i}};e.fn.contextMenu=function(t){var n=this,i=t;if(this.length>0)if(void 0===t)this.first().trigger("contextmenu");else if(void 0!==t.x&&void 0!==t.y)this.first().trigger(e.Event("contextmenu",{pageX:t.x,pageY:t.y}));else if("hide"===t){var r=this.first().data("contextMenu")?this.first().data("contextMenu").$menu:null;r&&r.trigger("contextmenu:hide")}else"destroy"===t?e.contextMenu("destroy",{context:this}):e.isPlainObject(t)?(t.context=this,e.contextMenu("create",t)):t?this.removeClass("context-menu-disabled"):t||this.addClass("context-menu-disabled");else e.each(l,function(){this.selector===n.selector&&(i.data=this,e.extend(i.data,{trigger:"demand"}))}),f.contextmenu.call(i.target,i);return this},e.contextMenu=function(t,n){"string"!=typeof t&&(n=t,t="create"),"string"==typeof n?n={selector:n}:void 0===n&&(n={});var i=e.extend(!0,{},h,n||{}),r=e(document),s=r,c=!1;switch(i.context&&i.context.length?(s=e(i.context).first(),i.context=s.get(0),c=i.context!==document):i.context=document,t){case"create":if(!i.selector)throw new Error("No selector specified");if(i.selector.match(/.context-menu-(list|item|input)($|\s)/))throw new Error('Cannot bind to selector "'+i.selector+'" as it contains a reserved className');if(!i.build&&(!i.items||e.isEmptyObject(i.items)))throw new Error("No Items specified");switch(a++,i.ns=".contextMenu"+a,c||(u[i.selector]=i.ns),l[i.ns]=i,i.trigger||(i.trigger="right"),o||(r.on({"contextmenu:hide.contextMenu":f.hideMenu,"prevcommand.contextMenu":f.prevItem,"nextcommand.contextMenu":f.nextItem,"contextmenu.contextMenu":f.abortevent,"mouseenter.contextMenu":f.menuMouseenter,"mouseleave.contextMenu":f.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",f.inputClick).on({"mouseup.contextMenu":f.itemClick,"contextmenu:focus.contextMenu":f.focusItem,"contextmenu:blur.contextMenu":f.blurItem,"contextmenu.contextMenu":f.abortevent,"mouseenter.contextMenu":f.itemMouseenter,"mouseleave.contextMenu":f.itemMouseleave},".context-menu-item"),o=!0),s.on("contextmenu"+i.ns,i.selector,i,f.contextmenu),c&&s.on("remove"+i.ns,function(){e(this).contextMenu("destroy")}),i.trigger){case"hover":s.on("mouseenter"+i.ns,i.selector,i,f.mouseenter).on("mouseleave"+i.ns,i.selector,i,f.mouseleave);break;case"left":s.on("click"+i.ns,i.selector,i,f.click)}i.build||g.create(i);break;case"destroy":var d;if(c){var p=i.context;e.each(l,function(t,n){if(n.context!==p)return!0;(d=e(".context-menu-list").filter(":visible")).length&&d.data().contextMenuRoot.$trigger.is(e(n.context).find(n.selector))&&d.trigger("contextmenu:hide",{force:!0});try{l[n.ns].$menu&&l[n.ns].$menu.remove(),delete l[n.ns]}catch(e){l[n.ns]=null}return e(n.context).off(n.ns),!0})}else if(i.selector){if(u[i.selector]){(d=e(".context-menu-list").filter(":visible")).length&&d.data().contextMenuRoot.$trigger.is(i.selector)&&d.trigger("contextmenu:hide",{force:!0});try{l[u[i.selector]].$menu&&l[u[i.selector]].$menu.remove(),delete l[u[i.selector]]}catch(e){l[u[i.selector]]=null}r.off(u[i.selector])}}else r.off(".contextMenu .contextMenuAutoHide"),e.each(l,function(t,n){e(n.context).off(n.ns)}),u={},l={},a=0,o=!1,e("#context-menu-layer, .context-menu-list").remove();break;case"html5":(!e.support.htmlCommand&&!e.support.htmlMenuitem||"boolean"==typeof n&&n)&&e('menu[type="context"]').each(function(){this.id&&e.contextMenu({selector:"[contextmenu="+this.id+"]",items:e.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw new Error('Unknown operation "'+t+'"')}return this},e.contextMenu.setInputValues=function(t,n){void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case"text":case"textarea":t.value=n[e]||"";break;case"checkbox":t.selected=!!n[e];break;case"radio":t.selected=(n[t.radio]||"")===t.value;break;case"select":t.selected=n[e]||""}})},e.contextMenu.getInputValues=function(t,n){return void 0===n&&(n={}),e.each(t.inputs,function(e,t){switch(t.type){case"text":case"textarea":case"select":n[e]=t.$input.val();break;case"checkbox":n[e]=t.$input.prop("checked");break;case"radio":t.$input.prop("checked")&&(n[t.radio]=t.value)}}),n},e.contextMenu.fromMenu=function(t){var n={};return i(n,e(t).children()),n},e.contextMenu.defaults=h,e.contextMenu.types=c,e.contextMenu.handle=f,e.contextMenu.op=g,e.contextMenu.menus=l}),define("lib/jquery.fullscreen-min",["jquery"],function(e){function t(e){var t,n;return this.length?(t=this[0],t.ownerDocument?n=t.ownerDocument:(n=t,t=n.documentElement),null==e?n.exitFullscreen||n.webkitExitFullscreen||n.webkitCancelFullScreen||n.msExitFullscreen||n.mozCancelFullScreen?(e=!!(n.fullscreenElement||n.msFullscreenElement||n.webkitIsFullScreen||n.mozFullScreen),e?n.fullscreenElement||n.webkitFullscreenElement||n.webkitCurrentFullScreenElement||n.msFullscreenElement||n.mozFullScreenElement||e:e):null:(e?(e=t.requestFullscreen||t.webkitRequestFullscreen||t.webkitRequestFullScreen||t.msRequestFullscreen||t.mozRequestFullScreen)&&e.call(t):(e=n.exitFullscreen||n.webkitExitFullscreen||n.webkitCancelFullScreen||n.msExitFullscreen||n.mozCancelFullScreen)&&e.call(n),this)):this}e.fn.fullScreen=t,e.fn.toggleFullScreen=function(){return t.call(this,!t.call(this))};var n,i,r;(n=document).webkitCancelFullScreen?(i="webkitfullscreenchange",r="webkitfullscreenerror"):n.msExitFullscreen?(i="MSFullscreenChange",r="MSFullscreenError"):n.mozCancelFullScreen?(i="mozfullscreenchange",r="mozfullscreenerror"):(i="fullscreenchange",r="fullscreenerror"),e(document).bind(i,function(){e(document).trigger(new e.Event("fullscreenchange"))}),e(document).bind(r,function(){e(document).trigger(new e.Event("fullscreenerror"))})}),define("cobweb/Browser/Core/ContextMenu",["jquery","cobweb/Basic/X3DBaseNode","lib/gettext","lib/jquery-contextMenu/dist/jquery.contextMenu","lib/jquery.fullscreen-min"],function(e,t,n){function i(e){t.call(this,e)}return e("head").append('<style>.cobweb-menu-title:before { content: "'+n("Cobweb X3D Browser")+'" }</style>'),i.prototype=e.extend(Object.create(t.prototype),{constructor:i,getTypeName:function(){return"ContextMenu"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"contextMenu"},initialize:function(){t.prototype.initialize.call(this),this.getBrowser().getBrowserOptions().getContextMenu()&&e.contextMenu({selector:".cobweb-surface-"+this.getBrowser().getId(),build:this.build.bind(this)})},build:function(t,i){var r=this.getBrowser().getActiveLayer(),o=r?r.getViewpoint():null,s=this.getBrowser().viewer_.getValue(),a=this.getBrowser().getElement().fullScreen(),u={className:"cobweb-menu cobweb-menu-title",items:{separator0:"--------",viewpoints:{name:n("Viewpoints"),className:"context-menu-icon cobweb-icon-viewpoint",items:this.getViewpoints(),callback:function(t){t&&(e(".context-menu-list").fadeOut(500),this.getBrowser().bindViewpoint(t),this.getBrowser().getCanvas().focus())}.bind(this,o)},separator1:"--------",viewer:{name:n(this.getViewerName(s)),className:"context-menu-icon cobweb-icon-"+s.toLowerCase()+"-viewer",callback:function(t){e(".context-menu-list").fadeOut(500),this.getBrowser().viewer_=t,this.getBrowser().getNotification().string_=n(this.getViewerName(t)),this.getBrowser().getCanvas().focus()}.bind(this,s)},"available-viewer":{name:n("Available Viewers"),items:this.getAvailableViewers()},separator2:"--------","primitive-quality":{name:n("Primitive Quality"),className:"context-menu-icon cobweb-icon-primitive-quality",items:{high:{name:n("High"),type:"radio",radio:"primitive-quality",selected:"HIGH"===this.getBrowser().getBrowserOption("PrimitiveQuality"),events:{click:function(){this.getBrowser().setBrowserOption("PrimitiveQuality","HIGH"),this.getBrowser().getNotification().string_=n("Primitive Quality")+": "+n("high")}.bind(this)}},medium:{name:n("Medium"),type:"radio",radio:"primitive-quality",selected:"MEDIUM"===this.getBrowser().getBrowserOption("PrimitiveQuality"),events:{click:function(){this.getBrowser().setBrowserOption("PrimitiveQuality","MEDIUM"),this.getBrowser().getNotification().string_=n("Primitive Quality")+": "+n("medium")}.bind(this)}},low:{name:n("Low"),type:"radio",radio:"primitive-quality",selected:"LOW"===this.getBrowser().getBrowserOption("PrimitiveQuality"),events:{click:function(){this.getBrowser().setBrowserOption("PrimitiveQuality","LOW"),this.getBrowser().getNotification().string_=n("Primitive Quality")+": "+n("low")}.bind(this)}}}},"texture-quality":{name:n("Texture Quality"),className:"context-menu-icon cobweb-icon-texture-quality",items:{high:{name:n("High"),type:"radio",radio:"texture-quality",selected:"HIGH"===this.getBrowser().getBrowserOption("TextureQuality"),events:{click:function(){this.getBrowser().setBrowserOption("TextureQuality","HIGH"),this.getBrowser().getNotification().string_=n("Texture Quality")+": "+n("high")}.bind(this)}},medium:{name:n("Medium"),type:"radio",radio:"texture-quality",selected:"MEDIUM"===this.getBrowser().getBrowserOption("TextureQuality"),events:{click:function(){this.getBrowser().setBrowserOption("TextureQuality","MEDIUM"),this.getBrowser().getNotification().string_=n("Texture Quality")+": "+n("medium")}.bind(this)}},low:{name:n("Low"),type:"radio",radio:"texture-quality",selected:"LOW"===this.getBrowser().getBrowserOption("TextureQuality"),events:{click:function(){this.getBrowser().setBrowserOption("TextureQuality","LOW"),this.getBrowser().getNotification().string_=n("Texture Quality")+": "+n("low")}.bind(this)}}}},"display-rubberband":{name:n("Display Rubberband"),type:"checkbox",selected:this.getBrowser().getBrowserOption("Rubberband"),events:{click:function(){var e=!this.getBrowser().getBrowserOption("Rubberband");this.getBrowser().setBrowserOption("Rubberband",e),this.getBrowser().getNotification().string_=e?n("Rubberband")+": "+n("on"):n("Rubberband")+": "+n("off")}.bind(this)}},"browser-timings":this.getBrowser().getBrowserOptions().getTimings()?{name:n("Browser Timings"),type:"checkbox",selected:this.getBrowser().getBrowserTimings().enabled_.getValue(),events:{click:function(){this.getBrowser().getBrowserTimings().enabled_=!this.getBrowser().getBrowserTimings().enabled_.getValue(),this.getBrowser().getCanvas().focus()}.bind(this)}}:void 0,"mute-browser":{name:n("Mute Browser"),type:"checkbox",selected:this.getBrowser().mute_.getValue(),events:{click:function(){var e=!this.getBrowser().mute_.getValue();this.getBrowser().mute_=e,this.getBrowser().getNotification().string_=n(e?"Browser muted":"Browser unmuted")}.bind(this)}},fullscreen:{name:n(a?"Leave Fullscreen":"Fullscreen"),className:"context-menu-icon "+(a?"cobweb-icon-leave-fullscreen":"cobweb-icon-fullscreen"),callback:function(){this.getBrowser().getElement().toggleFullScreen()}.bind(this)},separator3:"--------",about:{name:n("About Cobweb"),className:"context-menu-icon cobweb-icon-help-about",callback:function(){window.open("http://titania.create3000.de/cobweb")}}}};return e.isEmptyObject(u.items.viewpoints.items)&&(delete u.items.separator0,delete u.items.viewpoints),u},getViewpoints:function(){var t=this.getBrowser().getActiveLayer();if(!t)return{};for(var n=t.getViewpoints().get(),i=t.getViewpoint(),r={},o=0;o<n.length;++o){var s=n[o],a=s.description_.getValue();if(""!==a){var u={name:a,callback:function(t){e(".context-menu-list").fadeOut(500),this.getBrowser().bindViewpoint(t),this.getBrowser().getCanvas().focus()}.bind(this,s)};s===i&&(u.className="context-menu-selected"),r["Viewpoint"+s.getId()]=u}}return r},getAvailableViewers:function(){for(var t=this.getBrowser().viewer_.getValue(),i=this.getBrowser().availableViewers_,r={},o=0;o<i.length;++o){var s=i[o];r[s]={name:n(this.getViewerName(s)),className:"context-menu-icon cobweb-icon-"+s.toLowerCase()+"-viewer",callback:function(t){e(".context-menu-list").fadeOut(500),this.getBrowser().viewer_=t,this.getBrowser().getNotification().string_=n(this.getViewerName(t)),this.getBrowser().getCanvas().focus()}.bind(this,s)},s===t&&(r[s].className+=" context-menu-selected")}return r},getViewerName:function(e){switch(e){case"EXAMINE":return n("Examine Viewer");case"WALK":return n("Walk Viewer");case"FLY":return n("Fly Viewer");case"PLANE":return n("Plane Viewer");case"LOOKAT":return n("Look At Viewer");case"NONE":return n("None Viewer")}}}),i}),define("cobweb/Configuration/X3DInfoArray",["jquery"],function(e){function t(){return this.array=[],this.index={},new Proxy(this,n)}var n={get:function(e,t){return t in e?e[t]:t in e.array?e.array[t]:e.index[t]},set:function(e,t,n){return!1},has:function(e,t){return t in e.array||t in e.index},enumerate:function(e){return Object.keys(e.array)[Symbol.iterator]()}};return e.extend(t.prototype,{constructor:t,add:function(e,t){this.array.push(t),this.index[e]=t},get:function(e){return this.index[e]},getValue:function(){return this.array},toXMLStream:function(e){for(var t=this.array,n=0,i=t.length;n<i;++n)try{t[n].toXMLStream(e),e.string+="\n"}catch(e){}}}),t}),define("cobweb/Configuration/ComponentInfo",["jquery","cobweb/Fields","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i){function r(e,t){this.name=t.name,this.level=t.level,this.title=t.title,this.providerUrl=t.providerUrl,Object.preventExtensions(this),Object.freeze(this),Object.seal(this)}return e.extend(r.prototype,{constructor:r,toXMLStream:function(e){e.string+=i.Indent(),e.string+="<component",e.string+=" ",e.string+="name='",e.string+=this.name,e.string+="'",e.string+=" ",e.string+="level='",e.string+=this.level,e.string+="'",e.string+="/>"}}),r}),define("cobweb/Configuration/ComponentInfoArray",["jquery","cobweb/Configuration/X3DInfoArray","cobweb/Configuration/ComponentInfo"],function(e,t,n){function i(e,n){this.browser=e;var i=t.call(this);if(n)for(var r=0,o=n.length;r<o;++r)this.add(n[r].name,n[r]);return i}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,addComponentInfo:function(e){this.add(e.name,new n(this.browser,e))}}),i}),define("cobweb/Execution/ImportedNode",["jquery","cobweb/Fields","cobweb/Basic/X3DBaseNode","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i,r){function o(e,t,i,r){n.call(this,e),this.inlineNode=t,this.exportedName=i,this.importedName=r,this.routes={},this.inlineNode.loadState_.addInterest("set_loadState__",this)}return o.prototype=e.extend(Object.create(n.prototype),{constructor:o,getTypeName:function(){return"ImportedNode"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"importedNodes"},getInlineNode:function(){return this.inlineNode},getExportedName:function(){return this.exportedName},getExportedNode:function(){return this.inlineNode.getInternalScene().getExportedNode(this.exportedName)},getImportedName:function(){return this.importedName},addRoute:function(e,t,n,r){var o=e.getId()+"."+t+" "+n.getId()+"."+r;if(this.routes[o]={sourceNode:e,sourceField:t,destinationNode:n,destinationField:r},this.inlineNode.checkLoadState()===i.COMPLETE_STATE)return this.resolveRoute(o)},resolveRoute:function(e){try{var n=this.routes[e],i=n.sourceNode,r=n.sourceField,s=n.destinationNode,a=n.destinationField;return n._route&&n._route.dispose(),i instanceof o&&(i=i.getExportedNode().getValue()),s instanceof o&&(s=s.getExportedNode().getValue()),n._route=this.getExecutionContext().addRoute(new t.SFNode(i),r,new t.SFNode(s),a)}catch(e){console.error(e.message)}},deleteRoutes:function(){var e=this.routes;for(var t in e){var n=e[t];n._route&&(this.getExecutionContext().deleteRoute(n._route),delete n._route)}},set_loadState__:function(){switch(this.inlineNode.checkLoadState()){case i.NOT_STARTED_STATE:case i.FAILED_STATE:this.deleteRoutes();break;case i.COMPLETE_STATE:this.deleteRoutes();try{var e=this.routes;for(var t in e)this.resolveRoute(t)}catch(e){console.error(e)}}},toXMLStream:function(e){if(!r.ExistsNode(this.getInlineNode()))throw new Error("ImportedNode.toXMLStream: Inline node does not exist.");e.string+=r.Indent(),e.string+="<IMPORT",e.string+=" ",e.string+="inlineDEF='",e.string+=r.XMLEncode(r.Name(this.getInlineNode())),e.string+="'",e.string+=" ",e.string+="exportedDEF='",e.string+=r.XMLEncode(this.getExportedName()),e.string+="'",this.getImportedName()!==this.getExportedName()&&(e.string+=" ",e.string+="AS='",e.string+=r.XMLEncode(this.getImportedName()),e.string+="'"),e.string+="/>";try{r.AddRouteNode(this),r.AddImportedNode(this.getExportedNode(),this.getImportedName())}catch(d){var t=this.routes;for(var n in t){var i=t[n],s=i.sourceNode,a=i.sourceField,u=i.destinationNode,l=i.destinationField;if(r.ExistsRouteNode(s)&&r.ExistsRouteNode(u)){if(s instanceof o)h=s.getImportedName();else h=s.getName();if(u instanceof o)var c=u.getImportedName();else var h=u.getName();e.string+="\n",e.string+=r.Indent(),e.string+="<ROUTE",e.string+=" ",e.string+="fromNode='",e.string+=r.XMLEncode(h),e.string+="'",e.string+=" ",e.string+="fromField='",e.string+=r.XMLEncode(a),e.string+="'",e.string+=" ",e.string+="toNode='",e.string+=r.XMLEncode(c),e.string+="'",e.string+=" ",e.string+="toField='",e.string+=r.XMLEncode(l),e.string+="'",e.string+="/>"}}}},dispose:function(){this.inlineNode.loadState_.removeInterest("set_loadState__",this),this.deleteRoutes(),n.prototype.dispose.call(this)}}),o}),define("cobweb/Prototype/ExternProtoDeclarationArray",["jquery","cobweb/Configuration/X3DInfoArray"],function(e,t){function n(e){return t.call(this)}return n.prototype=e.extend(Object.create(t.prototype),{constructor:n}),n}),define("cobweb/Prototype/ProtoDeclarationArray",["jquery","cobweb/Configuration/X3DInfoArray"],function(e,t){function n(e){return t.call(this)}return n.prototype=e.extend(Object.create(t.prototype),{constructor:n}),n}),define("cobweb/Routing/RouteArray",["jquery"],function(e){function t(){return this.array=[],new Proxy(this,n)}var n={get:function(e,t){return t in e?e[t]:e.array[t]},set:function(e,t,n){return!1}};return e.extend(t.prototype,{constructor:t,getValue:function(){return this.array},toXMLStream:function(e){for(var t=this.array,n=0,i=t.length;n<i;++n)try{t[n].toXMLStream(e),e.string+="\n"}catch(e){}}}),t}),define("cobweb/Routing/X3DRoute",["jquery","cobweb/Fields","cobweb/Basic/X3DBaseNode","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i,r){function o(e,i,r,o,s){n.call(this,e),this.addChildObjects("sourceNode",new t.SFNode(i),"destinationNode",new t.SFNode(o)),this._sourceField=r,this._destinationField=s,r.addFieldInterest(s),r.addOutputRoute(this),s.addInputRoute(this)}return o.prototype=e.extend(Object.create(n.prototype),{getTypeName:function(){return"X3DRoute"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"routes"},initialize:function(){n.prototype.initialize.call(this),this.sourceNode_.addInterest("set_node",this),this.destinationNode_.addInterest("set_node",this)},set_node:function(){this.sourceNode_.getValue()&&this.destinationNode_.getValue()||this.dispose()},disconnect:function(){this._sourceField.removeFieldInterest(this._destinationField),this._sourceField.removeOutputRoute(this),this._destinationField.removeInputRoute(this),this.sourceNode_.getValue()&&this.sourceNode_.removeInterest("set_node",this),this.destinationNode_.getValue()&&this.destinationNode_.removeInterest("set_node",this)},getSourceNode:function(){return this.sourceNode_.getValue()},getSourceField:function(){return this._sourceField.getName()},getDestinationNode:function(){return this.destinationNode_.getValue()},getDestinationField:function(){return this._destinationField.getName()},toString:function(){return Object.prototype.toString(this)},toXMLStream:function(e){var t=r.LocalName(this.getSourceNode()),n=r.LocalName(this.getDestinationNode());e.string+=r.Indent(),e.string+="<ROUTE",e.string+=" ",e.string+="fromNode='",e.string+=r.XMLEncode(t),e.string+="'",e.string+=" ",e.string+="fromField='",e.string+=r.XMLEncode(this._sourceField.getName()),this._sourceField.getAccessType()===i.inputOutput&&(e.string+="_changed"),e.string+="'",e.string+=" ",e.string+="toNode='",e.string+=r.XMLEncode(n),e.string+="'",e.string+=" ",e.string+="toField='",this._destinationField.getAccessType()===i.inputOutput&&(e.string+="set_"),e.string+=r.XMLEncode(this._destinationField.getName()),e.string+="'",e.string+="/>"},dispose:function(){this.disconnect(),this.getExecutionContext().deleteRoute(this),n.prototype.dispose.call(this)}}),Object.defineProperty(o.prototype,"sourceNode",{get:function(){return this.sourceNode_.clone()},enumerable:!0,configurable:!1}),Object.defineProperty(o.prototype,"sourceField",{get:function(){return this._sourceField.getName()},enumerable:!0,configurable:!1}),Object.defineProperty(o.prototype,"destinationNode",{get:function(){return this.destinationNode_.clone()},enumerable:!0,configurable:!1}),Object.defineProperty(o.prototype,"destinationField",{get:function(){return this._destinationField.getName()},enumerable:!0,configurable:!1}),o}),define("cobweb/Bits/X3DCast",["cobweb/Fields"],function(e){return function(t,n){try{if(n&&(n instanceof e.SFNode&&(n=n.getValue()),n&&-1!==(n=n.getInnerNode()).getType().indexOf(t)))return n}catch(e){}return null}}),define("standard/Networking/URI",["jquery"],function(e){function t(e,t){switch(arguments.length){case 2:this.value=e.split(t),this.value.separator=t,this.value.leadingSeparator=!1,this.value.trailingSeparator=!1,this.value.length&&""===this.value[0]&&(this.value.shift(),this.value.leadingSeparator=!0),this.value.length&&""===this.value[this.value.length-1]&&(this.value.pop(),this.value.trailingSeparator=!0);break;case 4:this.value=arguments[0],this.value.separator=arguments[1],this.value.leadingSeparator=arguments[2],this.value.trailingSeparator=arguments[3]}}function n(e,t){var n=s.exec(t);n&&(e.scheme=n[1]||"",e.slashs=n[2]||"",e.authority=n[3]||"",e.path=n[4]||"",e.query=n[5]||"",e.fragment=n[6]||"",(n=a.exec(e.authority))&&(e.host=n[1]||"",e.port=n[2]?parseInt(n[2]):0,e.authority=e.host,e.port&&(e.authority+=":"+e.port)),e.absolute=Boolean(e.slashs.length)||"/"===e.path[0],e.local=/^(?:file|data)$/.test(e.scheme)||!e.scheme&&!e.authority),e.string=t}function i(e){return new t(e,"/").removeDotSegments().toString()}function r(e){switch(this.value={local:!0,absolute:!0,scheme:"",slashs:"",authority:"",host:"",port:0,path:"",query:"",fragment:"",string:""},arguments.length){case 0:break;case 1:n(this.value,e);break;case 10:this.value.local=arguments[0],this.value.absolute=arguments[1],this.value.scheme=arguments[2],this.value.slashs=arguments[3],this.value.authority=arguments[4],this.value.host=arguments[5],this.value.port=arguments[6],this.value.path=arguments[7],this.value.query=arguments[8],this.value.fragment=arguments[9],this.value.string=this.toString()}}t.prototype={copy:function(){return new t(this.value.slice(0,this.value.length),this.value.separator,this.value.leadingSeparator,this.value.trailingSeparator)},get origin(){return new t([],this.value.separator,!0,!1)},get base(){return this.value.trailingSeparator?this.copy():this.parent},get parent(){switch(this.value.length){case 0:case 1:return this.value.leadingSeparator?this.origin:new t([".."],this.value.separator,!1,!1);default:return new t(this.value.slice(0,this.value.length-1),this.value.separator,this.value.leadingSeparator,!0)}},isRelative:function(){return!this.value.length||".."==this.value[0]},getRelativePath:function(e){if(this.isRelative())return e;var n,i,r=new t([],"/",!1,!1),o=this.removeDotSegments().base,s=e.removeDotSegments();for(n=0;n<o.value.length&&n<s.value.length&&o.value[n]===s.value[n];++n);for(i=n;i<o.value.length;++i)r.value.push("..");for(i=n;i<s.value.length;++i)r.value.push(s.value[i]);return r},removeDotSegments:function(){var e=new t([],this.value.separator,this.value.leadingSeparator,this.value.trailingSeparator);if(this.value.length){for(var n=0;n<this.value.length;++n){var i=this.value[n];"."===i?e.value.trailingSeparator=!0:".."===i?(e.value.trailingSeparator=!0,e.value.length&&e.value.pop()):(e.value.trailingSeparator=!1,e.value.push(i))}e.value.trailingSeparator|=this.value.trailingSeparator}return e},toString:function(){var e="";return this.value.leadingSeparator&&(e+=this.value.separator),e+=this.value.join(this.value.separator),this.value.trailingSeparator&&(e+=this.value.separator),e}};var o={ftp:21,http:80,https:443,ftps:990},s=/^(?:([^:\/?#]*?):)?(?:(\/\/)([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,a=/^(.*?)(?:\:([^:]*))?$/;return r.prototype={copy:function(){return new r(this.value.local,this.value.absolute,this.value.scheme,this.value.slashs,this.value.authority,this.value.host,this.value.port,this.value.path,this.value.query,this.value.fragment)},get length(){return this.value.string.length},isRelative:function(){return!this.value.absolute()},isAbsolute:function(){return!this.value.absolute},isLocal:function(){return this.value.local},isNetwork:function(){return!this.value.local},isDirectory:function(){return 0==this.value.path.length?this.isNetwork():"/"===this.value.path[this.value.path.length-1]},isFile:function(){return!this.isDirectory()},get hierarchy(){var e="";return e+=this.value.slashs,e+=this.value.authority,e+=this.value.path},get authority(){return this.value.authority},get scheme(){return this.value.scheme},get host(){return this.value.host},get port(){return this.value.port},get wellKnownPort(){var e=o[this.value.scheme];return void 0!==e?e:0},get path(){return this.value.path},set query(e){this.value.query=e},get query(){return this.value.query},set fragment(e){this.value.fragment=e},get fragment(){return this.value.fragment},get location(){return this.toString()},get origin(){return new r(this.value.local,this.value.absolute,this.value.scheme,this.value.slashs,this.value.authority,this.value.host,this.value.port,this.value.local?"/":"","","")},get base(){return this.isDirectory()?new r(this.value.local,this.value.absolute,this.value.scheme,this.value.slashs,this.value.authority,this.value.host,this.value.port,this.value.path,"",""):this.parent},get parent(){var e;if(this.isDirectory()){if(1==this.value.path.length)return"/";e=this.value.path.substr(0,this.value.path.length-1)}else e=this.path;return e=-1==e.lastIndexOf("/")?"":e.substring(0,e.lastIndexOf("/")+1),new r(this.value.local,this.value.absolute,this.value.scheme,this.value.slashs,this.value.authority,this.value.host,this.value.port,e,"","")},get filename(){return new r(this.value.local,this.value.absolute,this.value.scheme,this.value.slashs,this.value.authority,this.value.host,this.value.port,this.value.path,"","")},get basename(){return this.value.path?this.value.path.substr(this.value.path.lastIndexOf("/")+1):""},get prefix(){if(this.value.path.length&&this.isFile()){var e=this.basename,t=this.suffix;return e.substr(0,e.length-t.length)}return this.basename},get suffix(){var e=this.value.path.lastIndexOf(".");return this.value.path.lastIndexOf("/")<e?this.value.path.substr(e):""},transform:function(e){var t=!1,n=!1,o="",s="",a="",u="",l=0,c="",h="",d="";if(e.scheme.length)t=e.isLocal(),n=e.isAbsolute(),o=e.scheme,s=e.value.slashs,a=e.authority,u=e.host,l=e.port,c=e.path,h=e.query;else{if(e.authority.length)t=e.isLocal(),n=e.isAbsolute(),a=e.authority,u=e.host,l=e.port,c=e.path,h=e.query;else{if(0===e.path.length){c=this.value.path;h=e.query.length?e.query:this.value.query}else{if("/"===e.path[0])c=e.path;else{var p=this.base;0===p.path.length?c="/":c+=p.path,c+=e.path}h=e.query}t=this.isLocal(),n=this.isAbsolute()||e.isAbsolute(),a=this.value.authority,u=this.value.host,l=this.value.port}o=this.value.scheme,s=this.value.slashs}return d=e.fragment,new r(t,n,o,s,a,u,l,i(c),h,d)},removeDotSegments:function(){return new r(this.value.local,this.value.absolute,this.value.scheme,this.value.slashs,this.value.authority,this.value.host,this.value.port,i(this.value.path),this.value.query,this.value.fragment)},getRelativePath:function(e){if(this.value.scheme!==e.scheme)return e;if(this.value.authority!==e.authority)return e;var n=new t(this.value.path,"/"),i=new t(e.path,"/");return new r(!0,!1,"","","","",0,n.getRelativePath(i).toString(),e.query,e.fragment)},escape:function(){return new r(escape(this.location))},unescape:function(){return new r(unescape(this.location))},toString:function(){var e=this.value.scheme;return this.value.scheme.length&&(e+=":"),e+=this.hierarchy,this.value.query.length&&(e+="?"+this.value.query),this.value.fragment.length&&(e+="#"+this.value.fragment),e}},r}),define("cobweb/Execution/X3DExecutionContext",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Basic/X3DBaseNode","cobweb/Configuration/ComponentInfoArray","cobweb/Execution/ImportedNode","cobweb/Prototype/ExternProtoDeclarationArray","cobweb/Prototype/ProtoDeclarationArray","cobweb/Routing/RouteArray","cobweb/Routing/X3DRoute","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants","standard/Networking/URI","standard/Math/Algorithm","cobweb/InputOutput/Generator"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g){function m(e){r.call(this,e),this.addChildObjects("rootNodes",new t.MFNode),this.specificationVersion="3.3",this.encoding="SCRIPTED",this.profile=null,this.components=new o(this.getBrowser()),this.url=new p(window.location),this.uninitializedNodes=[],this.uninitializedNodes2=[],this.namedNodes={},this.importedNodes={},this.protos=new u,this.externprotos=new a,this.routes=new l,this.routeIndex={}}return m.prototype=e.extend(Object.create(r.prototype),{constructor:m,setup:function(){for(r.prototype.setup.call(this);this.uninitializedNodes.length;){var e=this.uninitializedNodes;this.uninitializedNodes=this.uninitializedNodes2,this.uninitializedNodes2=e;for(var t=0,n=e.length;t<n;++t)e[t].setup();e.length=0}},isMasterContext:function(){return!1},isRootContext:function(){return!1},getSpecificationVersion:function(){return this.specificationVersion},setEncoding:function(e){this.encoding=e},getEncoding:function(){return this.encoding},getWorldURL:function(){return this.getURL().location},setURL:function(e){this.url=e},getURL:function(){return this.url},setProfile:function(e){this.profile=e},getProfile:function(e){return this.profile},addComponent:function(e){this.components.add(e.name,e)},getComponents:function(){return this.components},createNode:function(e,n){var i=this.getBrowser().supportedNodes[e];if(!i)throw new Error("Unknown node type '"+e+"'.");var r=i.createInstance(this);return!1===n?r:(r.setup(),new t.SFNode(r))},createProto:function(e,t){for(var n=this;;){var i=n.protos[e];if(i)return i.createInstance(this,t);var r=n.externprotos[e];if(r)return r.createInstance(this,t);if(n.isRootContext())break;n=n.getExecutionContext()}throw new Error("Unknown proto or externproto type '"+e+"'.")},addUninitializedNode:function(e){this.uninitializedNodes.push(e)},addNamedNode:function(e,t){if(void 0!==this.namedNodes[e])throw new Error("Couldn't add named node: node named '"+e+"' is already in use.");this.updateNamedNode(e,t)},updateNamedNode:function(e,n){if(!(n instanceof t.SFNode||n instanceof r))throw new Error("Couldn't update named node: node must be of type SFNode.");if(e=String(e),!(n=new t.SFNode(n instanceof t.SFNode?n.getValue():n)).getValue())throw new Error("Couldn't update named node: node IS NULL.");if(n.getValue().getExecutionContext()!==this)throw new Error("Couldn't update named node: node does not belong to this execution context.");if(0===e.length)throw new Error("Couldn't update named node: node name is empty.");this.removeNamedNode(n.getValue().getName()),this.removeNamedNode(e),n.getValue().setName(e),this.namedNodes[e]=n},removeNamedNode:function(e){delete this.namedNodes[e]},getNamedNode:function(e){var t=this.namedNodes[e];if(!t)throw new Error("Named node '"+e+"' not found.");return t},getUniqueName:function(e){for(var t=/(_\d+$)/,n=e=e.replace(t,""),i=64;i&&(this.namedNodes[n]||0===n.length);){var r=i,o=i<<=1;n=e,n+="_",n+=Math.round(f.random(r,o))}return n},addImportedNode:function(e,t,n){if(void 0===n&&(n=t),this.importedNodes[n])throw new Error("Couldn't add imported node: imported name '"+n+"' already in use.");this.updateImportedNode(e,t,n)},updateImportedNode:function(e,t,n){if(e=h(d.Inline,e),t=String(t),n=void 0===n?t:String(n),!e)throw new Error("Node named is not an Inline node.");if(e.getExecutionContext()!==this)throw new Error("Couldn't update imported node: Inline node does not belong to this execution context.");if(0===t.length)throw new Error("Couldn't update imported node: exported name is empty.");if(0===n.length)throw new Error("Couldn't update imported node: imported name is empty.");this.removeImportedNode(n),this.importedNodes[n]=new s(this,e,t,n),this.importedNodes[n].setup()},removeImportedNode:function(e){var t=this.importedNodes[e];t&&t.dispose(),delete this.importedNodes[e]},getImportedNode:function(e){var t=this.importedNodes[e];if(t)return t.getExportedNode();throw new Error("Imported node '"+e+"' not found.")},getImportedNodes:function(){return this.importedNodes},getLocalNode:function(e){try{return this.getNamedNode(e)}catch(i){var n=this.importedNodes[e];if(n)return new t.SFNode(n);throw new Error("Unknown named or imported node '"+e+"'.")}},setRootNodes:function(){},getRootNodes:function(){return this.rootNodes_},getProtoDeclaration:function(e){return this.protos.get(e)},getProtoDeclarations:function(){return this.protos},getExternProtoDeclaration:function(e){return this.externprotos.get(e)},getExternProtoDeclarations:function(){return this.externprotos},addRoute:function(e,n,i,r){try{if(n=String(n),r=String(r),!(e instanceof t.SFNode))throw new Error("Bad ROUTE specification: source node must be of type SFNode.");if(!(i instanceof t.SFNode))throw new Error("Bad ROUTE specification: destination node must be of type SFNode.");if(e=e.getValue(),i=i.getValue(),!e)throw new Error("Bad ROUTE specification: source node is NULL.");if(!i)throw new Error("Bad ROUTE specification: destination node is NULL.");if(e instanceof s||i instanceof s)return e instanceof s&&e.addRoute(e,n,i,r),void(i instanceof s&&i.addRoute(e,n,i,r));if(n=e.getField(n),r=i.getField(r),!n.isOutput())throw new Error("Bad ROUTE specification: Field named '"+n.getName()+"' in node named '"+e.getName()+"' of type "+e.getTypeName()+" is not an output field.");if(!r.isInput())throw new Error("Bad ROUTE specification: Field named '"+r.getName()+"' in node named '"+i.getName()+"' of type "+i.getTypeName()+" is not an input field.");if(n.getType()!==r.getType())throw new Error("Bad ROUTE specification: ROUTE types "+n.getTypeName()+" and "+r.getTypeName()+" do not match.");var o=n.getId()+"."+r.getId();if(this.routeIndex[o])return this.routeIndex[o];var a=new c(this,e,n,i,r);return a.setup(),this.routes.getValue().push(a),this.routeIndex[o]=a,a}catch(e){throw new Error("Bad ROUTE specification: "+e.message)}},deleteRoute:function(e){try{var t=e._sourceField,n=e._destinationField,i=t.getId()+"."+n.getId(),r=this.routes.getValue().indexOf(e);e.disconnect(),-1!==r&&this.routes.getValue().splice(r,1),delete this.routeIndex[i]}catch(e){console.log(e)}},getRoute:function(e,t,n,i){if(!e.getValue())throw new Error("Bad ROUTE specification: sourceNode is NULL.");if(!n.getValue())throw new Error("Bad ROUTE specification: destinationNode is NULL.");var t=e.getValue().getField(t),i=n.getValue().getField(i),r=t.getId()+"."+i.getId();return this.routeIndex[r]},getRoutes:function(){return this.routes},changeViewpoint:function(e){try{var t=this.getNamedNode(e),n=h(d.X3DViewpointNode,t);if(!n)throw 1;n.isBound_.getValue()?n.transitionStart(n):n.set_bind_=!0}catch(t){if(this.isRootContext())throw new Error("Viewpoint named '"+e+"' not found.");this.getExecutionContext().changeViewpoint(e)}},toXMLStream:function(e){g.PushExecutionContext(this),g.EnterScope(),g.ImportedNodes(this.getImportedNodes()),this.getExternProtoDeclarations().toXMLStream(e),this.getProtoDeclarations().toXMLStream(e);var t=this.getRootNodes();t.length&&(t.toXMLStream(e),e.string+="\n");var n=this.getImportedNodes();for(var i in n)try{n[i].toXMLStream(e),e.string+="\n"}catch(e){}this.getRoutes().toXMLStream(e),g.LeaveScope(),g.PopExecutionContext()}}),Object.defineProperty(m.prototype,"worldURL",{get:function(){return this.getWorldURL()},enumerable:!0,configurable:!1}),Object.defineProperty(m.prototype,"rootNodes",{get:function(){return this.getRootNodes()},set:function(e){this.setRootNodes(e)},enumerable:!0,configurable:!1}),m}),define("cobweb/Configuration/UnitInfo",["jquery","cobweb/InputOutput/Generator"],function(e,t){function n(e,t,n){this.category=e,this.name=t,this.conversionFactor=n}return e.extend(n.prototype,{constructor:n,toXMLStream:function(e){e.string+=t.Indent(),e.string+="<unit",e.string+=" ",e.string+="category='",e.string+=this.category,e.string+="'",e.string+=" ",e.string+="name='",e.string+=t.XMLEncode(this.name),e.string+="'",e.string+=" ",e.string+="conversionFactor='",e.string+=this.conversionFactor,e.string+="'",e.string+="/>"}}),Object.defineProperty(n.prototype,"conversion_factor",{get:function(){return this.conversionFactor},enumerable:!0,configurable:!1}),n}),define("cobweb/Configuration/UnitInfoArray",["jquery","cobweb/Configuration/X3DInfoArray"],function(e,t){function n(){return t.call(this)}return n.prototype=e.extend(Object.create(t.prototype),{constructor:n}),n}),define("cobweb/Execution/ExportedNode",["jquery","cobweb/Fields","cobweb/Base/X3DObject","cobweb/InputOutput/Generator"],function(e,t,n,i){function r(e,t){n.call(this),this.exportedName=e,this.localNode=t}return r.prototype=e.extend(Object.create(n.prototype),{constructor:r,getExportedName:function(){return this.exportedName},getLocalNode:function(){return new t.SFNode(this.localNode)},toXMLStream:function(e){var t=i.LocalName(this.localNode);e.string+=i.Indent(),e.string+="<EXPORT",e.string+=" ",e.string+="localDEF='",e.string+=i.XMLEncode(t),e.string+="'",this.exportedName!==t&&(e.string+=" ",e.string+="AS='",e.string+=i.XMLEncode(this.exportedName),e.string+="'"),e.string+="/>"}}),r}),define("cobweb/Execution/X3DScene",["jquery","cobweb/Fields","cobweb/Execution/X3DExecutionContext","cobweb/Configuration/UnitInfo","cobweb/Configuration/UnitInfoArray","cobweb/Execution/ExportedNode","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i,r,o,s,a){function u(e){n.call(this,e),this.getRootNodes().setAccessType(s.inputOutput),this.units=new r,this.units.add("angle",new i("angle","radian",1)),this.units.add("force",new i("force","newton",1)),this.units.add("length",new i("length","metre",1)),this.units.add("mass",new i("mass","kilogram",1)),this.metaData={},this.exportedNodes={},this.setLive(!1)}return u.prototype=e.extend(Object.create(n.prototype),{constructor:u,isMasterContext:function(){return this===this.getExecutionContext()},isRootContext:function(){return!0},getScene:function(){return this.isMasterContext()?this:this.getExecutionContext().getScene()},updateUnit:function(e,t,n){var i=this.units.get(e);i&&(i.name=t,i.conversionFactor=n)},getUnits:function(){return this.units},setMetaData:function(e,t){e.length&&(this.metaData[e]=String(t))},getMetaData:function(e){return this.metaData[e]},getMetaDatas:function(){return this.metaData},addExportedNode:function(e,t){if(this.exportedNodes[e])throw new Error("Couldn't add exported node: exported name '"+e+"' already in use.");this.updateExportedNode(e,t)},updateExportedNode:function(e,n){if(0===(e=String(e)).length)throw new Error("Couldn't update exported node: node exported name is empty.");if(!(n instanceof t.SFNode))throw new Error("Couldn't update exported node: node must be of type SFNode.");if(!n.getValue())throw new Error("Couldn't update exported node: node IS NULL.");this.exportedNodes[e]=new o(e,n.getValue())},removeExportedNode:function(e){delete this.exportedNodes[e]},getExportedNode:function(e){var t=this.exportedNodes[e];if(t)return t.getLocalNode();throw new Error("Exported node '"+e+"' not found.")},getExportedNodes:function(){return this.exportedNodes},addRootNode:function(e){if(!(e instanceof t.SFNode||null===e))throw new Error("Couldn't add root node: node must be of type SFNode.");this.getRootNodes().push(e)},removeRootNode:function(e){if(!(e instanceof t.SFNode||null===e))throw new Error("Couldn't remove root node: node must be of type SFNode.");var n=this.getRootNodes(),i=n.length;n.erase(n.remove(0,i,e),i)},setRootNodes:function(e){this.getRootNodes().setValue(e)},toXMLStream:function(e){var t=this.getSpecificationVersion();"2.0"===t&&(t="3.3"),e.string+='<?xml version="1.0" encoding="UTF-8"?>\n',e.string+='<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D ',e.string+=t,e.string+='//EN" "http://www.web3d.org/specifications/x3d-',e.string+=t,e.string+='.dtd">\n',e.string+="<X3D",e.string+=" ",e.string+="profile='",e.string+=this.getProfile()?this.getProfile().name:"Full",e.string+="'",e.string+=" ",e.string+="version='",e.string+=t,e.string+="'",e.string+=" ",e.string+="xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'",e.string+=" ",e.string+="xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-",e.string+=t,e.string+=".xsd'>\n",a.IncIndent(),e.string+=a.Indent(),e.string+="<head>\n",a.IncIndent(),this.getComponents().toXMLStream(e);for(var i=this.getUnits(),r=0,o=i.length;r<o;++r){var s=i[r];1!==s.conversionFactor&&(s.toXMLStream(e),e.string+="\n")}var u=this.getMetaDatas();for(var l in u)e.string+=a.Indent(),e.string+="<meta",e.string+=" ",e.string+="name='",e.string+=a.XMLEncode(l),e.string+="'",e.string+=" ",e.string+="content='",e.string+=a.XMLEncode(u[l]),e.string+="'",e.string+="/>\n";a.DecIndent(),e.string+=a.Indent(),e.string+="</head>\n",e.string+=a.Indent(),e.string+="<Scene>\n",a.IncIndent();var c=this.getExportedNodes();a.PushExecutionContext(this),a.EnterScope(),a.ExportedNodes(c),n.prototype.toXMLStream.call(this,e);for(var h in c)c[h].toXMLStream(e),e.string+="\n";a.LeaveScope(),a.PopExecutionContext(),a.DecIndent(),e.string+=a.Indent(),e.string+="</Scene>\n",a.DecIndent(),e.string+="</X3D>\n"}}),u}),define("cobweb/Execution/Scene",["cobweb/Fields","cobweb/Execution/X3DScene"],function(e,t){function n(n){this._browser=n,t.call(this,this),this.addChildObjects("initLoadCount",new e.SFInt32,"loadCount",new e.SFInt32),this.loadingObjects={}}return n.prototype=$.extend(Object.create(t.prototype),{constructor:n,getTypeName:function(){return"Scene"},setExecutionContext:function(e){if(!this.isMasterContext()){var n=this.getScene(),i=this.loadingObjects;for(var r in i)n.removeLoadCount(i[r])}if(t.prototype.setExecutionContext.call(this,e),!this.isMasterContext()){var n=this.getScene(),i=this.loadingObjects;for(var r in i)n.addLoadCount(i[r])}},addInitLoadCount:function(e){this.initLoadCount_=this.initLoadCount_.getValue()+1},removeInitLoadCount:function(e){this.initLoadCount_=this.initLoadCount_.getValue()-1},addLoadCount:function(e){var t=e.getId();this.loadingObjects.hasOwnProperty(t)||(this.loadingObjects[t]=e,this.loadCount_=this.loadCount_.getValue()+1,this===this.getBrowser().getExecutionContext()&&this.getBrowser().addLoadCount(e),this.isMasterContext()||this.getScene().addLoadCount(e))},removeLoadCount:function(e){var t=e.getId();this.loadingObjects.hasOwnProperty(t)&&(delete this.loadingObjects[t],this.loadCount_=this.loadCount_.getValue()-1,this===this.getBrowser().getExecutionContext()&&this.getBrowser().removeLoadCount(e),this.isMasterContext()||this.getScene().removeLoadCount(e))},getLoadingObjects:function(){return this.loadingObjects}}),n}),define("cobweb/Components/Networking/X3DUrlObject",["jquery","cobweb/Fields","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){this.addType(n.X3DUrlObject),this.addChildObjects("loadState",new t.SFInt32(n.NOT_STARTED_STATE))}return i.prototype={constructor:i,initialize:function(){},setLoadState:function(e,t){this.loadState_=e,this.getScene().removeLoadCount(this),!1!==t&&e===n.IN_PROGRESS_STATE&&this.getScene().addLoadCount(this)},checkLoadState:function(){return this.loadState_.getValue()}},i}),define("cobweb/Components/Core/X3DNode",["jquery","cobweb/Basic/X3DBaseNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,getLayers:function(){return this.findParents(n.X3DLayerNode,this)},findParents:function(e,t){var n=t.getParents(),i=[],r={};for(var o in n)this.findParentsImpl(e,n[o],i,r);return i},findParentsImpl:function(e,i,r,o){if(!o.hasOwnProperty(i.getId())){if(o[i.getId()]=!0,i instanceof t){for(var s=i.getType(),a=s.length-1;a>=0;--a){switch(s[a]){case n.X3DProtoDeclarationNode:case n.X3DNode:break;case n.LayerSet:case n.X3DBaseNode:case n.X3DMetadataObject:case n.X3DProgrammableShaderObject:case n.X3DScriptNode:return;default:continue}break}if(-1!==i.getType().indexOf(e))return void r.push(i)}var u=i.getParents();for(var l in u)this.findParentsImpl(e,u[l],r,o)}}}),i}),define("cobweb/Components/Core/X3DPrototypeInstance",["jquery","cobweb/Basic/FieldDefinitionArray","cobweb/Fields","cobweb/Base/X3DChildObject","cobweb/Components/Core/X3DNode","cobweb/Execution/X3DExecutionContext","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i,r,o,s,a){function u(e,n){this.protoNode=n,this.fieldDefinitions=new t(n.getFieldDefinitions().getValue().slice()),r.call(this,e),o.call(this,e),this.addType(s.X3DPrototypeInstance),this.getRootNodes().setAccessType(s.initializeOnly),this.getScene().addInitLoadCount(this),n.isExternProto?n.requestAsyncLoad(this.construct.bind(this)):this.construct()}return u.prototype=e.extend(Object.create(o.prototype),r.prototype,{constructor:u,create:function(e){return new u(e,this.protoNode)},getTypeName:function(){return this.protoNode.getName()},getComponentName:function(){return"Core"},getContainerField:function(){return"children"},construct:function(){this.getScene().removeInitLoadCount(this);var e=this.protoNode.getProtoDeclaration();if(e){if(this.metadata_.getSet()||(this.metadata_=e.metadata_),this.protoNode.isExternProto)for(var t=e.getFieldDefinitions(),n=0,r=t.length;n<r;++n)try{var o=t[n],a=this.getField(o.name),u=e.getField(o.name);if(a.getAccessType()!==u.getAccessType())continue;if(a.getType()!==u.getType())continue;if(!(a.getAccessType()&s.initializeOnly))continue;if(a.getSet())continue;if(a.hasReferences())continue;a.setValue(u.getValue())}catch(e){this.addField(o)}this.setURL(e.getURL()),this.importExternProtos(e.externprotos),this.importProtos(e.protos),this.copyRootNodes(e.rootNodes),this.isInitialized()&&(this.setup(),i.prototype.addEvent.call(this))}},setup:function(){r.prototype.setup.call(this),o.prototype.setup.call(this)},initialize:function(){try{var e=this.protoNode.getProtoDeclaration();e&&this.copyRoutes(e.routes),r.prototype.initialize.call(this),o.prototype.initialize.call(this)}catch(e){console.error(e.message)}},getExtendedEventHandling:function(){return!1},getInnerNode:function(){var e=this.getRootNodes().getValue();if(e.length){var t=e[0];if(t)return t.getValue().getInnerNode()}throw new Error("Root node not available.")},importExternProtos:function(e){for(var t=0,n=e.length;t<n;++t)this.externprotos.add(e[t].getName(),e[t])},importProtos:function(e){for(var t=0,n=e.length;t<n;++t)this.protos.add(e[t].getName(),e[t])},copyRootNodes:function(e){for(var t=e.getValue(),n=this.getRootNodes().getValue(),i=0,r=t.length;i<r;++i){var o=t[i].copy(this);o.addParent(this.getRootNodes()),n.push(o)}},copyRoutes:function(e){for(var t=0,n=e.length;t<n;++t)try{var i=e[t];this.addRoute(this.getNamedNode(i.sourceNode.getNodeName()),i.sourceField,this.getNamedNode(i.destinationNode.getNodeName()),i.destinationField)}catch(e){console.log(e)}},toXMLStream:function(t){if(a.IsSharedNode(this))return t.string+=a.Indent(),void(t.string+="\x3c!-- NULL --\x3e");a.EnterScope();var n=a.Name(this);if(n.length&&a.ExistsNode(this))return t.string+=a.Indent(),t.string+="<ProtoInstance",t.string+=" ",t.string+="name='",t.string+=a.XMLEncode(this.getTypeName()),t.string+="'",t.string+=" ",t.string+="USE='",t.string+=a.XMLEncode(n),t.string+="'",(i=a.ContainerField())&&i.getName()!==this.getContainerField()&&(t.string+=" ",t.string+="containerField='",t.string+=a.XMLEncode(i.getName()),t.string+="'"),t.string+="/>",void a.LeaveScope();t.string+=a.Indent(),t.string+="<ProtoInstance",t.string+=" ",t.string+="name='",t.string+=a.XMLEncode(this.getTypeName()),t.string+="'",n.length&&(a.AddNode(this),t.string+=" ",t.string+="DEF='",t.string+=a.XMLEncode(n),t.string+="'");var i=a.ContainerField();i&&i.getName()!==this.getContainerField()&&(t.string+=" ",t.string+="containerField='",t.string+=a.XMLEncode(i.getName()),t.string+="'");var r=this.getChangedFields(),o=this.metadata_;try{o=this.getField("metadata")}catch(e){}if(o===this.metadata_&&(r=r.filter(function(e){return e!==this.metadata_}.bind(this))),0!==r.length||(this.metadata_,0)){t.string+=">\n",a.IncIndent();for(var u=[],l=0,c=r.length;l<c;++l){var h=r[l],d=!1;if(a.ExecutionContext()&&h.getAccessType()===s.inputOutput&&!e.isEmptyObject(h.getReferences())){var p=!1,f=h.getReferences();for(var g in f)p|=f[g].isInitializable();p||(d=!0)}if(e.isEmptyObject(h.getReferences())||!a.ExecutionContext()||d)switch(d&&u.push(h),h.getType()){case s.MFNode:t.string+=a.Indent(),t.string+="<fieldValue",t.string+=" ",t.string+="name='",t.string+=a.XMLEncode(h.getName()),t.string+="'",0===h.length?t.string+="/>\n":(t.string+=">\n",a.IncIndent(),h.toXMLStream(t),t.string+="\n",a.DecIndent(),t.string+=a.Indent(),t.string+="</fieldValue>\n");break;case s.SFNode:if(null!==h.getValue()){t.string+=a.Indent(),t.string+="<fieldValue",t.string+=" ",t.string+="name='",t.string+=a.XMLEncode(h.getName()),t.string+="'",t.string+=">\n",a.IncIndent(),h.toXMLStream(t),t.string+="\n",a.DecIndent(),t.string+=a.Indent(),t.string+="</fieldValue>\n";break}default:t.string+=a.Indent(),t.string+="<fieldValue",t.string+=" ",t.string+="name='",t.string+=a.XMLEncode(h.getName()),t.string+="'",t.string+=" ",t.string+="value='",h.toXMLStream(t),t.string+="'",t.string+="/>\n"}else u.push(h)}if(u.length){t.string+=a.Indent(),t.string+="<IS>",t.string+="\n",a.IncIndent();for(var l=0,c=u.length;l<c;++l){var m=(h=u[l]).getReferences();for(var g in m){var b=m[g];t.string+=a.Indent(),t.string+="<connect",t.string+=" ",t.string+="nodeField='",t.string+=a.XMLEncode(h.getName()),t.string+="'",t.string+=" ",t.string+="protoField='",t.string+=a.XMLEncode(b.getName()),t.string+="'",t.string+="/>\n"}}a.DecIndent(),t.string+=a.Indent(),t.string+="</IS>\n"}o===this.metadata_&&o.getValue()&&(o.toXMLStream(t),t.string+="\n"),a.DecIndent(),t.string+=a.Indent(),t.string+="</ProtoInstance>"}else t.string+="/>";a.LeaveScope()}}),u}),define("cobweb/Prototype/X3DProtoDeclarationNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DNode","cobweb/Components/Core/X3DPrototypeInstance","cobweb/Bits/X3DConstants"],function(e,t,n,i,r){function o(e){n.call(this,e),this.addType(r.X3DProtoDeclarationNode)}return o.prototype=e.extend(Object.create(n.prototype),{constructor:o,hasUserDefinedFields:function(){return!0},createInstance:function(e,n){var r=new i(e,this);return!1===n?r:(r.setup(),new t.SFNode(r))},newInstance:function(){return this.createInstance(this.getExecutionContext())}}),o}),define("cobweb/Prototype/X3DExternProtoDeclaration",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Networking/X3DUrlObject","cobweb/Prototype/X3DProtoDeclarationNode","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i,r,o,s,a){function u(){}function l(n){o.call(this,n),r.call(this,n),this.addType(s.X3DExternProtoDeclaration),this.addChildObjects("url",new t.MFString),this.deferred=e.Deferred()}return l.prototype=e.extend(Object.create(o.prototype),r.prototype,{constructor:l,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode)]),getTypeName:function(){return"EXTERNPROTO"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"externprotos"},initialize:function(){o.prototype.initialize.call(this),r.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this)},set_live__:function(){this.checkLoadState()===s.COMPLETE_STATE&&this.scene.setLive(this.isLive().getValue())},hasUserDefinedFields:function(){return!0},setProtoDeclaration:function(e){if(this.proto=e,this.proto)for(var t=this.getFieldDefinitions(),n=e.getFieldDefinitions(),i=0,r=n.length;i<r;++i){var o=n[i],s=t.get(o.name);s&&s.value.setValue(o.value)}},getProtoDeclaration:function(){return this.proto},loadNow:function(e){this.requestAsyncLoad(e||u)},requestAsyncLoad:function(e){this.deferred.done(e),this.checkLoadState()!==s.COMPLETE_STATE&&this.checkLoadState()!==s.IN_PROGRESS_STATE&&(this.setLoadState(s.IN_PROGRESS_STATE),this.getScene().addInitLoadCount(this),new(require("cobweb/InputOutput/FileLoader"))(this).createX3DFromURL(this.url_,null,this.setInternalSceneAsync.bind(this)))},setInternalSceneAsync:function(e){this.getScene().removeInitLoadCount(this),e?this.setInternalScene(e):this.setError()},setInternalScene:function(e){this.scene=e,this.setLoadState(s.COMPLETE_STATE),this.scene.setLive(this.isLive().getValue()),this.scene.setPrivate(this.getScene().getPrivate()),this.scene.setup();var t=this.scene.getURL().fragment||0;this.setProtoDeclaration(this.scene.protos[t]),this.deferred.resolve()},getInternalScene:function(){return this.scene},setError:function(t){console.log(t),this.setLoadState(s.FAILED_STATE),this.scene=this.getBrowser().getPrivateScene(),this.setProtoDeclaration(null),this.deferred.resolve(),this.deferred=e.Deferred()},toXMLStream:function(e){e.string+=a.Indent(),e.string+="<ExternProtoDeclare",e.string+=" ",e.string+="name='",e.string+=a.XMLEncode(this.getName()),e.string+="'",e.string+=" ",e.string+="url='",this.url_.toXMLStream(e),e.string+="'",e.string+=">\n",a.IncIndent();var t=this.getUserDefinedFields();for(var n in t){var i=t[n];e.string+=a.Indent(),e.string+="<field",e.string+=" ",e.string+="accessType='",e.string+=a.AccessType(i.getAccessType()),e.string+="'",e.string+=" ",e.string+="type='",e.string+=i.getTypeName(),e.string+="'",e.string+=" ",e.string+="name='",e.string+=a.XMLEncode(i.getName()),e.string+="'",e.string+="/>\n"}a.DecIndent(),e.string+=a.Indent(),e.string+="</ExternProtoDeclare>"}}),Object.defineProperty(l.prototype,"name",{get:function(){return this.getName()},enumerable:!0,configurable:!1}),Object.defineProperty(l.prototype,"fields",{get:function(){return this.getFieldDefinitions()},enumerable:!0,configurable:!1}),Object.defineProperty(l.prototype,"isExternProto",{get:function(){return!0},enumerable:!0,configurable:!1}),Object.defineProperty(l.prototype,"urls",{get:function(){return this.url_.copy()},enumerable:!0,configurable:!1}),Object.defineProperty(l.prototype,"loadState",{get:function(){return this.checkLoadState()},enumerable:!0,configurable:!1}),l}),define("cobweb/Prototype/X3DProtoDeclaration",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Execution/X3DExecutionContext","cobweb/Prototype/X3DProtoDeclarationNode","cobweb/Bits/X3DConstants","cobweb/InputOutput/Generator"],function(e,t,n,i,r,o,s,a){function u(e){o.call(this,e),r.call(this,e),this.addType(s.X3DProtoDeclaration),this.addChildObjects("loadState",new t.SFInt32(s.NOT_STARTED_STATE))}return u.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode)]),getTypeName:function(){return"PROTO"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"protos"},initialize:function(){o.prototype.initialize.call(this),this.loadState_=s.COMPLETE_STATE},hasUserDefinedFields:function(){return!0},getURL:function(){return this.getExecutionContext().getURL()},getProtoDeclaration:function(){return this},checkLoadState:function(){return this.loadState_.getValue()},toXMLStream:function(t){t.string+=a.Indent(),t.string+="<ProtoDeclare",t.string+=" ",t.string+="name='",t.string+=a.XMLEncode(this.getName()),t.string+="'",t.string+=">",t.string+="\n",a.EnterScope();var n=this.getUserDefinedFields();if(!e.isEmptyObject(n)){a.IncIndent(),t.string+=a.Indent(),t.string+="<ProtoInterface>\n",a.IncIndent();for(var i in n){var o=n[i];if(t.string+=a.Indent(),t.string+="<field",t.string+=" ",t.string+="accessType='",t.string+=a.AccessType(o.getAccessType()),t.string+="'",t.string+=" ",t.string+="type='",t.string+=o.getTypeName(),t.string+="'",t.string+=" ",t.string+="name='",t.string+=a.XMLEncode(o.getName()),t.string+="'",o.isDefaultValue())t.string+="/>\n";else switch(o.getType()){case s.SFNode:case s.MFNode:a.PushContainerField(null),t.string+=">\n",a.IncIndent(),o.toXMLStream(t),t.string+="\n",a.DecIndent(),t.string+=a.Indent(),t.string+="</field>\n",a.PopContainerField();break;default:t.string+=" ",t.string+="value='",o.toXMLStream(t),t.string+="'",t.string+="/>\n"}}a.DecIndent(),t.string+=a.Indent(),t.string+="</ProtoInterface>\n",a.DecIndent()}a.LeaveScope(),a.IncIndent(),t.string+=a.Indent(),t.string+="<ProtoBody>\n",a.IncIndent(),r.prototype.toXMLStream.call(this,t),a.DecIndent(),t.string+=a.Indent(),t.string+="</ProtoBody>\n",a.DecIndent(),t.string+=a.Indent(),t.string+="</ProtoDeclare>"}}),Object.defineProperty(u.prototype,"name",{get:function(){return this.getName()},enumerable:!0,configurable:!1}),Object.defineProperty(u.prototype,"fields",{get:function(){return this.getFieldDefinitions()},enumerable:!0,configurable:!1}),Object.defineProperty(u.prototype,"isExternProto",{get:function(){return!1},enumerable:!0,configurable:!1}),u}),define("cobweb/Parser/Parser",["jquery","cobweb/Fields","cobweb/Prototype/X3DExternProtoDeclaration","cobweb/Prototype/X3DProtoDeclaration","cobweb/Bits/X3DConstants"],function(e,t,n,i,r){function o(e){switch(e){case r.inializeOnly:return"initializeOnly";case r.inputOnly:return"inputOnly";case r.outputOnly:return"outputOnly";case r.inputOutput:return"inputOutput"}}function s(e){return this.lastIndex=0,e.result=this.exec(e.input),!!e.result&&(e.input=e.input.slice(e.result[0].length),!0)}function a(e,t){this.scene=e,this.isXML=t,this.executionContexts=[]}var u={Whitespaces:/^([\x20\n,\t\r]+)/,Comment:/^#(.*?)(?=[\n\r])/,Header:/^#(VRML|X3D) V(.*?) (utf8)(?: (.*?))?[\n\r]/,AS:/^AS/,COMPONENT:/^COMPONENT/,DEF:/^DEF/,EXPORT:/^EXPORT/,EXTERNPROTO:/^EXTERNPROTO/,FALSE:/^FALSE/,false:/^false/,IMPORT:/^IMPORT/,IS:/^IS/,META:/^META/,NULL:/^NULL/,TRUE:/^TRUE/,true:/^true/,PROFILE:/^PROFILE/,PROTO:/^PROTO/,ROUTE:/^ROUTE/,TO:/^TO/,UNIT:/^UNIT/,USE:/^USE/,OpenBrace:/^\{/,CloseBrace:/^\}/,OpenBracket:/^\[/,CloseBracket:/^\]/,Period:/^\./,Colon:/^\:/,Id:/^([^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*)/,ComponentNameId:/^([^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f\x3a]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f\x3a]*)/,initializeOnly:/^initializeOnly/,inputOnly:/^inputOnly/,outputOnly:/^outputOnly/,inputOutput:/^inputOutput/,field:/^field/,eventIn:/^eventIn/,eventOut:/^eventOut/,exposedField:/^exposedField/,FieldType:/^(MFBool|MFColorRGBA|MFColor|MFDouble|MFFloat|MFImage|MFInt32|MFMatrix3d|MFMatrix3f|MFMatrix4d|MFMatrix4f|MFNode|MFRotation|MFString|MFTime|MFVec2d|MFVec2f|MFVec3d|MFVec3f|MFVec4d|MFVec4f|SFBool|SFColorRGBA|SFColor|SFDouble|SFFloat|SFImage|SFInt32|SFMatrix3d|SFMatrix3f|SFMatrix4d|SFMatrix4f|SFNode|SFRotation|SFString|SFTime|SFVec2d|SFVec2f|SFVec3d|SFVec3f|SFVec4d|SFVec4f)/,int32:/^((?:0[xX][\da-fA-F]+)|(?:[+-]?\d+))/,double:/^([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/,string:/^"((?:[^"\\]|\\\\|\\")*)"/,Inf:/^[+]?inf/i,NegativeInf:/^-inf/i,NaN:/^[+-]?nan/i,Break:/\r?\n/g};for(var l in u)u[l].parse=s;return Object.preventExtensions(u),Object.freeze(u),Object.seal(u),a.prototype={accessTypes:{field:r.initializeOnly,eventIn:r.inputOnly,eventOut:r.outputOnly,exposedField:r.inputOutput,initializeOnly:r.initializeOnly,inputOnly:r.inputOnly,outputOnly:r.outputOnly,inputOutput:r.inputOutput},SFBool:new t.SFBool,SFColor:new t.SFColor,SFColorRGBA:new t.SFColorRGBA,SFDouble:new t.SFDouble,SFFloat:new t.SFFloat,SFImage:new t.SFImage,SFInt32:new t.SFInt32,SFMatrix3f:new t.SFMatrix3f,SFMatrix3d:new t.SFMatrix3d,SFMatrix4f:new t.SFMatrix4f,SFMatrix4d:new t.SFMatrix4d,SFNode:new t.SFNode,SFRotation:new t.SFRotation,SFString:new t.SFString,SFTime:new t.SFTime,SFVec2d:new t.SFVec2d,SFVec2f:new t.SFVec2f,SFVec3d:new t.SFVec3d,SFVec3f:new t.SFVec3f,SFVec4d:new t.SFVec4d,SFVec4f:new t.SFVec4f,MFBool:new t.MFBool,MFColor:new t.MFColor,MFColorRGBA:new t.MFColorRGBA,MFDouble:new t.MFDouble,MFFloat:new t.MFFloat,MFImage:new t.MFImage,MFInt32:new t.MFInt32,MFMatrix3d:new t.MFMatrix3d,MFMatrix3f:new t.MFMatrix3f,MFMatrix4d:new t.MFMatrix4d,MFMatrix4f:new t.MFMatrix4f,MFNode:new t.MFNode,MFRotation:new t.MFRotation,MFString:new t.MFString,MFTime:new t.MFTime,MFVec2d:new t.MFVec2d,MFVec2f:new t.MFVec2f,MFVec3d:new t.MFVec3d,MFVec3f:new t.MFVec3f,MFVec4d:new t.MFVec4d,MFVec4f:new t.MFVec4f,setInput:function(e){this.input=e,this.lineNumber=1,this.lastIndex=0},getBrowser:function(){return this.scene.getBrowser()},getExecutionContext:function(){return this.executionContexts[this.executionContexts.length-1]},pushExecutionContext:function(e){return this.executionContexts.push(e)},popExecutionContext:function(){this.executionContexts.pop()},isInsideProtoDefinition:function(){return this.executionContexts.length>1},addRootNode:function(e){this.getExecutionContext().rootNodes.push(e)},exception:function(e){if(this.getBrowser().isStrict())throw new Error(e);this.getBrowser().println(e)},parseIntoScene:function(e){try{return this.scene.setEncoding("VRML"),this.scene.setProfile(this.getBrowser().getProfile("Full")),this.setInput(e),void this.x3dScene()}catch(e){throw new Error(this.getError(e))}},getError:function(e){var t=e.message,n=this.getLine(),i=this.getLastLine(),r=this.getLastLine(),o=i.length-n.length+1;return i.length>80&&(i=i.substr(o-40,80),r="",o=40),"\n********************************************************************************\nParser error at line "+this.lineNumber+":"+o+"\nin '"+this.scene.getURL()+"'\n\n"+r+"\n"+i+"\n"+Array(o).join(" ")+"^\n"+t+"\n********************************************************************************\n"},getLine:function(){for(var e=this.input,t=this.lastIndex,n="";t<e.length&&"\n"!==e[t]&&"\r"!==e[t];)n+=e[t++];return this.lastIndex=t,n},getLastLine:function(){var e=this.input,t=this.lastIndex,n="";for(t<e.length&&("\n"!==e[t]||"\r"!==e[t])&&--t;t>=0&&"\n"!==e[t]&&"\r"!==e[t];)n=e[t--]+n;return this.lastIndex=t,n},comments:function(){for(;this.comment(););},comment:function(){return!!this.whitespaces()||u.Comment.parse(this)},whitespaces:function(){return!!u.Whitespaces.parse(this)&&(this.xml||this.lines(this.result[1]),!0)},lines:function(e){var t=e.match(u.Break);t&&(this.lineNumber+=t.length)},x3dScene:function(){if(this.pushExecutionContext(this.scene),this.headerStatement(),this.profileStatement(),this.componentStatements(),this.unitStatements(),this.metaStatements(),this.statements(),this.popExecutionContext(this.scene),this.lastIndex<this.input.length)throw new Error("Unknown statement.")},headerStatement:function(){var e=u.Header.exec(this.input);return!!e&&(this.scene.specificationVersion=e[2],this.scene.encoding="VRML",!0)},profileStatement:function(){if(this.comments(),u.PROFILE.parse(this)){if(this.profileNameId()){var e=this.getBrowser().getProfile(this.result[1]);return void this.scene.setProfile(e)}throw new Error("Expected a profile name.")}},componentStatements:function(){for(var e=this.componentStatement();e;)this.scene.addComponent(e),e=this.componentStatement()},componentStatement:function(){if(this.comments(),u.COMPONENT.parse(this)){if(this.componentNameId()){var e=this.result[1];if(this.comments(),u.Colon.parse(this)){if(this.componentSupportLevel()){var t=this.value;return this.getBrowser().getComponent(e,t)}throw new Error("Expected a component support level.")}throw new Error("Expected a ':' after component name.")}throw new Error("Expected a component name.")}return null},componentSupportLevel:function(){return this.int32()},unitStatements:function(){for(;this.unitStatement(););},unitStatement:function(){if(this.comments(),u.UNIT.parse(this)){if(this.categoryNameId()){var e=this.result[1];if(this.unitNameId()){var t=this.result[1];if(this.unitConversionFactor()){var n=this.value;try{return this.scene.updateUnit(e,t,n),!0}catch(e){return console.log(e.message),!0}}throw new Error("Expected unit conversion factor.")}throw new Error("Expected unit name identificator.")}throw new Error("Expected category name identificator after UNIT statement.")}return!1},unitConversionFactor:function(){return this.double()},metaStatements:function(){for(;this.metaStatement(););},metaStatement:function(){if(this.comments(),u.META.parse(this)){if(this.metakey()){var e=this.value;if(this.metavalue()){var t=this.value;return this.scene.setMetaData(e,t),!0}throw new Error("Expected metadata value.")}throw new Error("Expected metadata key.")}return!1},metakey:function(){return this.string()},metavalue:function(){return this.string()},exportStatement:function(){if(this.comments(),u.EXPORT.parse(this)){if(this.nodeNameId()){var e=this.result[1],t="";this.comments();var n=this.scene.getLocalNode(e);if(u.AS.parse(this)){if(!this.exportedNodeNameId())throw new Error("No name given after AS.");t=this.result[1]}else t=e;return this.scene.updateExportedNode(t,n),!0}throw new Error("No name given after EXPORT.")}return!1},importStatement:function(){if(this.comments(),u.IMPORT.parse(this)){if(this.nodeNameId()){var e=this.result[1],t=this.getExecutionContext().getNamedNode(e);if(this.comments(),u.Period.parse(this)){if(this.exportedNodeNameId()){var n=this.result[1],i=n;if(this.comments(),u.AS.parse(this)){if(!this.nodeNameId())throw new Error("No name given after AS.");i=this.result[1]}return this.getExecutionContext().updateImportedNode(t,n,i),!0}throw new Error("Expected exported node name.")}throw new Error("Expected a '.' after exported node name.")}throw new Error("No name given after IMPORT statement.")}return!1},statements:function(){for(;this.statement(););},statement:function(){if(this.protoStatement())return!0;if(this.routeStatement())return!0;if(this.importStatement())return!0;if(this.exportStatement())return!0;var e=this.nodeStatement();return!1!==e&&(this.addRootNode(e),!0)},nodeStatement:function(){if(this.comments(),u.DEF.parse(this)){if(this.nodeNameId())return this.node(this.result[1]);throw new Error("No name given after DEF.")}if(u.USE.parse(this)){if(this.nodeNameId())return this.getExecutionContext().getNamedNode(this.result[1]).getValue();throw new Error("No name given after USE.")}return u.NULL.parse(this)?null:this.node("")},protoStatement:function(){return!!this.proto()||!!this.externproto()},protoStatements:function(){for(;this.protoStatement(););},proto:function(){if(this.comments(),u.PROTO.parse(this)){if(this.nodeTypeId()){var e=this.result[1];if(this.comments(),u.OpenBracket.parse(this)){var t=this.interfaceDeclarations();if(this.comments(),u.CloseBracket.parse(this)){if(this.comments(),u.OpenBrace.parse(this)){for(var n=new i(this.getExecutionContext()),r=0,o=t.length;r<o;++r){var s=t[r];n.addUserDefinedField(s.getAccessType(),s.getName(),s)}if(this.pushExecutionContext(n),this.protoBody(),this.popExecutionContext(),this.comments(),u.CloseBrace.parse(this))return n.setName(e),n.setup(),this.getExecutionContext().protos.add(e,n),!0;throw new Error("Expected a '}' at the end of PROTO body.")}throw new Error("Expected a '{' at the beginning of PROTO body.")}throw new Error("Expected a ']' at the end of PROTO interface declaration.")}throw new Error("Expected a '[' at the beginning of PROTO interface declaration.")}throw new Error("Invalid PROTO definition name.")}return!1},protoBody:function(){this.protoStatements();var e=this.rootNodeStatement();!1!==e&&this.addRootNode(e),this.statements()},rootNodeStatement:function(){if(this.comments(),u.DEF.parse(this)){if(this.nodeNameId()){var e=this.result[0];if(!1!==(t=this.node(e)))return t;throw new Error("Expected node type name after DEF.")}throw new Error("No name given after DEF.")}var t=this.node("");return!1!==t&&t},interfaceDeclarations:function(){for(var e=[],t=this.interfaceDeclaration();t;)e.push(t),t=this.interfaceDeclaration();return e},restrictedInterfaceDeclaration:function(){if(this.comments(),u.inputOnly.parse(this)||u.eventIn.parse(this)){if(this.fieldType()){e=this.result[1];if(this.inputOnlyId()){t=this.result[1];return(n=new this[e].constructor).setAccessType(r.inputOnly),n.setName(t),n}throw new Error("Expected a name for field.")}throw this.Id(),new Error("Unknown event or field type: '"+this.result[1]+"'.")}if(u.outputOnly.parse(this)||u.eventOut.parse(this)){if(this.fieldType()){e=this.result[1];if(this.outputOnlyId()){t=this.result[1];return(n=new this[e].constructor).setAccessType(r.outputOnly),n.setName(t),n}throw new Error("Expected a name for field.")}throw this.Id(),new Error("Unknown event or field type: '"+this.result[1]+"'.")}if(u.initializeOnly.parse(this)||u.field.parse(this)){if(this.fieldType()){var e=this.result[1];if(this.initializeOnlyId()){var t=this.result[1],n=new this[e].constructor;if(this.fieldValue(n))return n.setAccessType(r.initializeOnly),n.setName(t),n;throw new Error("Couldn't read value for field '"+t+"'.")}throw new Error("Expected a name for field.")}throw this.Id(),new Error("Unknown event or field type: '"+this.result[1]+"'.")}return null},interfaceDeclaration:function(){if(n=this.restrictedInterfaceDeclaration())return n;if(this.comments(),u.inputOutput.parse(this)||u.exposedField.parse(this)){if(this.fieldType()){var e=this.result[1];if(this.inputOutputId()){var t=this.result[1],n=new this[e].constructor;if(this.fieldValue(n))return n.setAccessType(r.inputOutput),n.setName(t),n;throw new Error("Couldn't read value for field '"+t+"'.")}throw new Error("Expected a name for field.")}throw this.Id(),new Error("Unknown event or field type: '"+this.result[1]+"'.")}return null},externproto:function(){if(this.comments(),u.EXTERNPROTO.parse(this)){if(this.nodeTypeId()){var e=this.result[1];if(this.comments(),u.OpenBracket.parse(this)){var t=this.externInterfaceDeclarations();if(this.comments(),u.CloseBracket.parse(this)){if(this.URLList(this.MFString)){for(var i=new n(this.getExecutionContext()),r=0,o=t.length;r<o;++r){var s=t[r];i.addUserDefinedField(s.getAccessType(),s.getName(),s)}return i.setName(e),i.url_=this.MFString,i.setup(),this.getExecutionContext().externprotos.add(e,i),!0}throw new Error("Expected a URL list after EXTERNPROTO interface declaration '"+e+"'.")}throw new Error("Expected a ']' at the end of EXTERNPROTO interface declaration.")}throw new Error("Expected a '[' at the beginning of EXTERNPROTO interface declaration.")}throw new Error("Invalid EXTERNPROTO definition name.")}return!1},externInterfaceDeclarations:function(){for(var e=[],t=this.externInterfaceDeclaration();t;)e.push(t),t=this.externInterfaceDeclaration();return e},externInterfaceDeclaration:function(){if(this.comments(),u.inputOnly.parse(this)||u.eventIn.parse(this)){if(this.fieldType()){e=this.result[1];if(this.inputOnlyId()){t=this.result[1];return(n=new this[e].constructor).setAccessType(r.inputOnly),n.setName(t),n}throw new Error("Expected a name for field.")}throw this.Id(),new Error("Unknown event or field type: '"+this.result[1]+"'.")}if(u.outputOnly.parse(this)||u.eventOut.parse(this)){if(this.fieldType()){e=this.result[1];if(this.outputOnlyId()){t=this.result[1];return(n=new this[e].constructor).setAccessType(r.outputOnly),n.setName(t),n}throw new Error("Expected a name for field.")}throw this.Id(),new Error("Unknown event or field type: '"+this.result[1]+"'.")}if(u.initializeOnly.parse(this)||u.field.parse(this)){if(this.fieldType()){e=this.result[1];if(this.initializeOnlyId()){t=this.result[1];return(n=new this[e].constructor).setAccessType(r.initializeOnly),n.setName(t),n}throw new Error("Expected a name for field.")}throw this.Id(),new Error("Unknown event or field type: '"+this.result[1]+"'.")}if(u.inputOutput.parse(this)||u.exposedField.parse(this)){if(this.fieldType()){var e=this.result[1];if(this.inputOutputId()){var t=this.result[1],n=new this[e].constructor;return n.setAccessType(r.inputOutput),n.setName(t),n}throw new Error("Expected a name for field.")}throw this.Id(),new Error("Unknown event or field type: '"+this.result[1]+"'.")}return null},URLList:function(e){return this.mfstringValue(e)},routeStatement:function(){if(this.comments(),u.ROUTE.parse(this)){if(this.nodeNameId()){var e=this.result[1],t=this.getExecutionContext().getLocalNode(e);if(this.comments(),u.Period.parse(this)){if(this.outputOnlyId()){var n=this.result[1];if(this.comments(),u.TO.parse(this)){if(this.nodeNameId()){var i=this.result[1],r=this.getExecutionContext().getLocalNode(i);if(this.comments(),u.Period.parse(this)){if(this.inputOnlyId())try{var o=this.result[1];return this.getExecutionContext().addRoute(t,n,r,o),!0}catch(e){return this.exception(e.message),!0}throw new Error("Bad ROUTE specification: Expected a field name.")}throw new Error("Bad ROUTE specification: Expected a '.' after node name.")}throw new Error("Bad ROUTE specification: Expected a node name.")}throw new Error("Bad ROUTE specification: Expected a 'TO'.")}throw new Error("Bad ROUTE specification: Expected a field name.")}throw new Error("Bad ROUTE specification: Expected a '.' after node name.")}throw new Error("Bad ROUTE specification: Expected a node name.")}return!1},node:function(e){if(this.nodeTypeId()){var t=this.result[1];try{n=this.getExecutionContext().createNode(t,!1)}catch(e){try{var n=this.getExecutionContext().createProto(t,!1)}catch(t){throw new Error(e.message+"\n"+t.message)}}if(e.length){try{var i=this.getExecutionContext().getNamedNode(e);this.getExecutionContext().updateNamedNode(this.getExecutionContext().getUniqueName(e),i)}catch(e){}this.getExecutionContext().updateNamedNode(e,n)}if(this.comments(),u.OpenBrace.parse(this)){if(n.hasUserDefinedFields()?this.scriptBody(n):this.nodeBody(n),this.comments(),u.CloseBrace.parse(this))return this.getExecutionContext().addUninitializedNode(n),n;throw new Error("Expected '}' at the end of node body.")}throw new Error("Expected '{' at the beginning of node body.")}return!1},scriptBody:function(e){for(;this.scriptBodyElement(e););},scriptBodyElement:function(e){var t=this.input,n=this.lineNumber;if(this.Id()){var i=this.accessTypes[this.result[1]];if(i&&this.fieldType()){var s=this.result[1];if(this.Id()){var a=this.result[1];if(this.comments(),u.IS.parse(this)){if(this.isInsideProtoDefinition()){if(this.Id()){var l=this.result[1];try{var c=this.getExecutionContext().getField(l)}catch(e){return this.exception("No such event or field '"+l+"' inside PROTO "+this.getExecutionContext().getName()+" interface declaration."),!0}var h=this[s];if(h.getType()===c.getType()){if(c.isReference(i)){try{d=e.getField(a);if(c.getType()===d.getType())if(i===d.getAccessType());else{if(d.getAccessType()!==r.inputOutput)return this.exception("Field '"+a+"' must have access type "+o(d.getAccessType())+"."),!0;i!==d.getAccessType()&&(d=this.createUserDefinedField(e,i,a,h))}else d=this.createUserDefinedField(e,i,a,h)}catch(t){var d=this.createUserDefinedField(e,i,a,h)}return d.addReference(c),!0}throw new Error("Field '"+a+"' and '"+c.getName()+"' in PROTO '"+this.getExecutionContext().getName()+"' are incompatible as an IS mapping.")}throw new Error("Field '"+a+"' and '"+c.getName()+"' in PROTO '"+this.getExecutionContext().getName()+"' have different types.")}throw new Error("No name give after IS statement.")}throw new Error("IS statement outside PROTO definition.")}}}}if(this.input=t,this.lineNumber=n,d=this.interfaceDeclaration()){try{if(d.getAccessType()===r.inputOutput){var p=e.getField(d.getName());if(p.getAccessType()===r.inputOutput&&d.getType()===p.getType())return p.set(d.getValue()),p.setSet(!0),!0}}catch(e){}return e.addUserDefinedField(d.getAccessType(),d.getName(),d),!0}return this.nodeBodyElement(e)},createUserDefinedField:function(e,t,n,i){var r=new i.constructor;return e.addUserDefinedField(t,n,r),r},nodeBody:function(e){for(;this.nodeBodyElement(e););},nodeBodyElement:function(e){if(this.protoStatement())return!0;if(this.routeStatement())return!0;if(this.Id()){var t=this.result[1];try{var n=e.getField(t)}catch(n){throw new Error("Unknown field '"+t+"' in class '"+e.getTypeName()+"'.")}if(this.comments(),u.IS.parse(this)){if(this.isInsideProtoDefinition()){if(this.Id()){var i=this.result[1];try{var r=this.getExecutionContext().getField(i)}catch(e){return this.exception("No such event or field '"+i+"' inside PROTO "+this.getExecutionContext().getName()),!0}if(n.getType()===r.getType()){if(r.isReference(n.getAccessType()))return n.addReference(r),!0;throw new Error("Field '"+n.getName()+"' and '"+r.getName()+"' in PROTO "+this.getExecutionContext().getName()+" are incompatible as an IS mapping.")}throw new Error("Field '"+n.getName()+"' and '"+r.getName()+"' in PROTO "+this.getExecutionContext().getName()+" have different types.")}throw new Error("No name give after IS statement.")}throw new Error("IS statement outside PROTO definition.")}if(n.isInitializable()){if(this.fieldValue(n))return!0;throw new Error("Couldn't read value for field '"+t+"'.")}throw new Error("Couldn't assign value to "+o(n.getAccessType())+" field '"+t+"'.")}return!1},profileNameId:function(){return this.Id()},componentNameId:function(){return this.comments(),u.ComponentNameId.parse(this)},categoryNameId:function(){return this.Id()},unitNameId:function(){return this.Id()},exportedNodeNameId:function(){return this.Id()},nodeNameId:function(){return this.Id()},nodeTypeId:function(){return this.Id()},initializeOnlyId:function(){return this.Id()},inputOnlyId:function(){return this.Id()},outputOnlyId:function(){return this.Id()},inputOutputId:function(){return this.Id()},Id:function(){return this.comments(),u.Id.parse(this)},fieldType:function(){return this.comments(),u.FieldType.parse(this)},fieldValue:function(e){return e.setSet(!0),this.fieldTypes[e.getType()].call(this,e)},double:function(){return this.comments(),u.double.parse(this)?(this.value=parseFloat(this.result[1]),!0):u.Inf.parse(this)?(this.value=Number.POSITIVE_INFINITY,!0):u.NegativeInf.parse(this)?(this.value=Number.NEGATIVE_INFINITY,!0):!!u.NaN.parse(this)&&(this.value=Number.NaN,!0)},int32:function(){return this.comments(),!!u.int32.parse(this)&&(this.value=parseInt(this.result[1]),!0)},string:function(){return this.comments(),!!u.string.parse(this)&&(this.value=t.SFString.unescape(this.result[1]),this.isXML||this.lines(this.value),!0)},sfboolValue:function(e){if(this.comments(),this.isXML){if(u.true.parse(this))return e.set(!0),!0;if(u.false.parse(this))return e.set(!1),!0}return u.TRUE.parse(this)?(e.set(!0),!0):!!u.FALSE.parse(this)&&(e.set(!1),!0)},mfboolValue:function(e){if(e.length=0,this.sfboolValue(this.SFBool))return e.push(this.SFBool),!0;if(u.OpenBracket.parse(this)){if(this.sfboolValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfboolValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFBool;this.sfboolValue(i);)i.addParent(e),n.push(i),i=new t.SFBool},sfcolorValue:function(e){if(this.double()){var t=this.value;if(this.double()){var n=this.value;if(this.double()){var i=this.value;return e.getValue().set(t,n,i),!0}}}return!1},mfcolorValue:function(e){if(e.length=0,this.sfcolorValue(this.SFColor))return e.push(this.SFColor),!0;if(u.OpenBracket.parse(this)){if(this.sfcolorValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfcolorValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFColor;this.sfcolorValue(i);)i.addParent(e),n.push(i),i=new t.SFColor},sfcolorrgbaValue:function(e){if(this.double()){var t=this.value;if(this.double()){var n=this.value;if(this.double()){var i=this.value;if(this.double()){var r=this.value;return e.getValue().set(t,n,i,r),!0}}}}return!1},mfcolorrgbaValue:function(e){if(e.length=0,this.sfcolorrgbaValue(this.SFColorRGBA))return e.push(this.SFColorRGBA),!0;if(u.OpenBracket.parse(this)){if(this.sfcolorrgbaValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfcolorrgbaValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFColorRGBA;this.sfcolorrgbaValue(i);)i.addParent(e),n.push(i),i=new t.SFColorRGBA},sfdoubleValue:function(e){return!!this.double()&&(e.set(this.value),!0)},mfdoubleValue:function(e){if(e.length=0,this.sfdoubleValue(this.SFDouble))return e.push(this.SFDouble),!0;if(u.OpenBracket.parse(this)){if(this.sfdoubleValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfdoubleValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFDouble;this.sfdoubleValue(i);)i.addParent(e),n.push(i),i=new t.SFDouble},sffloatValue:function(e){return this.sfdoubleValue(e)},mffloatValue:function(e){if(e.length=0,this.sffloatValue(this.SFFloat))return e.push(this.SFFloat),!0;if(u.OpenBracket.parse(this)){if(this.sffloatValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sffloatValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFFloat;this.sffloatValue(i);)i.addParent(e),n.push(i),i=new t.SFFloat},sfimageValue:function(e){if(this.int32()){var t=this.value;if(this.int32()){var n=this.value;if(this.int32()){for(var i=this.value,r=[],o=t*n,s=0;s<o;++s){if(!this.int32())return!1;r.push(this.value)}return e.getValue().set(t,n,i,r),!0}}}return!1},mfimageValue:function(e){if(e.length=0,this.sfimageValue(this.SFImage))return e.push(this.SFImage),!0;if(u.OpenBracket.parse(this)){if(this.sfimageValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfimageValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFImage;this.sfimageValue(i);)i.addParent(e),n.push(i),i=new t.SFImage},sfint32Value:function(e){return!!this.int32()&&(e.set(this.value),!0)},mfint32Value:function(e){if(e.length=0,this.sfint32Value(this.SFInt32))return e.push(this.SFInt32),!0;if(u.OpenBracket.parse(this)){if(this.sfint32Values(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfint32Values:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFInt32;this.sfint32Value(i);)i.addParent(e),n.push(i),i=new t.SFInt32},sfmatrix3dValue:function(e){if(this.double()){var t=this.value;if(this.double()){var n=this.value;if(this.double()){var i=this.value;if(this.double()){var r=this.value;if(this.double()){var o=this.value;if(this.double()){var s=this.value;if(this.double()){var a=this.value;if(this.double()){var u=this.value;if(this.double()){var l=this.value;return e.getValue().set(t,n,i,r,o,s,a,u,l),!0}}}}}}}}}return!1},mfmatrix3dValue:function(e){if(e.length=0,this.sfmatrix3dValue(this.SFMatrix3d))return e.push(this.SFMatrix3d),!0;if(u.OpenBracket.parse(this)){if(this.sfmatrix3dValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfmatrix3dValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFMatrix3d;this.sfmatrix3dValue(i);)i.addParent(e),n.push(i),i=new t.SFMatrix3d},sfmatrix3fValue:function(e){return this.sfmatrix3dValue(e)},mfmatrix3fValue:function(e){if(e.length=0,this.sfmatrix3fValue(this.SFMatrix3f))return e.push(this.SFMatrix3f),!0;if(u.OpenBracket.parse(this)){if(this.sfmatrix3fValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfmatrix3fValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFMatrix3f;this.sfmatrix3fValue(i);)i.addParent(e),n.push(i),i=new t.SFMatrix3f},sfmatrix4dValue:function(e){if(this.double()){var t=this.value;if(this.double()){var n=this.value;if(this.double()){var i=this.value;if(this.double()){var r=this.value;if(this.double()){var o=this.value;if(this.double()){var s=this.value;if(this.double()){var a=this.value;if(this.double()){var u=this.value;if(this.double()){var l=this.value;if(this.double()){var c=this.value;if(this.double()){var h=this.value;if(this.double()){var d=this.value;if(this.double()){var p=this.value;if(this.double()){var f=this.value;if(this.double()){var g=this.value;if(this.double()){var m=this.value;return e.getValue().set(t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m),!0}}}}}}}}}}}}}}}}return!1},mfmatrix4dValue:function(e){if(e.length=0,this.sfmatrix4dValue(this.SFMatrix4d))return e.push(this.SFMatrix4d),!0;if(u.OpenBracket.parse(this)){if(this.sfmatrix4dValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfmatrix4dValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFMatrix4d;this.sfmatrix4dValue(i);)i.addParent(e),n.push(i),i=new t.SFMatrix4d},sfmatrix4fValue:function(e){return this.sfmatrix4dValue(e)},mfmatrix4fValue:function(e){if(e.length=0,this.sfmatrix4fValue(this.SFMatrix4f))return e.push(this.SFMatrix4f),!0;if(u.OpenBracket.parse(this)){if(this.sfmatrix4fValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfmatrix4fValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFMatrix4f;this.sfmatrix4fValue(i);)i.addParent(e),n.push(i),i=new t.SFMatrix4f},sfnodeValue:function(e){var t=this.nodeStatement();return!1!==t&&(e.setValue(t),!0)},mfnodeValue:function(e){e.length=0;var t=this.nodeStatement();if(!1!==t)return e.push(t),!0;if(u.OpenBracket.parse(this)){if(this.nodeStatements(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},nodeStatements:function(e){for(var t=this.nodeStatement();!1!==t;)e.push(t),t=this.nodeStatement()},sfrotationValue:function(e){if(this.double()){var t=this.value;if(this.double()){var n=this.value;if(this.double()){var i=this.value;if(this.double()){var r=this.value;return e.getValue().set(t,n,i,r),!0}}}}return!1},mfrotationValue:function(e){if(e.length=0,this.sfrotationValue(this.SFRotation))return e.push(this.SFRotation),!0;if(u.OpenBracket.parse(this)){if(this.sfrotationValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfrotationValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFRotation;this.sfrotationValue(i);)i.addParent(e),n.push(i),i=new t.SFRotation},sfstringValue:function(e){return!!this.string()&&(e.set(this.value),!0)},mfstringValue:function(e){if(e.length=0,this.sfstringValue(this.SFString))return e.push(this.SFString),!0;if(u.OpenBracket.parse(this)){if(this.sfstringValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfstringValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFString;this.sfstringValue(i);)i.addParent(e),n.push(i),i=new t.SFString},sftimeValue:function(e){return this.sfdoubleValue(e)},mftimeValue:function(e){if(e.length=0,this.sftimeValue(this.SFTime))return e.push(this.SFTime),!0;if(u.OpenBracket.parse(this)){if(this.sftimeValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sftimeValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFTime;this.sftimeValue(i);)i.addParent(e),n.push(i),i=new t.SFTime},sfvec2dValue:function(e){if(this.double()){var t=this.value;if(this.double()){var n=this.value;return e.getValue().set(t,n),!0}}return!1},mfvec2dValue:function(e){if(e.length=0,this.sfvec2dValue(this.SFVec2d))return e.push(this.SFVec2d),!0;if(u.OpenBracket.parse(this)){if(this.sfvec2dValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec2dValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFVec2d;this.sfvec2dValue(i);)i.addParent(e),n.push(i),i=new t.SFVec2d},sfvec2fValue:function(e){return this.sfvec2dValue(e)},mfvec2fValue:function(e){if(e.length=0,this.sfvec2fValue(this.SFVec2f))return e.push(this.SFVec2f),!0;if(u.OpenBracket.parse(this)){if(this.sfvec2fValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec2fValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFVec2f;this.sfvec2fValue(i);)i.addParent(e),n.push(i),i=new t.SFVec2f},sfvec3dValue:function(e){if(this.double()){var t=this.value;if(this.double()){var n=this.value;if(this.double()){var i=this.value;return e.getValue().set(t,n,i),!0}}}return!1},mfvec3dValue:function(e){if(e.length=0,this.sfvec3dValue(this.SFVec3d))return e.push(this.SFVec3d),!0;if(u.OpenBracket.parse(this)){if(this.sfvec3dValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec3dValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFVec3d;this.sfvec3dValue(i);)i.addParent(e),n.push(i),i=new t.SFVec3d},sfvec3fValue:function(e){return this.sfvec3dValue(e)},mfvec3fValue:function(e){if(e.length=0,this.sfvec3fValue(this.SFVec3f))return e.push(this.SFVec3f),!0;if(u.OpenBracket.parse(this)){if(this.sfvec3fValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec3fValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFVec3f;this.sfvec3fValue(i);)i.addParent(e),n.push(i),i=new t.SFVec3f},sfvec4dValue:function(e){if(this.double()){var t=this.value;if(this.double()){var n=this.value;if(this.double()){var i=this.value;if(this.double()){var r=this.value;return e.getValue().set(t,n,i,r),!0}}}}return!1},mfvec4dValue:function(e){if(e.length=0,this.sfvec4dValue(this.SFVec4d))return e.push(this.SFVec4d),!0;if(u.OpenBracket.parse(this)){if(this.sfvec4dValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec4dValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFVec4d;this.sfvec4dValue(i);)i.addParent(e),n.push(i),i=new t.SFVec4d},sfvec4fValue:function(e){return this.sfvec4dValue(e)},mfvec4fValue:function(e){if(e.length=0,this.sfvec4fValue(this.SFVec4f))return e.push(this.SFVec4f),!0;if(u.OpenBracket.parse(this)){if(this.sfvec4fValues(e),this.comments(),u.CloseBracket.parse(this))return!0;throw new Error("Expected ']'.")}return!1},sfvec4fValues:function(e){e.length=0;for(var n=e.getValue(),i=new t.SFVec4f;this.sfvec4fValue(i);)i.addParent(e),n.push(i),i=new t.SFVec4f}},a.prototype.fieldTypes=[],a.prototype.fieldTypes[r.SFBool]=a.prototype.sfboolValue,a.prototype.fieldTypes[r.SFColor]=a.prototype.sfcolorValue,a.prototype.fieldTypes[r.SFColorRGBA]=a.prototype.sfcolorrgbaValue,a.prototype.fieldTypes[r.SFDouble]=a.prototype.sfdoubleValue,a.prototype.fieldTypes[r.SFFloat]=a.prototype.sffloatValue,a.prototype.fieldTypes[r.SFImage]=a.prototype.sfimageValue,a.prototype.fieldTypes[r.SFInt32]=a.prototype.sfint32Value,a.prototype.fieldTypes[r.SFMatrix3f]=a.prototype.sfmatrix4dValue,a.prototype.fieldTypes[r.SFMatrix3d]=a.prototype.sfmatrix4fValue,a.prototype.fieldTypes[r.SFMatrix4f]=a.prototype.sfmatrix4dValue,a.prototype.fieldTypes[r.SFMatrix4d]=a.prototype.sfmatrix4fValue,a.prototype.fieldTypes[r.SFNode]=a.prototype.sfnodeValue,a.prototype.fieldTypes[r.SFRotation]=a.prototype.sfrotationValue,a.prototype.fieldTypes[r.SFString]=a.prototype.sfstringValue,a.prototype.fieldTypes[r.SFTime]=a.prototype.sftimeValue,a.prototype.fieldTypes[r.SFVec2d]=a.prototype.sfvec2dValue,a.prototype.fieldTypes[r.SFVec2f]=a.prototype.sfvec2fValue,a.prototype.fieldTypes[r.SFVec3d]=a.prototype.sfvec3dValue,a.prototype.fieldTypes[r.SFVec3f]=a.prototype.sfvec3fValue,a.prototype.fieldTypes[r.SFVec4d]=a.prototype.sfvec4dValue,a.prototype.fieldTypes[r.SFVec4f]=a.prototype.sfvec4fValue,a.prototype.fieldTypes[r.MFBool]=a.prototype.mfboolValue,a.prototype.fieldTypes[r.MFColor]=a.prototype.mfcolorValue,a.prototype.fieldTypes[r.MFColorRGBA]=a.prototype.mfcolorrgbaValue,a.prototype.fieldTypes[r.MFDouble]=a.prototype.mfdoubleValue,a.prototype.fieldTypes[r.MFFloat]=a.prototype.mffloatValue,a.prototype.fieldTypes[r.MFImage]=a.prototype.mfimageValue,a.prototype.fieldTypes[r.MFInt32]=a.prototype.mfint32Value,a.prototype.fieldTypes[r.MFMatrix3d]=a.prototype.mfmatrix3dValue,a.prototype.fieldTypes[r.MFMatrix3f]=a.prototype.mfmatrix3fValue,a.prototype.fieldTypes[r.MFMatrix4d]=a.prototype.mfmatrix4dValue,a.prototype.fieldTypes[r.MFMatrix4f]=a.prototype.mfmatrix4fValue,a.prototype.fieldTypes[r.MFNode]=a.prototype.mfnodeValue,a.prototype.fieldTypes[r.MFRotation]=a.prototype.mfrotationValue,a.prototype.fieldTypes[r.MFString]=a.prototype.mfstringValue,a.prototype.fieldTypes[r.MFTime]=a.prototype.mftimeValue,a.prototype.fieldTypes[r.MFVec2d]=a.prototype.mfvec2dValue,a.prototype.fieldTypes[r.MFVec2f]=a.prototype.mfvec2fValue,a.prototype.fieldTypes[r.MFVec3d]=a.prototype.mfvec3dValue,a.prototype.fieldTypes[r.MFVec3f]=a.prototype.mfvec3fValue,a.prototype.fieldTypes[r.MFVec4d]=a.prototype.mfvec4dValue,a.prototype.fieldTypes[r.MFVec4f]=a.prototype.mfvec4fValue,a}),define("lib/DataStorage",[],function(){function e(e){return t.set(this,e),new Proxy(this,n)}var t=new WeakMap,n={get:function(e,t){if(t in e)return e[t];var n=localStorage[e.getNameSpace()+t];if(void 0!==n)return JSON.parse(n)},set:function(e,t,n){return localStorage[e.getNameSpace()+t]=JSON.stringify(n),!0}};return e.prototype={constructor:e,getNameSpace:function(){return t.get(this)},removeItem:function(e){return localStorage.removeItem(this.getNameSpace()+e)},clear:function(){return localStorage.clear()}},e}),define("cobweb/Browser/Core/X3DCoreContext",["cobweb/Fields","cobweb/Browser/Core/BrowserOptions","cobweb/Browser/Core/BrowserProperties","cobweb/Browser/Core/RenderingProperties","cobweb/Browser/Core/Notification","cobweb/Browser/Core/BrowserTimings","cobweb/Browser/Core/ContextMenu","cobweb/Execution/Scene","cobweb/Parser/Parser","lib/DataStorage"],function(e,t,n,i,r,o,s,a,u,l){function c(e){var t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)throw new Error("Couldn't create WebGL context.");var n=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE);return 1===n[0]&&1===n[1]&&(t.lineWidth=Function.prototype),t}function h(e){this.number=++d,this.element=e;var u=$("<div></div>").addClass("cobweb-browser").prependTo(this.element),h=$("<div></div>").addClass("cobweb-splash-screen").appendTo(u),p=$("<div></div>").addClass("cobweb-spinner").appendTo(h),f=$("<div></div>").addClass("cobweb-progress").appendTo(h),g=$("<div></div>").addClass("cobweb-surface cobweb-surface-"+this.getId()).appendTo(u);$("<div></div>").addClass("cobweb-spinner-one").appendTo(p),$("<div></div>").addClass("cobweb-spinner-two").appendTo(p),$("<div></div>").addClass("cobweb-spinner-three").appendTo(p),$("<div></div>").addClass("cobweb-spinner-text").appendTo(f).text("Lade 0 Dateien"),$("<div></div>").addClass("cobweb-progressbar").appendTo(f).append($("<div></div>")),this.splashScreen=h,this.canvas=$("<canvas></canvas>").prependTo(g),this.context=c(this.canvas[0]),this.privateScene=new a(this),this.browserOptions=new t(this.getPrivateScene()),this.browserProperties=new n(this.getPrivateScene()),this.renderingProperties=new i(this.getPrivateScene()),this.notification=new r(this.getPrivateScene()),this.browserTimings=new o(this.getPrivateScene()),this.contextMenu=new s(this.getPrivateScene()),this.dataStorage=new l("X3DBrowser("+this.number+")."),this.mobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.getCanvas().fadeOut(0),this.getBrowserOptions().getSplashScreen()&&this.getSplashScreen().fadeIn(0),$(".cobweb-console").empty()}var d=0;return h.prototype={initialize:function(){this.privateScene.setPrivate(!0),this.privateScene.setLive(!0),this.privateScene.setup(),this.browserOptions.setup(),this.browserProperties.setup(),this.renderingProperties.setup(),this.notification.setup(),this.browserTimings.setup(),this.contextMenu.setup(),this.observer=new MutationObserver(this.processMutations.bind(this)),this.observer.observe(this.element[0],{attributes:!0,childList:!1,characterData:!1,subtree:!1})},getNumber:function(){return this.number},isStrict:function(){return!1},getElement:function(){return this.element},getSplashScreen:function(){return this.splashScreen},getCanvas:function(){return this.canvas},getContext:function(){return this.context},getBrowserOptions:function(){return this.browserOptions},getBrowserProperties:function(){return this.browserProperties},getRenderingProperties:function(){return this.renderingProperties},getNotification:function(){return this.notification},getBrowserTimings:function(){return this.browserTimings},getDataStorage:function(){return this.dataStorage},getMobile:function(){return this.mobile},processMutations:function(e){e.forEach(function(e){this.processMutation(e)},this)},processMutation:function(e){var t=e.target;switch(e.type){case"attributes":this.processAttribute(e,t)}},processAttribute:function(e,t){switch(e.attributeName.toLowerCase()){case"src":var n=this.getElement().attr("src");n&&this.load('"'+n+'"');break;case"url":this.load(this.getElement().attr("url"));break;case"splashscreen":this.getBrowserOptions().setAttributeSplashScreen()}},load:function(t){if(t){var n=new u(this.getExecutionContext(),!0),i=new e.MFString,r=new e.MFString;n.setInput(t),n.sfstringValues(i),i.length&&this.loadURL(i,r)}else this.getLoading()||this.getCanvas().fadeIn(0)},getPrivateScene:function(){return this.privateScene}},h}),define("cobweb/Routing/X3DRoutingContext",[],function(){function e(){this.taintedFields=[],this.taintedFieldsTemp=[],this.taintedNodes=[],this.taintedNodesTemp=[]}return e.prototype={constructor:e,initialize:function(){},addTaintedField:function(e,t){this.taintedFields.push(e,t)},addTaintedNode:function(e){this.taintedNodes.push(e)},processEvents:function(){do{do{var e=this.taintedFields;this.taintedFields=this.taintedFieldsTemp,this.taintedFields.length=0;for(var t=0,n=e.length;t<n;t+=2)e[t].processEvent(e[t+1]);this.taintedFieldsTemp=e}while(this.taintedFields.length);do{var i=this.taintedNodes;this.taintedNodes=this.taintedNodesTemp,this.taintedNodes.length=0;for(var t=0,n=i.length;t<n;++t)i[t].processEvents();this.taintedNodesTemp=i}while(!this.taintedFields.length&&this.taintedNodes.length)}while(this.taintedFields.length)}},e}),define("cobweb/Browser/Scripting/X3DScriptingContext",[],function(){function e(){this.scripts=[this]}return e.prototype={initialize:function(){},isExternal:function(){return 1===this.scripts.length},getScriptStack:function(){return this.scripts}},e}),define("cobweb/Components/Core/X3DChildNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e){this.getExecutionContext()||(n.call(this,e),this.addType(i.X3DChildNode),this.addChildObjects("isCameraObject",new t.SFBool))}return r.prototype=e.extend(Object.create(n.prototype),{constructor:r,setCameraObject:function(e){e!==this.isCameraObject_.getValue()&&(this.isCameraObject_=e)},getCameraObject:function(){return this.isCameraObject_.getValue()}}),r}),define("cobweb/Components/Core/X3DSensorNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DSensorNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Networking/X3DNetworkSensorNode",["jquery","cobweb/Components/Core/X3DSensorNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DNetworkSensorNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Networking/LoadSensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Networking/X3DNetworkSensorNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.LoadSensor),this.urlObjects=[],this.aborted=!1,this.timeOutId=void 0}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"enabled",new t.SFBool(!0)),new n(s.inputOutput,"timeOut",new t.SFTime),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"isLoaded",new t.SFBool),new n(s.outputOnly,"progress",new t.SFFloat),new n(s.outputOnly,"loadTime",new t.SFTime),new n(s.inputOutput,"watchList",new t.MFNode)]),getTypeName:function(){return"LoadSensor"},getComponentName:function(){return"Networking"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this),this.timeOut_.addInterest("set_timeOut__",this),this.watchList_.addInterest("set_watchList__",this),this.watchList_.addEvent()},set_enabled__:function(){this.enabled_.getValue()?this.reset():(this.abort(),this.remove())},set_timeOut__:function(){this.isActive_.getValue()&&(this.clearTimeout(),this.aborted=!1,this.timeOut_.getValue()>0&&(this.timeOutId=setTimeout(this.abort.bind(this),1e3*this.timeOut_.getValue())))},set_watchList__:function(){this.reset()},set_loadState__:function(e,t){switch(t.checkLoadState()){case s.NOT_STARTED_STATE:break;case s.IN_PROGRESS_STATE:case s.COMPLETE_STATE:case s.FAILED_STATE:this.count()}},count:function(){for(var e=0,t=0,n=this.urlObjects,i=0,r=n.length;i<r;++i){var o=n[i];e+=o.checkLoadState()==s.COMPLETE_STATE,t+=o.checkLoadState()==s.FAILED_STATE}var a=e/n.length;if(this.aborted||t||e==n.length){var u=e==n.length;this.clearTimeout(),this.isActive_=!1,this.isLoaded_=u,this.progress_=a,u&&(this.loadTime_=this.getBrowser().getCurrentTime())}else this.isActive_.getValue()?this.progress_=a:(this.isActive_=!0,this.progress_=a,this.set_timeOut__())},abort:function(){this.clearTimeout(),this.aborted=!0,this.enabled_.getValue()&&this.count()},reset:function(){if(this.remove(),this.enabled_.getValue()){for(var e=this.watchList_.getValue(),t=this.urlObjects,n=0,i=e.length;n<i;++n){var r=o(s.X3DUrlObject,e[n]);r&&(t.push(r),r.loadState_.addInterest("set_loadState__",this,r))}this.count()}},remove:function(){this.clearTimeout();for(var e=this.urlObjects,t=0,n=e.length;t<n;++t)e[t].loadState_.removeInterest("set_loadState__",this);e.length=0},clearTimeout:function(){clearTimeout(this.timeOutId),this.timeOutId=void 0}}),a}),define("cobweb/Browser/Networking/urls",[],function(){return{providerUrl:"http://titania.create3000.de/cobweb",fallbackUrl:"http://cors.create3000.de/",fallbackExpression:new RegExp("^http://cors.create3000.de/")}}),function(e){function t(){var e=arguments[0],n=t.cache;return n[e]&&n.hasOwnProperty(e)||(n[e]=t.parse(e)),t.format.call(null,n[e],arguments)}function n(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(e,t){return Array(t+1).join(e)}var r={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};t.format=function(e,o){var s,a,u,l,c,h,d,p=1,f=e.length,g="",m=[],b=!0,w="";for(a=0;a<f;a++)if("string"===(g=n(e[a])))m[m.length]=e[a];else if("array"===g){if((l=e[a])[2])for(s=o[p],u=0;u<l[2].length;u++){if(!s.hasOwnProperty(l[2][u]))throw new Error(t("[sprintf] property '%s' does not exist",l[2][u]));s=s[l[2][u]]}else s=l[1]?o[l[1]]:o[p++];if("function"==n(s)&&(s=s()),r.not_string.test(l[8])&&r.not_json.test(l[8])&&"number"!=n(s)&&isNaN(s))throw new TypeError(t("[sprintf] expecting number but found %s",n(s)));switch(r.number.test(l[8])&&(b=s>=0),l[8]){case"b":s=s.toString(2);break;case"c":s=String.fromCharCode(s);break;case"d":case"i":s=parseInt(s,10);break;case"j":s=JSON.stringify(s,null,l[6]?parseInt(l[6]):0);break;case"e":s=l[7]?s.toExponential(l[7]):s.toExponential();break;case"f":s=l[7]?parseFloat(s).toFixed(l[7]):parseFloat(s);break;case"g":s=l[7]?parseFloat(s).toPrecision(l[7]):parseFloat(s);break;case"o":s=s.toString(8);break;case"s":s=(s=String(s))&&l[7]?s.substring(0,l[7]):s;break;case"u":s>>>=0;break;case"x":s=s.toString(16);break;case"X":s=s.toString(16).toUpperCase()}r.json.test(l[8])?m[m.length]=s:(!r.number.test(l[8])||b&&!l[3]?w="":(w=b?"+":"-",s=s.toString().replace(r.sign,"")),h=l[4]?"0"===l[4]?"0":l[4].charAt(1):" ",d=l[6]-(w+s).length,c=l[6]&&d>0?i(h,d):"",m[m.length]=l[5]?w+s+c:"0"===h?w+c+s:c+w+s)}return m.join("")},t.cache={},t.parse=function(e){for(var t=e,n=[],i=[],o=0;t;){if(null!==(n=r.text.exec(t)))i[i.length]=n[0];else if(null!==(n=r.modulo.exec(t)))i[i.length]="%";else{if(null===(n=r.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){o|=1;var s=[],a=n[2],u=[];if(null===(u=r.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s[s.length]=u[1];""!==(a=a.substring(u[0].length));)if(null!==(u=r.key_access.exec(a)))s[s.length]=u[1];else{if(null===(u=r.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");s[s.length]=u[1]}n[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=n}t=t.substring(n[0].length)}return i};var o=function(e,n,i){return(i=(n||[]).slice(0)).splice(0,0,e),t.apply(null,i)};"undefined"!=typeof exports?(exports.sprintf=t,exports.vsprintf=o):(e.sprintf=t,e.vsprintf=o,"function"==typeof define&&define.amd&&define("lib/sprintf.js/src/sprintf",[],function(){return{sprintf:t,vsprintf:o}}))}("undefined"==typeof window?this:window),define("cobweb/Browser/Networking/X3DNetworkingContext",["cobweb/Fields","cobweb/Components/Networking/LoadSensor","cobweb/Browser/Networking/urls","standard/Networking/URI","lib/sprintf.js/src/sprintf","lib/gettext"],function(e,t,n,i,r,o){function s(e){var t=e.baseURI;return t.startsWith("about:")&&(t=document.baseURI),new i(t)}function a(){this.addChildObjects("loadCount",new e.SFInt32),this.loadSensor=new t(this.getPrivateScene()),this.loadingTotal=0,this.loadingObjects={},this.loading=!1,this.location=s(this.getElement()[0]),this.defaultScene=this.createScene()}return a.prototype={initialize:function(){this.loadSensor.setup(),this.defaultScene.setPrivate(!0),this.defaultScene.setLive(!0),this.defaultScene.setup()},getProviderUrl:function(){return n.providerUrl},getLocation:function(){return this.location},getDefaultScene:function(){return this.defaultScene},getLoadSensor:function(){return this.loadSensor},setBrowserLoading:function(e){this.loading=e,e?(this.resetLoadCount(),this.getBrowserOptions().getSplashScreen()&&(this.getCanvas().stop(!0,!0).animate({delay:1},1).fadeOut(0),this.getSplashScreen().stop(!0,!0).animate({delay:1},1).fadeIn(0))):this.getBrowserOptions().getSplashScreen()?(this.getSplashScreen().stop(!0,!0).fadeOut(2e3),this.getCanvas().stop(!0,!0).fadeIn(2e3)):this.getCanvas().fadeIn(0)},getLoading:function(){return this.loading},addLoadCount:function(e){var t=e.getId();this.loadingObjects.hasOwnProperty(t)||(++this.loadingTotal,this.loadingObjects[t]=e,this.setLoadCount(this.loadCount_=this.loadCount_.getValue()+1),this.setCursor("DEFAULT"))},removeLoadCount:function(e){var t=e.getId();this.loadingObjects.hasOwnProperty(t)&&(delete this.loadingObjects[t],this.setLoadCount(this.loadCount_=this.loadCount_.getValue()-1))},setLoadCount:function(e){if(e)t=r.sprintf(o(1==e?"Loading %d file":"Loading %d files"),e);else{var t=o("Loading done");this.setCursor("DEFAULT")}this.loading||(this.getNotification().string_=t),this.getSplashScreen().find(".cobweb-spinner-text").text(t),this.getSplashScreen().find(".cobweb-progressbar div").css("width",100*(this.loadingTotal-e)/this.loadingTotal+"%")},resetLoadCount:function(){this.loadCount_=0,this.loadingTotal=0,this.loadingObjects={}}},a}),define("cobweb/Browser/Shaders/X3DShadersContext",[],function(){function e(){this.shaders={}}return e.prototype={initialize:function(){},getShadingLanguageVersion:function(){return this.getContext().getParameter(this.getContext().SHADING_LANGUAGE_VERSION)},getMaxVertexUniformVectors:function(){return this.getContext().getParameter(this.getContext().MAX_VERTEX_UNIFORM_VECTORS)},getMaxFragmentUniformVectors:function(){return this.getContext().getParameter(this.getContext().MAX_FRAGMENT_UNIFORM_VECTORS)},getMaxVertexAttribs:function(){return this.getContext().getParameter(this.getContext().MAX_VERTEX_ATTRIBS)},addShader:function(e){this.shaders[e.getId()]=e,e.setShading(this.getBrowserOptions().getShading())},removeShader:function(e){delete this.shaders[e.getId()]},getShaders:function(){return this.shaders}},e}),define("cobweb/Components/Shape/X3DAppearanceNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e){n.call(this,e),this.addType(i.X3DAppearanceNode)}return r.prototype=e.extend(Object.create(n.prototype),{constructor:r,initialize:function(){n.prototype.initialize.call(this),this.addChildObjects("transparent",new t.SFBool)}}),r}),define("cobweb/Components/Shape/Appearance",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shape/X3DAppearanceNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.Appearance),this.linePropertiesNode=null,this.materialNode=null,this.textureNode=null,this.textureTransformNode=null,this.shaderNodes=[],this.shaderNode=null}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"fillProperties",new t.SFNode),new n(s.inputOutput,"lineProperties",new t.SFNode),new n(s.inputOutput,"material",new t.SFNode),new n(s.inputOutput,"texture",new t.SFNode),new n(s.inputOutput,"textureTransform",new t.SFNode),new n(s.inputOutput,"shaders",new t.MFNode)]),getTypeName:function(){return"Appearance"},getComponentName:function(){return"Shape"},getContainerField:function(){return"appearance"},initialize:function(){r.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.lineProperties_.addInterest("set_lineProperties__",this),this.material_.addInterest("set_material__",this),this.texture_.addInterest("set_texture__",this),this.textureTransform_.addInterest("set_textureTransform__",this),this.shaders_.addInterest("set_shaders__",this),this.set_lineProperties__(),this.set_material__(),this.set_texture__(),this.set_textureTransform__(),this.set_shaders__()},getLineProperties:function(){return this.linePropertiesNode},getMaterial:function(){return this.materialNode},getTexture:function(){return this.textureNode},getTextureTransform:function(){return this.textureTransformNode},set_lineProperties__:function(){this.linePropertiesNode=o(s.LineProperties,this.lineProperties_)},set_live__:function(){this.isLive().getValue()?this.shaderNode&&this.getBrowser().addShader(this.shaderNode):this.shaderNode&&this.getBrowser().removeShader(this.shaderNode)},set_material__:function(){this.materialNode&&this.materialNode.transparent_.removeInterest("set_transparent__",this),this.materialNode=o(s.X3DMaterialNode,this.material_),this.materialNode&&this.materialNode.transparent_.addInterest("set_transparent__",this),this.set_transparent__()},set_texture__:function(){this.textureNode&&this.textureNode.transparent_.removeInterest("set_transparent__",this),this.textureNode=o(s.X3DTextureNode,this.texture_),this.textureNode&&this.textureNode.transparent_.addInterest("set_transparent__",this),this.generatedCubeMapTexture=o(s.GeneratedCubeMapTexture,this.texture_),this.set_transparent__()},set_textureTransform__:function(){this.textureTransformNode=o(s.X3DTextureTransformNode,this.textureTransform_),this.textureTransformNode||(this.textureTransformNode=this.getBrowser().getDefaultTextureTransform())},set_shaders__:function(){for(var e=this.shaders_.getValue(),t=this.shaderNodes,n=0,i=t.length;n<i;++n)t[n].isValid_.removeInterest("set_shader__",this);t.length=0;for(var n=0,i=e.length;n<i;++n){var r=o(s.X3DShaderNode,e[n]);r&&(t.push(r),r.isValid_.addInterest("set_shader__",this))}this.set_shader__()},set_shader__:function(){var e=this.shaderNodes;this.shaderNode&&this.getBrowser().removeShader(this.shaderNode),this.shaderNode=null;for(var t=0,n=e.length;t<n;++t)if(e[t].isValid_.getValue()){this.shaderNode=e[t];break}this.isLive().getValue()&&this.shaderNode&&this.getBrowser().addShader(this.shaderNode),this.set_transparent__()},set_transparent__:function(){this.transparent_=this.materialNode&&this.materialNode.transparent_.getValue()||this.textureNode&&this.textureNode.transparent_.getValue()},traverse:function(e,t){this.generatedCubeMapTexture&&this.generatedCubeMapTexture.traverse(e,t),this.shaderNode&&this.shaderNode.traverse(e,t)},display:function(e){e.linePropertiesNode=this.linePropertiesNode,e.materialNode=this.materialNode,e.textureNode=this.textureNode,e.textureTransformNode=this.textureTransformNode,e.shaderNode=this.shaderNode||e.renderer.getBrowser().getDefaultShader()}}),a}),define("cobweb/Browser/Shape/X3DShapeContext",["cobweb/Components/Shape/Appearance"],function(e){function t(){this.defaultAppearance=new e(this.getPrivateScene())}return t.prototype={initialize:function(){this.defaultAppearance.setup()},getDefaultAppearance:function(){return this.defaultAppearance}},t}),define("cobweb/Components/Shape/X3DAppearanceChildNode",["jquery","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DAppearanceChildNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Bits/TraverseType",[],function(){var e=0,t={POINTER:e++,CAMERA:e++,COLLISION:e++,DEPTH:e++,DISPLAY:e++};return Object.preventExtensions(t),Object.freeze(t),Object.seal(t),t}),define("cobweb/Components/Shaders/X3DShaderNode",["jquery","cobweb/Components/Shape/X3DAppearanceChildNode","cobweb/Bits/X3DConstants","cobweb/Bits/TraverseType"],function(e,t,n,i){function r(e){t.call(this,e),this.addType(n.X3DShaderNode)}return r.prototype=e.extend(Object.create(t.prototype),{constructor:r,custom:!0,setCustom:function(e){this.custom=e},getCustom:function(){return this.custom},setGeometryType:function(e){this.setShading(e,this.getBrowser().getBrowserOptions().Shading_.getValue())},setShading:function(e,t){var n=this.getBrowser().getContext();switch(e){case 0:switch(t){case"POINT":case"POINTSET":case"WIREFRAME":default:this.primitiveMode=n.POINTS,this.wireframe=!0}break;case 1:switch(t){case"POINT":case"POINTSET":this.primitiveMode=n.POINTS,this.wireframe=!0;break;case"WIREFRAME":default:this.primitiveMode=n.LINES,this.wireframe=!0}break;case 2:case 3:switch(t){case"POINT":case"POINTSET":this.primitiveMode=n.POINTS,this.wireframe=!0;break;case"WIREFRAME":this.primitiveMode=n.LINE_LOOP,this.wireframe=!0;break;default:this.primitiveMode=n.TRIANGLES,this.wireframe=!1}}},traverse:function(e,t){switch(e){case i.DISPLAY:t.getShaders()[this.getId()]=this}}}),r}),define("cobweb/Components/Shaders/X3DProgrammableShaderObject",["jquery","cobweb/Fields","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix3"],function(e,t,n,i,r){function o(e){this.addType(i.X3DProgrammableShaderObject),this.x3d_ClipPlane=[],this.x3d_LightType=[],this.x3d_LightOn=[],this.x3d_LightColor=[],this.x3d_LightIntensity=[],this.x3d_LightAmbientIntensity=[],this.x3d_LightAttenuation=[],this.x3d_LightLocation=[],this.x3d_LightDirection=[],this.x3d_LightBeamWidth=[],this.x3d_LightCutOffAngle=[],this.x3d_LightRadius=[],this.x3d_ShadowIntensity=[],this.x3d_ShadowDiffusion=[],this.x3d_ShadowColor=[],this.x3d_ShadowMatrix=[],this.x3d_ShadowMap=[]}var s=new r,a=new t.SFNode;return o.prototype={constructor:o,x3d_NoneClipPlane:new Float32Array([88,51,68,33]),fogNode:null,numGlobalLights:0,normalMatrixArray:new Float32Array(9),initialize:function(){var e=this.getBrowser();this.x3d_MaxClipPlanes=e.getMaxClipPlanes(),this.x3d_MaxLights=e.getMaxLights(),this.x3d_MaxTextures=e.getMaxTextures(),this.textureTypeArray=new Int32Array(this.x3d_MaxTextures)},hasUserDefinedFields:function(){return!0},bindAttributeLocations:function(e,t){e.bindAttribLocation(t,3,"x3d_Color"),e.bindAttribLocation(t,2,"x3d_TexCoord"),e.bindAttribLocation(t,1,"x3d_Normal"),e.bindAttribLocation(t,0,"x3d_Vertex")},getDefaultUniforms:function(){var e=this.getBrowser().getContext(),t=this.getProgram();this.x3d_GeometryType=e.getUniformLocation(t,"x3d_GeometryType");for(n=0;n<this.x3d_MaxClipPlanes;++n)this.x3d_ClipPlane[n]=e.getUniformLocation(t,"x3d_ClipPlane["+n+"]");this.x3d_FogType=e.getUniformLocation(t,"x3d_FogType"),this.x3d_FogColor=e.getUniformLocation(t,"x3d_FogColor"),this.x3d_FogVisibilityRange=e.getUniformLocation(t,"x3d_FogVisibilityRange"),this.x3d_LinewidthScaleFactor=e.getUniformLocation(t,"x3d_LinewidthScaleFactor"),this.x3d_Lighting=e.getUniformLocation(t,"x3d_Lighting"),this.x3d_ColorMaterial=e.getUniformLocation(t,"x3d_ColorMaterial");for(var n=0;n<this.x3d_MaxLights;++n)this.x3d_LightType[n]=e.getUniformLocation(t,"x3d_LightType["+n+"]"),this.x3d_LightColor[n]=e.getUniformLocation(t,"x3d_LightColor["+n+"]"),this.x3d_LightAmbientIntensity[n]=e.getUniformLocation(t,"x3d_LightAmbientIntensity["+n+"]"),this.x3d_LightIntensity[n]=e.getUniformLocation(t,"x3d_LightIntensity["+n+"]"),this.x3d_LightAttenuation[n]=e.getUniformLocation(t,"x3d_LightAttenuation["+n+"]"),this.x3d_LightLocation[n]=e.getUniformLocation(t,"x3d_LightLocation["+n+"]"),this.x3d_LightDirection[n]=e.getUniformLocation(t,"x3d_LightDirection["+n+"]"),this.x3d_LightBeamWidth[n]=e.getUniformLocation(t,"x3d_LightBeamWidth["+n+"]"),this.x3d_LightCutOffAngle[n]=e.getUniformLocation(t,"x3d_LightCutOffAngle["+n+"]"),this.x3d_LightRadius[n]=e.getUniformLocation(t,"x3d_LightRadius["+n+"]"),this.x3d_ShadowIntensity[n]=e.getUniformLocation(t,"x3d_ShadowIntensity["+n+"]"),this.x3d_ShadowDiffusion[n]=e.getUniformLocation(t,"x3d_ShadowDiffusion["+n+"]"),this.x3d_ShadowColor[n]=e.getUniformLocation(t,"x3d_ShadowColor["+n+"]"),this.x3d_ShadowMatrix[n]=e.getUniformLocation(t,"x3d_ShadowMatrix["+n+"]"),this.x3d_ShadowMap[n]=e.getUniformLocation(t,"x3d_ShadowMap["+n+"]");return this.x3d_SeparateBackColor=e.getUniformLocation(t,"x3d_SeparateBackColor"),this.x3d_AmbientIntensity=e.getUniformLocation(t,"x3d_AmbientIntensity"),this.x3d_DiffuseColor=e.getUniformLocation(t,"x3d_DiffuseColor"),this.x3d_SpecularColor=e.getUniformLocation(t,"x3d_SpecularColor"),this.x3d_EmissiveColor=e.getUniformLocation(t,"x3d_EmissiveColor"),this.x3d_Shininess=e.getUniformLocation(t,"x3d_Shininess"),this.x3d_Transparency=e.getUniformLocation(t,"x3d_Transparency"),this.x3d_BackAmbientIntensity=e.getUniformLocation(t,"x3d_BackAmbientIntensity"),this.x3d_BackDiffuseColor=e.getUniformLocation(t,"x3d_BackDiffuseColor"),this.x3d_BackSpecularColor=e.getUniformLocation(t,"x3d_BackSpecularColor"),this.x3d_BackEmissiveColor=e.getUniformLocation(t,"x3d_BackEmissiveColor"),this.x3d_BackShininess=e.getUniformLocation(t,"x3d_BackShininess"),this.x3d_BackTransparency=e.getUniformLocation(t,"x3d_BackTransparency"),this.x3d_TextureType=e.getUniformLocation(t,"x3d_TextureType"),this.x3d_Texture2D=e.getUniformLocation(t,"x3d_Texture2D"),this.x3d_CubeMapTexture=e.getUniformLocation(t,"x3d_CubeMapTexture"),this.x3d_Texture=e.getUniformLocation(t,"x3d_Texture"),this.x3d_Viewport=e.getUniformLocation(t,"x3d_Viewport"),this.x3d_ProjectionMatrix=e.getUniformLocation(t,"x3d_ProjectionMatrix"),this.x3d_ModelViewMatrix=e.getUniformLocation(t,"x3d_ModelViewMatrix"),this.x3d_NormalMatrix=e.getUniformLocation(t,"x3d_NormalMatrix"),this.x3d_TextureMatrix=e.getUniformLocation(t,"x3d_TextureMatrix"),this.x3d_Color=e.getAttribLocation(t,"x3d_Color"),this.x3d_TexCoord=e.getAttribLocation(t,"x3d_TexCoord"),this.x3d_Normal=e.getAttribLocation(t,"x3d_Normal"),this.x3d_Vertex=e.getAttribLocation(t,"x3d_Vertex"),e.uniform1f(this.x3d_LinewidthScaleFactor,1),e.uniform1iv(this.x3d_TextureType,new Int32Array([0])),e.uniform1iv(this.x3d_Texture,new Int32Array([2])),e.uniform1iv(this.x3d_Texture2D,new Int32Array([2])),e.uniform1iv(this.x3d_CubeMapTexture,new Int32Array([4])),this.x3d_Color<0?(this.enableColorAttribute=Function.prototype,this.disableColorAttribute=Function.prototype):(delete this.enableColorAttribute,delete this.disableColorAttribute),this.x3d_TexCoord<0?(this.enableTexCoordAttribute=Function.prototype,this.disableTexCoordAttribute=Function.prototype):(delete this.enableTexCoordAttribute,delete this.disableTexCoordAttribute),this.x3d_Normal<0?(this.enableNormalAttribute=Function.prototype,this.disableNormalAttribute=Function.prototype):(delete this.enableNormalAttribute,delete this.disableNormalAttribute),!(this.x3d_Vertex<0)},addShaderFields:function(){var e=this.getBrowser().getContext(),t=this.getProgram(),n=this.getUserDefinedFields();for(var r in n){var o=n[r],s=e.getUniformLocation(t,r);if(s){switch(o._uniformLocation=s,o.addInterest("set_field__",this),o.getType()){case i.SFImage:s.array=new Int32Array(3+o.array.length);break;case i.SFMatrix3d:case i.SFMatrix3f:case i.SFRotation:s.array=new Float32Array(9);break;case i.SFMatrix4d:case i.SFMatrix4f:s.array=new Float32Array(16);break;case i.MFBool:case i.MFInt32:s.array=new Int32Array(this.getLocationLength(e,t,o));break;case i.MFFloat:case i.MFDouble:case i.MFTime:s.array=new Float32Array(this.getLocationLength(e,t,o));break;case i.MFImage:s.array=new Int32Array(this.getImagesLength(o));break;case i.MFMatrix3d:case i.MFMatrix3f:case i.MFRotation:s.array=new Float32Array(9*this.getLocationLength(e,t,o));break;case i.MFMatrix4d:case i.MFMatrix4f:s.array=new Float32Array(16*this.getLocationLength(e,t,o));break;case i.MFNode:for(var a=o._uniformLocation=[],u=0;s=e.getUniformLocation(t,r+"["+u+"]");++u)a[u]=s;break;case i.MFVec2d:case i.MFVec2f:s.array=new Float32Array(2*this.getLocationLength(e,t,o));break;case i.MFVec3d:case i.MFVec3f:case i.MFColor:s.array=new Float32Array(3*this.getLocationLength(e,t,o));break;case i.MFVec4d:case i.MFVec4f:case i.MFColorRGBA:s.array=new Float32Array(4*this.getLocationLength(e,t,o))}this.set_field__(o)}}},removeShaderFields:function(){var e=this.getBrowser().getContext(),t=this.getProgram(),n=this.getUserDefinedFields();for(var r in n){var o=n[r];switch(o.removeInterest("set_field__",this),o.getType()){case i.SFNode:this.removeNode(e,t,o._uniformLocation);break;case i.MFNode:for(var r=o.getName(),s=0;;++s){var a=e.getUniformLocation(t,r+"["+s+"]");if(!a)break;this.removeNode(e,t,a)}break;default:continue}break}},set_field__:function(e){var t=this.getBrowser().getContext(),n=this.getProgram(),r=e._uniformLocation;if(r)switch(this.useProgram(t),e.getType()){case i.SFBool:case i.SFInt32:return void t.uniform1i(r,e.getValue());case i.SFColor:c=e.getValue();return void t.uniform3f(r,c.r,c.g,c.b);case i.SFColorRGBA:c=e.getValue();return void t.uniform4f(r,c.r,c.g,c.b,c.a);case i.SFDouble:case i.SFFloat:case i.SFTime:return void t.uniform1f(r,e.getValue());case i.SFImage:h=r.array;(l=3+(m=e.array.getValue()).length)!==h.length&&(h=r.array=new Int32Array(l)),h[0]=e.width,h[1]=e.height,h[2]=e.comp;for(var o=3,u=0,l=m.length;u<l;++u)h[o++]=m[u].getValue();return void t.uniform1iv(r,h);case i.SFMatrix3d:case i.SFMatrix3f:return r.array.set(e.getValue()),void t.uniformMatrix3fv(r,!1,r.array);case i.SFMatrix4d:case i.SFMatrix4f:return r.array.set(e.getValue()),void t.uniformMatrix4fv(r,!1,r.array);case i.SFNode:return void this.setNode(t,n,r,e);case i.SFRotation:return e.getValue().getMatrix(r.array),void t.uniformMatrix3fv(r,!1,r.array);case i.SFString:return;case i.SFVec2d:case i.SFVec2f:c=e.getValue();return void t.uniform2f(r,c.x,c.y);case i.SFVec3d:case i.SFVec3f:c=e.getValue();return void t.uniform3f(r,c.x,c.y,c.z);case i.SFVec4d:case i.SFVec4f:c=e.getValue();return void t.uniform4f(r,c.x,c.y,c.z,c.w);case i.MFBool:case i.MFInt32:for(var c=e.getValue(),h=r.array,d=0,l=c.length;d<l;++d)h[d]=c[d].getValue();for(l=h.length;d<l;++d)h[d]=0;return void t.uniform1iv(r,h);case i.MFColor:for(var c=e.getValue(),h=r.array,d=0,p=0,l=c.length;d<l;++d){f=c[d].getValue();h[p++]=f.r,h[p++]=f.g,h[p++]=f.b}for(l=h.length;p<l;++p)h[p]=0;return void t.uniform3fv(r,h);case i.MFColorRGBA:for(var c=e.getValue(),h=r.array,d=0,p=0,l=c.length;d<l;++d){var f=c[d].getValue();h[p++]=f.r,h[p++]=f.g,h[p++]=f.b,h[p++]=f.a}for(l=h.length;p<l;++p)h[p]=0;return void t.uniform4fv(r,h);case i.MFDouble:case i.MFFloat:case i.MFTime:for(var c=e.getValue(),h=r.array,d=0,l=c.length;d<l;++d)h[d]=c[d].getValue();for(l=h.length;d<l;++d)h[d]=0;return void t.uniform1fv(r,h);case i.MFImage:var g=e.getValue(),h=r.array;(l=this.getImagesLength(e))!==h.length&&(h=r.array=new Int32Array(l));for(var d=0,o=0,l=g.length;d<l;++d){var m=(c=g[d]).array.getValue();h[o++]=c.width,h[o++]=c.height,h[o++]=c.comp;for(var u=0,b=m.length;u<b;++u)h[o++]=m[u].getValue()}return void t.uniform1iv(r,h);case i.MFMatrix3d:case i.MFMatrix3f:for(var c=e.getValue(),h=r.array,d=0,p=0,l=c.length;d<l;++d){w=c[d].getValue();h[p++]=w[0],h[p++]=w[1],h[p++]=w[2],h[p++]=w[3],h[p++]=w[4],h[p++]=w[5],h[p++]=w[6],h[p++]=w[7],h[p++]=w[8]}for(l=h.length;p<l;++p)h[p]=0;return void t.uniformMatrix3fv(r,!1,h);case i.MFMatrix4d:case i.MFMatrix4f:for(var c=e.getValue(),h=r.array,d=0,p=0,l=c.length;d<l;++d){w=c[d].getValue();h[p++]=w[0],h[p++]=w[1],h[p++]=w[2],h[p++]=w[3],h[p++]=w[4],h[p++]=w[5],h[p++]=w[6],h[p++]=w[7],h[p++]=w[8],h[p++]=w[9],h[p++]=w[10],h[p++]=w[11],h[p++]=w[12],h[p++]=w[13],h[p++]=w[14],h[p++]=w[15]}for(l=h.length;p<l;++p)h[p]=0;return void t.uniformMatrix4fv(r,!1,h);case i.MFNode:for(var d=0,l=(c=e.getValue()).length;d<l;++d)this.setNode(t,n,r[d],c[d]);for(l=r.length;d<l;++d)this.setNode(t,n,r[d],a);return;case i.MFRotation:for(var c=e.getValue(),h=r.array,d=0,p=0,l=c.length;d<l;++d){var w=c[d].getValue().getMatrix(s);h[p++]=w[0],h[p++]=w[1],h[p++]=w[2],h[p++]=w[3],h[p++]=w[4],h[p++]=w[5],h[p++]=w[6],h[p++]=w[7],h[p++]=w[8]}for(l=h.length;p<l;++p)h[p]=0;return void t.uniformMatrix3fv(r,!1,h);case i.MFString:return;case i.MFVec2d:case i.MFVec2f:for(var c=e.getValue(),h=r.array,d=0,p=0,l=c.length;d<l;++d){y=c[d].getValue();h[p++]=y.x,h[p++]=y.y}for(l=h.length;p<l;++p)h[p]=0;return void t.uniform2fv(r,h);case i.MFVec3d:case i.MFVec3f:for(var c=e.getValue(),h=r.array,d=0,p=0,l=c.length;d<l;++d){y=c[d].getValue();h[p++]=y.x,h[p++]=y.y,h[p++]=y.z}for(l=h.length;p<l;++p)h[p]=0;return void t.uniform3fv(r,h);case i.MFVec4d:case i.MFVec4f:for(var c=e.getValue(),h=r.array,d=0,p=0,l=c.length;d<l;++d){var y=c[d].getValue();h[p++]=y.x,h[p++]=y.y,h[p++]=y.z,h[p++]=y.w}for(l=h.length;p<l;++p)h[p]=0;return void t.uniform4fv(r,h)}},setNode:function(e,t,r,o){if(r){var s=e.getUniform(t,r);if(!s){if(!this.getBrowser().getCombinedTextureUnits().length)return void console.warn("Not enough combined texture units for uniform variable '",o.getName(),"' available.");s=this.getBrowser().getCombinedTextureUnits().pop(),e.uniform1i(r,s)}e.activeTexture(e.TEXTURE0+s);var a=n(i.X3DTextureNode,o);a&&e.bindTexture(a.getTarget(),a.getTexture()),e.activeTexture(e.TEXTURE0)}},removeNode:function(e,t,n){if(n){var i=e.getUniform(t,n);i&&this.getBrowser().getCombinedTextureUnits().push(i),e.uniform1i(n,0)}},getImagesLength:function(e){for(var t=e.getValue(),n=3*t.length,i=0,r=t.length;i<r;++i)n+=t[i].array.length;return n},getLocationLength:function(e,t,n){for(var i=n.getName(),r=0;e.getUniformLocation(t,i+"["+r+"]");++r);return r},setClipPlanes:function(e,t){if(t.length){for(var n=0,i=Math.min(this.x3d_MaxClipPlanes,t.length);n<i;++n)t[n].setShaderUniforms(e,this,n);n<this.x3d_MaxClipPlanes&&e.uniform4fv(this.x3d_ClipPlane[n],this.x3d_NoneClipPlane)}else e.uniform4fv(this.x3d_ClipPlane[0],this.x3d_NoneClipPlane)},setGlobalUniforms:function(e,t,n,i){var r=e.getGlobalLights();t.uniform4iv(this.x3d_Viewport,i),t.uniformMatrix4fv(this.x3d_ProjectionMatrix,!1,n),this.numGlobalLights=Math.min(this.x3d_MaxLights,r.length);for(var o=0,s=this.numGlobalLights;o<s;++o)r[o].setShaderUniforms(t,this,o)},setLocalUniforms:function(e,t){var n=t.linePropertiesNode,i=t.materialNode,o=t.textureNode,s=t.textureTransformNode,a=t.modelViewMatrix,u=t.clipPlanes;if(e.uniform1i(this.x3d_GeometryType,t.geometryType),u.length){for(var l=0,c=Math.min(this.x3d_MaxClipPlanes,u.length);l<c;++l)u[l].setShaderUniforms(e,this,l);l<this.x3d_MaxClipPlanes&&e.uniform4fv(this.x3d_ClipPlane[l],this.x3d_NoneClipPlane)}else e.uniform4fv(this.x3d_ClipPlane[0],this.x3d_NoneClipPlane);if(t.fogNode!==this.fogNode&&(this.fogNode=t.fogNode,t.fogNode.setShaderUniforms(e,this,t.renderer)),n&&n.applied_.getValue()){var h=n.getLinewidthScaleFactor();e.lineWidth(h),e.uniform1f(this.x3d_LinewidthScaleFactor,h)}else e.lineWidth(1),e.uniform1f(this.x3d_LinewidthScaleFactor,1);if(e.uniform1i(this.x3d_ColorMaterial,t.colorMaterial),i){e.uniform1i(this.x3d_Lighting,!0);for(var d=t.localLights,p=Math.min(this.x3d_MaxLights,this.numGlobalLights+d.length),l=this.numGlobalLights,f=0;l<p;++l,++f)d[f].setShaderUniforms(e,this,l);p<this.x3d_MaxLights&&e.uniform1i(this.x3d_LightType[p],0),i.setShaderUniforms(e,this);try{(g=this.normalMatrixArray)[0]=a[0],g[1]=a[4],g[2]=a[8],g[3]=a[1],g[4]=a[5],g[5]=a[9],g[6]=a[2],g[7]=a[6],g[8]=a[10],r.prototype.inverse.call(g),e.uniformMatrix3fv(this.x3d_NormalMatrix,!1,g)}catch(t){e.uniformMatrix3fv(this.x3d_NormalMatrix,!1,new Float32Array(r.Identity))}}else if(e.uniform1i(this.x3d_Lighting,!1),this.getCustom())try{var g=this.normalMatrixArray;g[0]=a[0],g[1]=a[4],g[2]=a[8],g[3]=a[1],g[4]=a[5],g[5]=a[9],g[6]=a[2],g[7]=a[6],g[8]=a[10],r.prototype.inverse.call(g),e.uniformMatrix3fv(this.x3d_NormalMatrix,!1,g)}catch(t){e.uniformMatrix3fv(this.x3d_NormalMatrix,!1,new Float32Array(r.Identity))}o?(o.setShaderUniforms(e,this,0),s.setShaderUniforms(e,this)):(this.textureTypeArray[0]=0,e.uniform1iv(this.x3d_TextureType,this.textureTypeArray),this.getCustom()&&s.setShaderUniforms(e,this)),e.uniformMatrix4fv(this.x3d_ModelViewMatrix,!1,a)},enableFloatAttrib:function(e,t,n,i){var r=e.getAttribLocation(this.getProgram(),t);-1!==r&&(e.enableVertexAttribArray(r),e.bindBuffer(e.ARRAY_BUFFER,n),e.vertexAttribPointer(r,i,e.FLOAT,!1,0,0))},disableFloatAttrib:function(e,t){var n=e.getAttribLocation(this.getProgram(),t);-1!==n&&e.disableVertexAttribArray(n)},enableMatrix3Attrib:function(e,t,n){var i=e.getAttribLocation(this.getProgram(),t);-1!==i&&(e.enableVertexAttribArray(i+0),e.enableVertexAttribArray(i+1),e.enableVertexAttribArray(i+2),e.bindBuffer(e.ARRAY_BUFFER,n),e.vertexAttribPointer(i+0,3,e.FLOAT,!1,36,0),e.vertexAttribPointer(i+1,3,e.FLOAT,!1,36,12),e.vertexAttribPointer(i+2,3,e.FLOAT,!1,36,24))},disableMatrix3Attrib:function(e,t){var n=e.getAttribLocation(this.getProgram(),t);-1!==n&&(e.disableVertexAttribArray(n+0),e.disableVertexAttribArray(n+1),e.disableVertexAttribArray(n+2))},enableMatrix4Attrib:function(e,t,n){var i=e.getAttribLocation(this.getProgram(),t);-1!==i&&(e.enableVertexAttribArray(i+0),e.enableVertexAttribArray(i+1),e.enableVertexAttribArray(i+2),e.enableVertexAttribArray(i+3),e.bindBuffer(e.ARRAY_BUFFER,n),e.vertexAttribPointer(i+0,4,e.FLOAT,!1,64,0),e.vertexAttribPointer(i+1,4,e.FLOAT,!1,64,16),e.vertexAttribPointer(i+2,4,e.FLOAT,!1,64,32),e.vertexAttribPointer(i+3,4,e.FLOAT,!1,64,48))},disableMatrix4Attrib:function(e,t){var n=e.getAttribLocation(this.getProgram(),t);-1!==n&&(e.disableVertexAttribArray(n+0),e.disableVertexAttribArray(n+1),e.disableVertexAttribArray(n+2),e.disableVertexAttribArray(n+3))},enableColorAttribute:function(e,t){e.enableVertexAttribArray(this.x3d_Color),e.bindBuffer(e.ARRAY_BUFFER,t),e.vertexAttribPointer(this.x3d_Color,4,e.FLOAT,!1,0,0)},disableColorAttribute:function(e){e.disableVertexAttribArray(this.x3d_Color)},enableTexCoordAttribute:function(e,t){e.enableVertexAttribArray(this.x3d_TexCoord),e.bindBuffer(e.ARRAY_BUFFER,t[0]),e.vertexAttribPointer(this.x3d_TexCoord,4,e.FLOAT,!1,0,0)},disableTexCoordAttribute:function(e){e.disableVertexAttribArray(this.x3d_TexCoord)},enableNormalAttribute:function(e,t){e.enableVertexAttribArray(this.x3d_Normal),e.bindBuffer(e.ARRAY_BUFFER,t),e.vertexAttribPointer(this.x3d_Normal,3,e.FLOAT,!1,0,0)},disableNormalAttribute:function(e){e.disableVertexAttribArray(this.x3d_Normal)},enableVertexAttribute:function(e,t){e.enableVertexAttribArray(this.x3d_Vertex),e.bindBuffer(e.ARRAY_BUFFER,t),e.vertexAttribPointer(this.x3d_Vertex,4,e.FLOAT,!1,0,0)},disableVertexAttribute:function(e){e.disableVertexAttribArray(this.x3d_Vertex)},getProgramInfo:function(){for(var t=this.getBrowser().getContext(),n=this.getProgram(),i={attributes:[],uniforms:[],attributeCount:0,uniformCount:0},r=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),o=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES),s={35664:"vec2",35665:"vec3",35666:"vec4",35667:"ivec2",35668:"ivec3",35669:"ivec4",35670:"bool",35671:"bvec2",35672:"bvec3",35673:"bvec4",35674:"mat2",35675:"mat3",35676:"mat4",35678:"sampler2D",35680:"samplerCube",5120:"byte",5121:"ubyte",5122:"short",5123:"ushort",5124:"int",5125:"uint",5126:"float"},a=0;a<r;++a){var u=t.getActiveUniform(n,a);u.typeName=s[u.type],i.uniforms.push(e.extend({},u)),i.uniformCount+=u.size}for(a=0;a<o;++a){var l=t.getActiveAttrib(n,a);l.typeName=s[l.type],i.attributes.push(e.extend({},l)),i.attributeCount+=l.size}return i.uniforms.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),i.attributes.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),i},printProgramInfo:function(){var e=this.getProgramInfo();console.log(this.getName()),console.table(e.attributes),console.log(this.getName(),"attributeCount",e.attributeCount),console.log(this.getName()),console.table(e.uniforms),console.log(this.getName(),"uniformCount",e.uniformCount)}},o}),define("cobweb/Components/Shaders/ComposedShader",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shaders/X3DShaderNode","cobweb/Components/Shaders/X3DProgrammableShaderObject","cobweb/Components/Networking/LoadSensor","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),o.call(this,e),this.addType(u.ComposedShader),this.loadSensor=new s(e)}var c=null;return l.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:l,fieldDefinitions:new i([new n(u.inputOutput,"metadata",new t.SFNode),new n(u.inputOnly,"activate",new t.SFBool),new n(u.outputOnly,"isSelected",new t.SFBool),new n(u.outputOnly,"isValid",new t.SFBool),new n(u.initializeOnly,"language",new t.SFString),new n(u.inputOutput,"parts",new t.MFNode)]),wireframe:!1,getTypeName:function(){return"ComposedShader"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"shaders"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this);var e=this.getBrowser().getContext();this.primitiveMode=e.TRIANGLES,this.isLive().addInterest("set_live__",this),this.activate_.addInterest("set_activate__",this),this.parts_.addFieldInterest(this.loadSensor.watchList_),this.loadSensor.isLoaded_.addInterest("set_loaded__",this),this.loadSensor.watchList_=this.parts_,this.loadSensor.setPrivate(!0),this.loadSensor.setup()},getProgram:function(){return this.program},set_live__:function(){this.isLive().getValue()?this.isValid_.getValue()&&(this.useProgram(this.getBrowser().getContext()),this.addShaderFields()):this.isValid_.getValue()&&(this.useProgram(this.getBrowser().getContext()),this.removeShaderFields())},set_activate__:function(){this.activate_.getValue()&&this.set_loaded__()},set_loaded__:function(){if(this.loadSensor.isLoaded_.getValue()){var e=this.getBrowser().getContext(),t=e.createProgram(),n=this.parts_.getValue(),i=0;this.isValid_.getValue()&&this.removeShaderFields(),this.program=t;for(var r=0,o=n.length;r<o;++r){var s=a(u.ShaderPart,n[r]);s&&(i+=s.isValid(),e.attachShader(t,s.getShader()))}i&&(this.bindAttributeLocations(e,t),e.linkProgram(t),i=i&&e.getProgramParameter(t,e.LINK_STATUS)),i?(this.useProgram(e),this.getDefaultUniforms()?this.addShaderFields():i=!1):console.warn("Couldn't initialize "+this.getTypeName()+" '"+this.getName()+"': "+e.getProgramInfoLog(t)),i!=this.isValid_.getValue()&&(this.isValid_=i)}else this.isValid_.getValue()&&(this.isValid_=!1)},setGlobalUniforms:function(e,t,n,i){c!==this&&(c=this,t.useProgram(this.program)),o.prototype.setGlobalUniforms.call(this,e,t,n,i)},setLocalUniforms:function(e,t){c!==this&&(c=this,e.useProgram(this.program)),o.prototype.setLocalUniforms.call(this,e,t)},useProgram:function(e){c!==this&&(c=this,e.useProgram(this.program))}}),l}),define("text!cobweb/Browser/Shaders/Bits/Line3.h",[],function(){return"/* -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-*/\n\n/* Line */\n\nstruct Line3 {\n\tvec3 point;\n\tvec3 direction;\n};\n\nLine3\nline3 (in vec3 point1, in vec3 point2)\n{\n\treturn Line3 (point1, normalize (point2 - point1));\n}\n"}),define("text!cobweb/Browser/Shaders/Bits/Plane3.h",[],function(){return'/* -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-*/\n\n#pragma X3D include "Line3.h"\n\n/* Plane */\n\nstruct Plane3\n{\n\tvec3  normal;\n\tfloat distanceFromOrigin;\n};\n\nPlane3\nplane3 (in vec3 point, in vec3 normal)\n{\n\treturn Plane3 (normal, dot (normal, point));\n}\n\n/* Plane intersect line */\nbool\nintersects (in Plane3 plane, in Line3 line, out vec3 point)\n{\n\tpoint = vec3 (0.0);\n\n\t// Check if the line is parallel to the plane.\n\tfloat theta = dot (line .direction, plane .normal);\n\n\t// Plane and line are parallel.\n\tif (theta == 0.0)\n\t\treturn false;\n\n\t// Plane and line are not parallel. The intersection point can be calculated now.\n\tfloat t = (plane .distanceFromOrigin - dot (plane .normal, line .point)) / theta;\n\n\tpoint = line .point + line .direction * t;\n\n\treturn true;\n}\n\n///  Returns the closest point on the plane to a given point @a point.\nvec3\nclosest_point (in Plane3 plane, in vec3 point)\n{\n\tvec3 closest_point;\n\tintersects (plane, Line3 (point, plane .normal), closest_point);\n\treturn closest_point;\n}\n'}),define("text!cobweb/Browser/Shaders/Bits/Random.h",[],function(){return"/* -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-*/\n\nconst int RAND_MAX = int (0x7fffffff);\nconst int RAND_MIN = int (0x80000000);\n\nint seedValue = 0;\n\nvoid\nseed (in int value)\n{\n\tseedValue = value;\n}\n\n// Return a uniform distributed random floating point number in the interval [-1, 1].\nfloat\nrandom1 ()\n{\n\treturn float (seedValue = seedValue * 1103515245 + 12345) / float (RAND_MAX);\n}\n\nvec2\nrandom2 ()\n{\n\treturn vec2 (random1 (), random1 ());\n}\n\nvec3\nrandom3 ()\n{\n\treturn vec3 (random1 (), random1 (), random1 ());\n}\n"}),define("cobweb/Browser/Shaders/Shader",["text!cobweb/Browser/Shaders/Bits/Line3.h","text!cobweb/Browser/Shaders/Bits/Plane3.h","text!cobweb/Browser/Shaders/Bits/Random.h"],function(e,t,n){var i={Line3:e,Plane3:t,Random:n},r=/#pragma\s+X3D\s+include\s+".*?([^\/]+).h"/;return{getShaderSource:function(e,t){for(var n=null;n=t.match(r);)t=t.replace(n[0],i[n[1]]);var o="";return o+="#define x3d_GeometryPoints  0\n",o+="#define x3d_GeometryLines   1\n",o+="#define x3d_Geometry2D      2\n",o+="#define x3d_Geometry3D      3\n",o+="#define x3d_MaxClipPlanes  "+e.getMaxClipPlanes()+"\n",o+="#define x3d_NoneClipPlane  vec4 (88.0, 51.0, 68.0, 33.0)\n",o+="#define x3d_NoneFog          0\n",o+="#define x3d_LinearFog        1\n",o+="#define x3d_ExponentialFog   2\n",o+="#define x3d_Exponential2Fog  3\n",o+="#define x3d_MaxLights         "+e.getMaxLights()+"\n",o+="#define x3d_NoneLight         0\n",o+="#define x3d_DirectionalLight  1\n",o+="#define x3d_PointLight        2\n",o+="#define x3d_SpotLight         3\n",o+="#define x3d_MaxTextures                "+e.getMaxTextures()+"\n",o+="#define x3d_NoneTexture                0\n",o+="#define x3d_TextureType2D              2\n",o+="#define x3d_TextureType3D              3\n",o+="#define x3d_TextureTypeCubeMapTexture  4\n",o+="#define X3D_SHADOWS\n",o+="#define x3d_MaxShadows     4\n",o+="#define x3d_ShadowSamples  8\n",(o+="#line 1\n")+t}}}),define("cobweb/Parser/HTMLSupport",[],function(){var e={attributeLowerCaseToCamelCase:{accesstype:"accessType",actionkeypress:"actionKeyPress",actionkeyrelease:"actionKeyRelease",activate:"activate",activelayer:"activeLayer",additionalinterface:"additionalInterface",address:"address",align:"align",alpha:"alpha",altkey:"altKey",ambientintensity:"ambientIntensity",anchorpoint:"anchorPoint",angle:"angle",anglerate:"angleRate",angulardampingfactor:"angularDampingFactor",angularvelocity:"angularVelocity",anisotropicdegree:"anisotropicDegree",antennalocation:"antennaLocation",antennapatternlength:"antennaPatternLength",antennapatterntype:"antennaPatternType",appinfo:"appinfo",applicationid:"applicationID",applied:"applied",appliedparameters:"appliedParameters",articulationparameterarray:"articulationParameterArray",articulationparameterchangeindicatorarray:"articulationParameterChangeIndicatorArray",articulationparametercount:"articulationParameterCount",articulationparameterdesignatorarray:"articulationParameterDesignatorArray",articulationparameteridpartattachedtoarray:"articulationParameterIdPartAttachedToArray",articulationparametertypearray:"articulationParameterTypeArray",articulationparametervalue0_changed:"articulationParameterValue0_changed",articulationparametervalue1_changed:"articulationParameterValue1_changed",articulationparametervalue2_changed:"articulationParameterValue2_changed",articulationparametervalue3_changed:"articulationParameterValue3_changed",articulationparametervalue4_changed:"articulationParameterValue4_changed",articulationparametervalue5_changed:"articulationParameterValue5_changed",articulationparametervalue6_changed:"articulationParameterValue6_changed",articulationparametervalue7_changed:"articulationParameterValue7_changed",as:"AS",attenuation:"attenuation",autocalc:"autoCalc",autodamp:"autoDamp",autodisable:"autoDisable",autooffset:"autoOffset",avatarsize:"avatarSize",axis:"axis",axis1:"axis1",axis1angle:"axis1Angle",axis1torque:"axis1Torque",axis2:"axis2",axis2angle:"axis2Angle",axis2torque:"axis2Torque",axis3angle:"axis3Angle",axis3torque:"axis3Torque",axisofrotation:"axisOfRotation",axisrotation:"axisRotation",backambientintensity:"backAmbientIntensity",backdiffusecolor:"backDiffuseColor",backemissivecolor:"backEmissiveColor",backshininess:"backShininess",backspecularcolor:"backSpecularColor",backtransparency:"backTransparency",backurl:"backUrl",bboxcenter:"bboxCenter",bboxsize:"bboxSize",beamwidth:"beamWidth",begincap:"beginCap",bindtime:"bindTime",body1anchorpoint:"body1AnchorPoint",body1axis:"body1Axis",body2anchorpoint:"body2AnchorPoint",body2axis:"body2Axis",bordercolor:"borderColor",borderwidth:"borderWidth",bottom:"bottom",bottomradius:"bottomRadius",bottomurl:"bottomUrl",bounce:"bounce",boundarymoder:"boundaryModeR",boundarymodes:"boundaryModeS",boundarymodet:"boundaryModeT",boundaryopacity:"boundaryOpacity",category:"category",ccw:"ccw",center:"center",centerofmass:"centerOfMass",centerofrotation:"centerOfRotation",centerofrotation_changed:"centerOfRotation_changed",child1url:"child1Url",child2url:"child2Url",child3url:"child3Url",child4url:"child4Url",class:"class",clipboundary:"clipBoundary",closed:"closed",closuretype:"closureType",collidetime:"collideTime",collisiontype:"collisionType",color:"color",colorindex:"colorIndex",colorkey:"colorKey",colorpervertex:"colorPerVertex",colorsteps:"colorSteps",constantforcemix:"constantForceMix",contactnormal:"contactNormal",contactsurfacethickness:"contactSurfaceThickness",containerfield:"containerField",content:"content",contourstepsize:"contourStepSize",controlkey:"controlKey",controlpoint:"controlPoint",conversionfactor:"conversionFactor",convex:"convex",coolcolor:"coolColor",coordindex:"coordIndex",country:"country",creaseangle:"creaseAngle",createparticles:"createParticles",crosssection:"crossSection",cryptokeyid:"cryptoKeyID",cryptosystem:"cryptoSystem",cutoffangle:"cutOffAngle",cycleinterval:"cycleInterval",cycletime:"cycleTime",data:"data",datalength:"dataLength",deadreckoning:"deadReckoning",def:"DEF",deletionallowed:"deletionAllowed",depth:"depth",description:"description",desiredangularvelocity1:"desiredAngularVelocity1",desiredangularvelocity2:"desiredAngularVelocity2",detonatetime:"detonateTime",detonationlocation:"detonationLocation",detonationrelativelocation:"detonationRelativeLocation",detonationresult:"detonationResult",diffusecolor:"diffuseColor",dimensions:"dimensions",dir:"dir",direction:"direction",directoutput:"directOutput",disableangularspeed:"disableAngularSpeed",disablelinearspeed:"disableLinearSpeed",disabletime:"disableTime",diskangle:"diskAngle",displacements:"displacements",displayed:"displayed",documentation:"documentation",domain:"domain",duration:"duration",duration_changed:"duration_changed",easeineaseout:"easeInEaseOut",edgecolor:"edgeColor",elapsedtime:"elapsedTime",emissivecolor:"emissiveColor",enabled:"enabled",enabledaxes:"enabledAxes",encodingscheme:"encodingScheme",endangle:"endAngle",endcap:"endCap",enteredtext:"enteredText",entertime:"enterTime",entitycategory:"entityCategory",entitycountry:"entityCountry",entitydomain:"entityDomain",entityextra:"entityExtra",entityid:"entityID",entitykind:"entityKind",entityspecific:"entitySpecific",entitysubcategory:"entitySubcategory",errorcorrection:"errorCorrection",eventapplicationid:"eventApplicationID",evententityid:"eventEntityID",eventnumber:"eventNumber",eventsiteid:"eventSiteID",exittime:"exitTime",extra:"extra",family:"family",fancount:"fanCount",fieldofview:"fieldOfView",filled:"filled",finaltext:"finalText",finiterotationaxis:"finiteRotationAxis",fired1:"fired1",fired2:"fired2",firedtime:"firedTime",firemissionindex:"fireMissionIndex",firingrange:"firingRange",firingrate:"firingRate",fixed:"fixed",fogtype:"fogType",force:"force",forceid:"forceID",forceoutput:"forceOutput",forces:"forces",forcetransitions:"forceTransitions",fraction_changed:"fraction_changed",frequency:"frequency",frictioncoefficients:"frictionCoefficients",frictiondirection:"frictionDirection",fromfield:"fromField",fromnode:"fromNode",fronturl:"frontUrl",function:"function",fuse:"fuse",generatemipmaps:"generateMipMaps",geocenter:"geoCenter",geocoord_changed:"geoCoord_changed",geocoords:"geoCoords",geogridorigin:"geoGridOrigin",geometrytype:"geometryType",geosystem:"geoSystem",geovalue_changed:"geovalue_changed",global:"global",gradientthreshold:"gradientThreshold",gravity:"gravity",groundangle:"groundAngle",groundcolor:"groundColor",gustiness:"gustiness",hatchcolor:"hatchColor",hatched:"hatched",hatchstyle:"hatchStyle",headlight:"headlight",height:"height",hinge1angle:"hinge1Angle",hinge1anglerate:"hinge1AngleRate",hinge2angle:"hinge2Angle",hinge2anglerate:"hinge2AngleRate",hitgeocoord_changed:"hitGeoCoord_changed",hitnormal_changed:"hitNormal_changed",hitpoint_changed:"hitPoint_changed",hittexcoord_changed:"hitTexCoord_changed",horizontal:"horizontal","http-equiv":"http-equiv",image:"image",importeddef:"importedDEF",index:"index",inertia:"inertia",info:"info",initialdestination:"initialDestination",initialvalue:"initialValue",inlinedef:"inlineDEF",innerradius:"innerRadius",inputfalse:"inputFalse",inputnegate:"inputNegate",inputsource:"inputSource",inputtrue:"inputTrue",integerkey:"integerKey",intensity:"intensity",intensitythreshold:"intensityThreshold",internal:"internal",intersectiontype:"intersectionType",isactive:"isActive",isbound:"isBound",iscollided:"isCollided",isdetonated:"isDetonated",isloaded:"isLoaded",isnetworkreader:"isNetworkReader",isnetworkwriter:"isNetworkWriter",isover:"isOver",ispaused:"isPaused",ispickable:"isPickable",isrtpheaderheard:"isRtpHeaderHeard",isselected:"isSelected",isstandalone:"isStandAlone",isvalid:"isValid",iterations:"iterations",jump:"jump",justify:"justify",key:"key",keypress:"keyPress",keyrelease:"keyRelease",keyvalue:"keyValue",keyvelocity:"keyVelocity",kind:"kind",knot:"knot",lang:"lang",language:"language",lefttoright:"leftToRight",lefturl:"leftUrl",length:"length",lengthofmodulationparameters:"lengthOfModulationParameters",level:"level",level_changed:"level_changed",lifetimevariation:"lifetimeVariation",lighting:"lighting",limitorientation:"limitOrientation",linearacceleration:"linearAcceleration",lineardampingfactor:"linearDampingFactor",linearvelocity:"linearVelocity",linebounds:"lineBounds",linesegments:"lineSegments",linetype:"linetype",linewidthscalefactor:"linewidthScaleFactor",llimit:"llimit",load:"load",loadtime:"loadTime",localdef:"localDEF",location:"location",loop:"loop",magnificationfilter:"magnificationFilter",marking:"marking",mass:"mass",matrix:"matrix",maxangle:"maxAngle",maxangle1:"maxAngle1",maxback:"maxBack",maxcorrectionspeed:"maxCorrectionSpeed",maxextent:"maxExtent",maxfront:"maxFront",maxparticles:"maxParticles",maxposition:"maxPosition",maxseparation:"maxSeparation",maxtorque1:"maxTorque1",maxtorque2:"maxTorque2",minangle:"minAngle",minangle1:"minAngle1",minback:"minBack",minbouncespeed:"minBounceSpeed",minfront:"minFront",minificationfilter:"minificationFilter",minposition:"minPosition",minseparation:"minSeparation",mode:"mode",modifiedfraction_changed:"modifiedFraction_changed",modulationtypedetail:"modulationTypeDetail",modulationtypemajor:"modulationTypeMajor",modulationtypespreadspectrum:"modulationTypeSpreadSpectrum",modulationtypesystem:"modulationTypeSystem",momentsofinertia:"momentsOfInertia",motor1angle:"motor1Angle",motor1anglerate:"motor1AngleRate",motor1axis:"motor1Axis",motor2angle:"motor2Angle",motor2anglerate:"motor2AngleRate",motor2axis:"motor2Axis",motor3angle:"motor3Angle",motor3anglerate:"motor3AngleRate",motor3axis:"motor3Axis",multicastrelayhost:"multicastRelayHost",multicastrelayport:"multicastRelayPort",munitionapplicationid:"munitionApplicationID",munitionendpoint:"munitionEndPoint",munitionentityid:"munitionEntityID",munitionquantity:"munitionQuantity",munitionsiteid:"munitionSiteID",munitionstartpoint:"munitionStartPoint",mustevaluate:"mustEvaluate",name:"name",networkmode:"networkMode",next:"next",nodefield:"nodeField",normal_changed:"normal_changed",normalindex:"normalIndex",normalizevelocity:"normalizeVelocity",normalpervertex:"normalPerVertex",numcomponents:"numComponents",objecttype:"objectType",offset:"offset",offsetunits:"offsetUnits",on:"on",opacityfactor:"opacityFactor",order:"order",orientation:"orientation",orientation_changed:"orientation_changed",origin:"origin",orthogonalcolor:"orthogonalColor",outerradius:"outerRadius",parallelcolor:"parallelColor",parameter:"parameter",particlelifetime:"particleLifetime",particlesize:"particleSize",pausetime:"pauseTime",phasefunction:"phaseFunction",pickable:"pickable",pickednormal:"pickedNormal",pickedpoint:"pickedPoint",pickedtexturecoordinate:"pickedTextureCoordinate",pitch:"pitch",plane:"plane",point:"point",pointsize:"pointSize",port:"port",position:"position",position_changed:"position_changed",power:"power",preferaccuracy:"preferAccuracy",previous:"previous",priority:"priority",profile:"profile",progress:"progress",protofield:"protoField",radioentitytypecategory:"radioEntityTypeCategory",radioentitytypecountry:"radioEntityTypeCountry",radioentitytypedomain:"radioEntityTypeDomain",radioentitytypekind:"radioEntityTypeKind",radioentitytypenomenclature:"radioEntityTypeNomenclature",radioentitytypenomenclatureversion:"radioEntityTypeNomenclatureVersion",radioid:"radioID",radius:"radius",range:"range",readinterval:"readInterval",receivedpower:"receivedPower",receiverstate:"receiverState",reference:"reference",relativeantennalocation:"relativeAntennaLocation",repeatr:"repeatR",repeats:"repeatS",repeatt:"repeatT",resumetime:"resumeTime",retainedopacity:"retainedOpacity",retainuseroffsets:"retainUserOffsets",righturl:"rightUrl",rooturl:"rootUrl",rotateyup:"rotateYUp",rotation:"rotation",rotation_changed:"rotation_changed",rtpheaderexpected:"rtpHeaderExpected",samplerate:"sampleRate",samples:"samples",scale:"scale",scalemode:"scaleMode",scaleorientation:"scaleOrientation",scheme:"scheme",segmentenabled:"segmentEnabled",separatebackcolor:"separateBackColor",separation:"separation",separationrate:"separationRate",set_articulationparametervalue0:"set_articulationParameterValue0",set_articulationparametervalue1:"set_articulationParameterValue1",set_articulationparametervalue2:"set_articulationParameterValue2",set_articulationparametervalue3:"set_articulationParameterValue3",set_articulationparametervalue4:"set_articulationParameterValue4",set_articulationparametervalue5:"set_articulationParameterValue5",set_articulationparametervalue6:"set_articulationParameterValue6",set_articulationparametervalue7:"set_articulationParameterValue7",set_bind:"set_bind",set_boolean:"set_boolean",set_colorindex:"set_colorIndex",set_coordindex:"set_coordIndex",set_crosssection:"set_crossSection",set_destination:"set_destination",set_fraction:"set_fraction",set_height:"set_height",set_index:"set_index",set_normalindex:"set_normalIndex",set_orientation:"set_orientation",set_scale:"set_scale",set_spine:"set_spine",set_texcoordindex:"set_texCoordIndex",set_triggertime:"set_triggerTime",set_value:"set_value",shadows:"shadows",shiftkey:"shiftKey",shininess:"shininess",side:"side",silhouetteboundaryopacity:"silhouetteBoundaryOpacity",silhouetteretainedopacity:"silhouetteRetainedOpacity",silhouettesharpness:"silhouetteSharpness",siteid:"siteID",size:"size",sizeunits:"sizeUnits",skincoordindex:"skinCoordIndex",skincoordweight:"skinCoordWeight",skyangle:"skyAngle",skycolor:"skyColor",sliderforce:"sliderForce",slipcoefficients:"slipCoefficients",slipfactors:"slipFactors",softnessconstantforcemix:"softnessConstantForceMix",softnesserrorcorrection:"softnessErrorCorrection",solid:"solid",sortorder:"sortOrder",source:"source",spacing:"spacing",spatialize:"spatialize",specific:"specific",specularcolor:"specularColor",speed:"speed",speedfactor:"speedFactor",spine:"spine",startangle:"startAngle",starttime:"startTime",stiffness:"stiffness",stop1bounce:"stop1Bounce",stop1constantforcemix:"stop1ConstantForceMix",stop1errorcorrection:"stop1ErrorCorrection",stop2bounce:"stop2Bounce",stop2errorcorrection:"stop2ErrorCorrection",stop3bounce:"stop3Bounce",stop3errorcorrection:"stop3ErrorCorrection",stopbounce:"stopBounce",stoperrorcorrection:"stopErrorCorrection",stoptime:"stopTime",string:"string",stripcount:"stripCount",style:"style",subcategory:"subcategory",summary:"summary",surfacearea:"surfaceArea",surfacespeed:"surfaceSpeed",surfacetolerance:"surfaceTolerance",surfacevalues:"surfaceValues",suspensionerrorcorrection:"suspensionErrorCorrection",suspensionforce:"suspensionForce",tau:"tau",tdltype:"tdlType",tessellation:"tessellation",tessellationscale:"tessellationScale",texcoordindex:"texCoordIndex",texcoordkey:"texCoordKey",textbounds:"textBounds",texturecompression:"textureCompression",texturepriority:"texturePriority",time:"time",timeout:"timeOut",timestamp:"timestamp",title:"title",tofield:"toField",toggle:"toggle",tolerance:"tolerance",tonode:"toNode",top:"top",toptobottom:"topToBottom",topurl:"topUrl",torques:"torques",touchtime:"touchTime",trackpoint_changed:"trackPoint_changed",transitioncomplete:"transitionComplete",transitiontime:"transitionTime",transitiontype:"transitionType",translation:"translation",translation_changed:"translation_changed",transmitfrequencybandwidth:"transmitFrequencyBandwidth",transmitstate:"transmitState",transmitterapplicationid:"transmitterApplicationID",transmitterentityid:"transmitterEntityID",transmitterradioid:"transmitterRadioID",transmittersiteid:"transmitterSiteID",transparency:"transparency",triggertime:"triggerTime",triggertrue:"triggerTrue",triggervalue:"triggerValue",turbulence:"turbulence",type:"type",uclosed:"uClosed",udimension:"uDimension",uknot:"uKnot",ulimit:"ulimit",uorder:"uOrder",update:"update",url:"url",use:"USE",usefiniterotation:"useFiniteRotation",usegeometry:"useGeometry",useglobalgravity:"useGlobalGravity",utessellation:"uTessellation",value:"value",value_changed:"value_changed",variation:"variation",vclosed:"vClosed",vdimension:"vDimension",vector:"vector",version:"version",vertexcount:"vertexCount",vertices:"vertices",visibilitylimit:"visibilityLimit",visibilityrange:"visibilityRange",visible:"visible",vknot:"vKnot",vorder:"vOrder",vtessellation:"vTessellation",warhead:"warhead",warmcolor:"warmColor",weight:"weight",weightconstant1:"weightConstant1",weightconstant2:"weightConstant2",weightfunction1:"weightFunction1",weightfunction2:"weightFunction2",whichchoice:"whichChoice",whichgeometry:"whichGeometry",writeinterval:"writeInterval",xdimension:"xDimension",xspacing:"xSpacing",yscale:"yScale",zdimension:"zDimension",zspacing:"zSpacing"}};return Object.preventExtensions(e),Object.freeze(e),Object.seal(e),e}),define("cobweb/Parser/XMLParser",["jquery","cobweb/Basic/X3DField","cobweb/Basic/X3DArrayField","cobweb/Basic/X3DBaseNode","cobweb/Components/Core/X3DPrototypeInstance","cobweb/Fields","cobweb/Parser/Parser","cobweb/Parser/HTMLSupport","cobweb/Prototype/X3DExternProtoDeclaration","cobweb/Prototype/X3DProtoDeclaration","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a,u,l,c){function h(e){this.scene=e,this.executionContexts=[e],this.protoDeclarations=[],this.parents=[],this.parser=new s(this.scene,!0),this.url=new o.MFString}var d={initializeOnly:c.initializeOnly,inputOnly:c.inputOnly,outputOnly:c.outputOnly,inputOutput:c.inputOutput};return h.prototype={constructor:h,parseIntoScene:function(e){this.scene.setEncoding("XML"),this.scene.setProfile(this.getBrowser().getProfile("Full")),this.xmlElement(e)},parseIntoNode:function(e,t){this.pushExecutionContext(e.getExecutionContext()),this.pushParent(e),this.childElement(t),this.popParent(),this.popExecutionContext()},xmlElement:function(t){switch(t.nodeName){case"#document":var n=e(t).children("X3D");if(n.length)for(var i=0;i<n.length;++i)this.x3dElement(n[i]);else this.childrenElements(t);break;case"X3D":this.x3dElement(t);break;case"Scene":case"SCENE":this.sceneElement(t);break;default:this.childElement(t)}},x3dElement:function(e){try{var t=e.getAttribute("profile"),n=this.getBrowser().getProfile(t||"Full");this.scene.setProfile(n)}catch(e){console.log(e)}var i=e.getAttribute("version");i&&(this.scene.specificationVersion=i);for(var r=e.childNodes,o=0;o<r.length;++o)this.x3dElementChild(r[o])},x3dElementChild:function(e){switch(e.nodeName){case"head":case"HEAD":return void this.headElement(e);case"Scene":case"SCENE":return void this.sceneElement(e)}},headElement:function(e){for(var t=e.childNodes,n=0;n<t.length;++n)this.headElementChild(t[n])},headElementChild:function(e){switch(e.nodeName){case"component":case"COMPONENT":return void this.componentElement(e);case"unit":case"UNIT":return void this.unitElement(e);case"meta":case"META":return void this.metaElement(e)}},componentElement:function(e){try{var t=e.getAttribute("name"),n=parseInt(e.getAttribute("level"));if(null===t)return console.warn("XML Parser Error: Bad component statement: Expected name attribute.");if(null===n)return console.warn("XML Parser Error: Bad component statement: Expected level attribute.");var i=this.getBrowser().getComponent(t,n);this.scene.addComponent(i)}catch(e){console.log(e.message)}},unitElement:function(e){var t=e.getAttribute("category"),n=e.getAttribute("name"),i=e.getAttribute("conversionFactor");return null===t?console.warn("XML Parser Error: Bad unit statement: Expected category attribute."):null===n?console.warn("XML Parser Error: Bad unit statement: Expected name attribute."):null===i?console.warn("XML Parser Error: Bad unit statement: Expected conversionFactor attribute."):void this.scene.updateUnit(t,n,parseFloat(i))},metaElement:function(e){var t=e.getAttribute("name"),n=e.getAttribute("content");return null===t?console.warn("XML Parser Error: Bad meta statement: Expected name attribute."):null===n?console.warn("XML Parser Error: Bad meta statement: Expected content attribute."):void this.scene.setMetaData(t,n)},sceneElement:function(e){this.childrenElements(e)},childrenElements:function(e){for(var t=e.childNodes,n=0;n<t.length;++n)this.childElement(t[n])},childElement:function(e){switch(e.nodeName){case"#comment":case"#text":return;case"#cdata-section":return void this.cdataNode(e);case"ExternProtoDeclare":case"EXTERNPROTODECLARE":return void this.externProtoDeclareElement(e);case"ProtoDeclare":case"PROTODECLARE":return void this.protoDeclareElement(e);case"IS":return void this.isElement(e);case"ProtoInstance":case"PROTOINSTANCE":return void this.protoInstanceElement(e);case"fieldValue":case"FIELDVALUE":return void this.fieldValueElement(e);case"field":case"FIELD":return void this.fieldElement(e);case"ROUTE":return void this.routeElement(e);case"IMPORT":return void this.importElement(e);case"EXPORT":return void this.exportElement(e);default:return void this.nodeElement(e)}},externProtoDeclareElement:function(e){var t=e.getAttribute("name");if(this.id(t)){var n=e.getAttribute("url");if(null===n)return console.warn("XML Parser Error: Bad ExternProtoDeclare statement: Expected url attribute.");this.parser.setInput(n),s.prototype.sfstringValues.call(this.parser,this.url);var i=new u(this.getExecutionContext());this.pushParent(i),this.protoInterfaceElement(e),this.popParent(),i.setName(t),i.url_=this.url,i.setup(),this.getExecutionContext().externprotos.add(t,i)}},protoDeclareElement:function(e){var t=e.getAttribute("name");if(this.id(t)){for(var n=new l(this.getExecutionContext()),i=e.childNodes,r=0;r<i.length;++r){switch((o=i[r]).nodeName){case"ProtoInterface":case"PROTOINTERFACE":this.pushParent(n),this.protoInterfaceElement(o),this.popParent();break;default:continue}break}for(r=0;r<i.length;++r){var o=i[r];switch(o.nodeName){case"ProtoBody":case"PROTOBODY":this.pushExecutionContext(n),this.pushParent(n),this.protoBodyElement(o),this.popParent(),this.popExecutionContext();break;default:continue}break}n.setName(t),n.setup(),this.getExecutionContext().protos.add(t,n)}},protoInterfaceElement:function(e){for(var t=e.childNodes,n=0;n<t.length;++n)this.protoInterfaceElementChild(t[n])},protoInterfaceElementChild:function(e){switch(e.nodeName){case"field":case"FIELD":return void this.fieldElement(e)}},fieldElement:function(e){try{if(0===this.getParents().length)return;var t=this.getParent();if(!(t instanceof i))return;if(!t.hasUserDefinedFields())return;var n=d[e.getAttribute("accessType")];void 0===n&&(n=c.initializeOnly);var r=o[e.getAttribute("type")];if(void 0===r)return;var s=e.getAttribute("name");if(!this.id(s))return;var a=new r;n&c.initializeOnly&&(this.fieldValue(a,e.getAttribute("value")),this.pushParent(a),this.childrenElements(e),this.popParent()),t.addUserDefinedField(n,s,a)}catch(e){}},protoBodyElement:function(e){this.childrenElements(e)},isElement:function(e){if(this.getExecutionContext()instanceof l)for(var t=e.childNodes,n=0;n<t.length;++n)this.isElementChild(t[n])},isElementChild:function(e){switch(e.nodeName){case"connect":case"CONNECT":return void this.connectElement(e)}},connectElement:function(e){var t=e.getAttribute("nodeField"),n=e.getAttribute("protoField");if(null===t)return console.warn("XML Parser Error: Bad connect statement: Expected nodeField attribute.");if(null===n)return console.warn("XML Parser Error: Bad connect statement: Expected protoField attribute.");try{if(0===this.getParents().length)return;var r=this.getParent(),o=this.getExecutionContext();if(!(r instanceof i))return;var s=r.getField(t),a=o.getField(n);if(s.getType()!==a.getType())throw new Error("Field '"+s.getName()+"' and '"+a.getName()+"' in PROTO "+this.getExecutionContext().getName()+" have different types.");if(!a.isReference(s.getAccessType()))throw new Error("Field '"+s.getName()+"' and '"+a.getName()+"' in PROTO "+this.getExecutionContext().getName()+" are incompatible as an IS mapping.");s.addReference(a)}catch(e){console.warn("XML Parser Error: Couldn't create IS reference: "+e.message)}},protoInstanceElement:function(e){try{if(this.useAttribute(e))return;var t=e.getAttribute("name");if(this.id(t)){var n=this.getExecutionContext().createProto(t,!1);e.x3d=n,this.defAttribute(e,n),this.addNode(e,n),this.pushParent(n),this.childrenElements(e),this.getExecutionContext().addUninitializedNode(n),this.popParent()}}catch(e){console.warn("XML Parser Error: ",e.message)}},fieldValueElement:function(e){try{if(0===this.getParents().length)return;var t=this.getParent(),n=e.getAttribute("name");if(!(t instanceof r))return;if(!this.id(n))return;var i=t.getField(n);i.getAccessType()&c.initializeOnly&&(this.fieldValue(i,e.getAttribute("value")),this.pushParent(i),this.childrenElements(e),this.popParent())}catch(e){console.warn("XML Parser Error: Couldn't assign field value: "+e.message)}},nodeElement:function(e){try{if(this.useAttribute(e))return;var t=this.getExecutionContext().createNode(e.nodeName,!1);e.x3d=t,this.defAttribute(e,t),this.addNode(e,t),this.pushParent(t),this.nodeAttributes(e,t),this.childrenElements(e),this.getExecutionContext().addUninitializedNode(t),this.popParent()}catch(e){console.error("XML Parser Error: "+e.message)}},routeElement:function(e){try{var t=e.getAttribute("fromNode"),n=e.getAttribute("fromField"),i=e.getAttribute("toNode"),r=e.getAttribute("toField");if(null===t)throw new Error("Bad ROUTE statement: Expected fromNode attribute.");if(null===n)throw new Error("Bad ROUTE statement: Expected fromField attribute.");if(null===i)throw new Error("Bad ROUTE statement: Expected toNode attribute.");if(null===r)throw new Error("Bad ROUTE statement: Expected toField attribute.");var o=this.getExecutionContext(),s=o.getLocalNode(t),a=o.getLocalNode(i),u=o.addRoute(s,n,a,r);e.x3d=u}catch(e){console.warn("XML Parser Error: "+e.message)}},importElement:function(e){try{var t=e.getAttribute("inlineDEF"),n=e.getAttribute("exportedDEF"),i=e.getAttribute("AS");if(null===t)throw new Error("Bad IMPORT statement: Expected exportedDEF attribute.");if(null===n)throw new Error("Bad IMPORT statement: Expected exportedDEF attribute.");i||(i=n);var r=this.getExecutionContext().getNamedNode(t);this.getExecutionContext().updateImportedNode(r,n,i)}catch(e){console.warn("XML Parser Error: "+e.message)}},exportElement:function(e){try{if(this.scene!==this.getExecutionContext())return;var t=e.getAttribute("localDEF"),n=e.getAttribute("AS");if(null===t)throw new Error("Bad EXPORT statement: Expected localDEF attribute.");n||(n=t);var i=this.getExecutionContext().getLocalNode(t);this.scene.updateExportedNode(n,i)}catch(e){console.warn("XML Parser Error: "+e.message)}},cdataNode:function(e){if(0!==this.getParents().length){var t=this.getParent();if(t instanceof i){var n=t.getSourceText();n&&(n.push(e.data),n.setSet(!0))}}},useAttribute:function(e){try{var t=e.getAttribute("USE");if(this.id(t)){var n=this.getExecutionContext().getNamedNode(t);return this.addNode(e,n.getValue()),!0}}catch(e){console.warn("Invalid USE name: "+e.message)}return!1},defAttribute:function(e,t){try{var n=e.getAttribute("DEF");if(n){try{var i=this.getExecutionContext().getNamedNode(n);this.getExecutionContext().updateNamedNode(this.getExecutionContext().getUniqueName(n),i)}catch(e){}this.getExecutionContext().updateNamedNode(n,t)}}catch(e){console.warn("Invalid DEF name: "+e.message)}},nodeAttributes:function(e,t){for(var n=e.attributes,i=0;i<n.length;++i)this.nodeAttribute(n[i],t)},nodeAttribute:function(e,t){try{var n=t.getField(this.attributeToCamelCase(e.name));this.fieldValue(n,e.value)}catch(e){}},fieldValue:function(e,t){null!==t&&(e.setSet(!0),this.parser.setInput(t),this.fieldTypes[e.getType()].call(this.parser,e))},addNode:function(e,n){if(0===this.parents.length||this.getParent()instanceof l)this.getExecutionContext().rootNodes.push(n);else{var i=this.getParent();if(i instanceof t)switch(i.getType()){case c.SFNode:return i.setValue(n),void i.setSet(!0);case c.MFNode:return i.push(n),void i.setSet(!0)}else try{var r=e.getAttribute("containerField");r||(r=n.getContainerField());var o=i.getField(r);switch(o.getType()){case c.SFNode:return o.setValue(n),void o.setSet(!0);case c.MFNode:return o.push(n),void o.setSet(!0)}}catch(e){}}},getBrowser:function(){return this.scene.getBrowser()},getExecutionContext:function(){return this.executionContexts[this.executionContexts.length-1]},pushExecutionContext:function(e){return this.executionContexts.push(e)},popExecutionContext:function(){this.executionContexts.pop()},getParents:function(){return this.parents},getParent:function(){return this.parents[this.parents.length-1]},pushParent:function(e){return this.parents.push(e)},popParent:function(){this.parents.pop()},id:function(e){return null!==e&&0!==e.length},attributeToCamelCase:function(e){return e!==e.toLowerCase()?e:a.attributeLowerCaseToCamelCase[e]}},h.prototype.fieldTypes=[],h.prototype.fieldTypes[c.SFBool]=s.prototype.sfboolValue,h.prototype.fieldTypes[c.SFColor]=s.prototype.sfcolorValue,h.prototype.fieldTypes[c.SFColorRGBA]=s.prototype.sfcolorrgbaValue,h.prototype.fieldTypes[c.SFDouble]=s.prototype.sfdoubleValue,h.prototype.fieldTypes[c.SFFloat]=s.prototype.sffloatValue,h.prototype.fieldTypes[c.SFImage]=s.prototype.sfimageValue,h.prototype.fieldTypes[c.SFInt32]=s.prototype.sfint32Value,h.prototype.fieldTypes[c.SFMatrix3f]=s.prototype.sfmatrix3dValue,h.prototype.fieldTypes[c.SFMatrix3d]=s.prototype.sfmatrix3fValue,h.prototype.fieldTypes[c.SFMatrix4f]=s.prototype.sfmatrix4dValue,h.prototype.fieldTypes[c.SFMatrix4d]=s.prototype.sfmatrix4fValue,h.prototype.fieldTypes[c.SFNode]=function(e){e.set(null)},h.prototype.fieldTypes[c.SFRotation]=s.prototype.sfrotationValue,h.prototype.fieldTypes[c.SFString]=function(e){e.set(this.input)},h.prototype.fieldTypes[c.SFTime]=s.prototype.sftimeValue,h.prototype.fieldTypes[c.SFVec2d]=s.prototype.sfvec2dValue,h.prototype.fieldTypes[c.SFVec2f]=s.prototype.sfvec2fValue,h.prototype.fieldTypes[c.SFVec3d]=s.prototype.sfvec3dValue,h.prototype.fieldTypes[c.SFVec3f]=s.prototype.sfvec3fValue,h.prototype.fieldTypes[c.SFVec4d]=s.prototype.sfvec4dValue,h.prototype.fieldTypes[c.SFVec4f]=s.prototype.sfvec4fValue,h.prototype.fieldTypes[c.MFBool]=s.prototype.sfboolValues,h.prototype.fieldTypes[c.MFColor]=s.prototype.sfcolorValues,h.prototype.fieldTypes[c.MFColorRGBA]=s.prototype.sfcolorrgbaValues,h.prototype.fieldTypes[c.MFDouble]=s.prototype.sfdoubleValues,h.prototype.fieldTypes[c.MFFloat]=s.prototype.sffloatValues,h.prototype.fieldTypes[c.MFImage]=s.prototype.sfimageValues,h.prototype.fieldTypes[c.MFInt32]=s.prototype.sfint32Values,h.prototype.fieldTypes[c.MFMatrix3d]=s.prototype.sfmatrix3dValues,h.prototype.fieldTypes[c.MFMatrix3f]=s.prototype.sfmatrix3fValues,h.prototype.fieldTypes[c.MFMatrix4d]=s.prototype.sfmatrix4dValues,h.prototype.fieldTypes[c.MFMatrix4f]=s.prototype.sfmatrix4fValues,h.prototype.fieldTypes[c.MFNode]=function(){},h.prototype.fieldTypes[c.MFRotation]=s.prototype.sfrotationValues,h.prototype.fieldTypes[c.MFString]=s.prototype.sfstringValues,h.prototype.fieldTypes[c.MFTime]=s.prototype.sftimeValues,h.prototype.fieldTypes[c.MFVec2d]=s.prototype.sfvec2dValues,h.prototype.fieldTypes[c.MFVec2f]=s.prototype.sfvec2fValues,h.prototype.fieldTypes[c.MFVec3d]=s.prototype.sfvec3dValues,h.prototype.fieldTypes[c.MFVec3f]=s.prototype.sfvec3fValues,h.prototype.fieldTypes[c.MFVec4d]=s.prototype.sfvec4dValues,h.prototype.fieldTypes[c.MFVec4f]=s.prototype.sfvec4fValues,h}),define("lib/BinaryTransport",[],function(){return function(e){e.ajaxTransport("+binary",function(e,t,n){if(e.dataType&&"binary"==e.dataType)return{send:function(t,n){var i=e.xhr();if(i.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(r in e.xhrFields)i[r]=e.xhrFields[r];e.mimeType&&i.overrideMimeType&&i.overrideMimeType(e.mimeType);for(var r in t)i.setRequestHeader(r,t[r]);i.onload=function(){i.onload=i.onerror=null;var t={};t[e.dataType]=i.response,n(i.status,i.statusText,t,i.getAllResponseHeaders())},i.onerror=function(){i.onload=i.onerror=null,n(i.status||404,i.statusText)},i.responseType=e.responseType||"blob",i.send(e.hasContent&&e.data||null)},abort:function(){var t=e.xhr();t.onload=t.onerror=null,t.abort()}}})}}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("lib/pako/dist/pako_inflate",[],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=e()}}(function(){return function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return r(n||e)},c,c.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,t,n){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,i,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+i),r);else for(var o=0;o<i;o++)e[r+o]=t[n+o]},flattenChunks:function(e){var t,n,i,r,o,s;for(i=0,t=0,n=e.length;t<n;t++)i+=e[t].length;for(s=new Uint8Array(i),r=0,t=0,n=e.length;t<n;t++)o=e[t],s.set(o,r),r+=o.length;return s}},o={arraySet:function(e,t,n,i,r){for(var o=0;o<i;o++)e[r+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,r)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(i)},{}],2:[function(e,t,n){function i(e,t){if(t<65537&&(e.subarray&&s||!e.subarray&&o))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n}var r=e("./common"),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var a=new r.Buf8(256),u=0;u<256;u++)a[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;a[254]=a[254]=1,n.string2buf=function(e){var t,n,i,o,s,a=e.length,u=0;for(o=0;o<a;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),u+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(u),s=0,o=0;s<u;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[s++]=n:n<2048?(t[s++]=192|n>>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t},n.buf2binstring=function(e){return i(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,o,s,u=t||e.length,l=new Array(2*u);for(r=0,n=0;n<u;)if((o=e[n++])<128)l[r++]=o;else if((s=a[o])>4)l[r++]=65533,n+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&n<u;)o=o<<6|63&e[n++],s--;s>1?l[r++]=65533:o<65536?l[r++]=o:(o-=65536,l[r++]=55296|o>>10&1023,l[r++]=56320|1023&o)}return i(l,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+a[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){function i(e,t,n,i){for(var r=65535&e|0,o=e>>>16&65535|0,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{o=o+(r=r+t[i++]|0)|0}while(--s);r%=65521,o%=65521}return r|o<<16|0}t.exports=i},{}],4:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,n){function i(e,t,n,i){var o=r,s=i+n;e^=-1;for(var a=i;a<s;a++)e=e>>>8^o[255&(e^t[a])];return-1^e}var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=i},{}],6:[function(e,t,n){function i(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=i},{}],7:[function(e,t,n){t.exports=function(e,t){var n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b,w,y,x,v,_,S,C,F,T;n=e.state,i=e.next_in,F=e.input,r=i+(e.avail_in-5),o=e.next_out,T=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),u=n.dmax,l=n.wsize,c=n.whave,h=n.wnext,d=n.window,p=n.hold,f=n.bits,g=n.lencode,m=n.distcode,b=(1<<n.lenbits)-1,w=(1<<n.distbits)-1;e:do{f<15&&(p+=F[i++]<<f,f+=8,p+=F[i++]<<f,f+=8),y=g[p&b];t:for(;;){if(x=y>>>24,p>>>=x,f-=x,0===(x=y>>>16&255))T[o++]=65535&y;else{if(!(16&x)){if(0==(64&x)){y=g[(65535&y)+(p&(1<<x)-1)];continue t}if(32&x){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}v=65535&y,(x&=15)&&(f<x&&(p+=F[i++]<<f,f+=8),v+=p&(1<<x)-1,p>>>=x,f-=x),f<15&&(p+=F[i++]<<f,f+=8,p+=F[i++]<<f,f+=8),y=m[p&w];n:for(;;){if(x=y>>>24,p>>>=x,f-=x,!(16&(x=y>>>16&255))){if(0==(64&x)){y=m[(65535&y)+(p&(1<<x)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(_=65535&y,x&=15,f<x&&(p+=F[i++]<<f,(f+=8)<x&&(p+=F[i++]<<f,f+=8)),(_+=p&(1<<x)-1)>u){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=x,f-=x,x=o-s,_>x){if((x=_-x)>c&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(S=0,C=d,0===h){if(S+=l-x,x<v){v-=x;do{T[o++]=d[S++]}while(--x);S=o-_,C=T}}else if(h<x){if(S+=l+h-x,(x-=h)<v){v-=x;do{T[o++]=d[S++]}while(--x);if(S=0,h<v){v-=x=h;do{T[o++]=d[S++]}while(--x);S=o-_,C=T}}}else if(S+=h-x,x<v){v-=x;do{T[o++]=d[S++]}while(--x);S=o-_,C=T}for(;v>2;)T[o++]=C[S++],T[o++]=C[S++],T[o++]=C[S++],v-=3;v&&(T[o++]=C[S++],v>1&&(T[o++]=C[S++]))}else{S=o-_;do{T[o++]=T[S++],T[o++]=T[S++],T[o++]=T[S++],v-=3}while(v>2);v&&(T[o++]=T[S++],v>1&&(T[o++]=T[S++]))}break}}break}}while(i<r&&o<a);i-=v=f>>3,p&=(1<<(f-=v<<3))-1,e.next_in=i,e.next_out=o,e.avail_in=i<r?r-i+5:5-(i-r),e.avail_out=o<a?a-o+257:257-(o-a),n.hold=p,n.bits=f}},{}],8:[function(e,t,n){function i(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function r(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new b.Buf16(320),this.work=new b.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new b.Buf32(fe),t.distcode=t.distdyn=new b.Buf32(ge),t.sane=1,t.back=-1,O):D}function s(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,o(e)):D}function a(e,t){var n,i;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?D:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,s(e))):D}function u(e,t){var n,i;return e?(i=new r,e.state=i,i.window=null,(n=a(e,t))!==O&&(e.state=null),n):D}function l(e){return u(e,me)}function c(e){if(be){var t;for(g=new b.Buf32(512),m=new b.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(v(S,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;v(C,e.lens,0,32,m,0,e.work,{bits:5}),be=!1}e.lencode=g,e.lenbits=9,e.distcode=m,e.distbits=5}function h(e,t,n,i){var r,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new b.Buf8(o.wsize)),i>=o.wsize?(b.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((r=o.wsize-o.wnext)>i&&(r=i),b.arraySet(o.window,t,n-i,r,o.wnext),(i-=r)?(b.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0}function d(e,t){var n,r,o,s,a,u,l,d,p,f,g,m,fe,ge,me,be,we,ye,xe,ve,_e,Se,Ce,Fe,Te=0,Ne=new b.Buf8(4),Oe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return D;(n=e.state).mode===W&&(n.mode=Y),a=e.next_out,o=e.output,l=e.avail_out,s=e.next_in,r=e.input,u=e.avail_in,d=n.hold,p=n.bits,f=u,g=l,Se=O;e:for(;;)switch(n.mode){case P:if(0===n.wrap){n.mode=Y;break}for(;p<16;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(2&n.wrap&&35615===d){n.check=0,Ne[0]=255&d,Ne[1]=d>>>8&255,n.check=y(n.check,Ne,2,0),d=0,p=0,n.mode=L;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",n.mode=he;break}if((15&d)!==A){e.msg="unknown compression method",n.mode=he;break}if(d>>>=4,p-=4,_e=8+(15&d),0===n.wbits)n.wbits=_e;else if(_e>n.wbits){e.msg="invalid window size",n.mode=he;break}n.dmax=1<<_e,e.adler=n.check=1,n.mode=512&d?q:W,d=0,p=0;break;case L:for(;p<16;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(n.flags=d,(255&n.flags)!==A){e.msg="unknown compression method",n.mode=he;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=he;break}n.head&&(n.head.text=d>>8&1),512&n.flags&&(Ne[0]=255&d,Ne[1]=d>>>8&255,n.check=y(n.check,Ne,2,0)),d=0,p=0,n.mode=R;case R:for(;p<32;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}n.head&&(n.head.time=d),512&n.flags&&(Ne[0]=255&d,Ne[1]=d>>>8&255,Ne[2]=d>>>16&255,Ne[3]=d>>>24&255,n.check=y(n.check,Ne,4,0)),d=0,p=0,n.mode=k;case k:for(;p<16;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}n.head&&(n.head.xflags=255&d,n.head.os=d>>8),512&n.flags&&(Ne[0]=255&d,Ne[1]=d>>>8&255,n.check=y(n.check,Ne,2,0)),d=0,p=0,n.mode=z;case z:if(1024&n.flags){for(;p<16;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}n.length=d,n.head&&(n.head.extra_len=d),512&n.flags&&(Ne[0]=255&d,Ne[1]=d>>>8&255,n.check=y(n.check,Ne,2,0)),d=0,p=0}else n.head&&(n.head.extra=null);n.mode=j;case j:if(1024&n.flags&&((m=n.length)>u&&(m=u),m&&(n.head&&(_e=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),b.arraySet(n.head.extra,r,s,m,_e)),512&n.flags&&(n.check=y(n.check,r,m,s)),u-=m,s+=m,n.length-=m),n.length))break e;n.length=0,n.mode=X;case X:if(2048&n.flags){if(0===u)break e;m=0;do{_e=r[s+m++],n.head&&_e&&n.length<65536&&(n.head.name+=String.fromCharCode(_e))}while(_e&&m<u);if(512&n.flags&&(n.check=y(n.check,r,m,s)),u-=m,s+=m,_e)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=U;case U:if(4096&n.flags){if(0===u)break e;m=0;do{_e=r[s+m++],n.head&&_e&&n.length<65536&&(n.head.comment+=String.fromCharCode(_e))}while(_e&&m<u);if(512&n.flags&&(n.check=y(n.check,r,m,s)),u-=m,s+=m,_e)break e}else n.head&&(n.head.comment=null);n.mode=G;case G:if(512&n.flags){for(;p<16;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(d!==(65535&n.check)){e.msg="header crc mismatch",n.mode=he;break}d=0,p=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=W;break;case q:for(;p<32;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}e.adler=n.check=i(d),d=0,p=0,n.mode=H;case H:if(0===n.havedict)return e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=u,n.hold=d,n.bits=p,V;e.adler=n.check=1,n.mode=W;case W:if(t===T||t===N)break e;case Y:if(n.last){d>>>=7&p,p-=7&p,n.mode=ue;break}for(;p<3;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}switch(n.last=1&d,d>>>=1,p-=1,3&d){case 0:n.mode=$;break;case 1:if(c(n),n.mode=te,t===N){d>>>=2,p-=2;break e}break;case 2:n.mode=Q;break;case 3:e.msg="invalid block type",n.mode=he}d>>>=2,p-=2;break;case $:for(d>>>=7&p,p-=7&p;p<32;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if((65535&d)!=(d>>>16^65535)){e.msg="invalid stored block lengths",n.mode=he;break}if(n.length=65535&d,d=0,p=0,n.mode=K,t===N)break e;case K:n.mode=Z;case Z:if(m=n.length){if(m>u&&(m=u),m>l&&(m=l),0===m)break e;b.arraySet(o,r,s,m,a),u-=m,s+=m,l-=m,a+=m,n.length-=m;break}n.mode=W;break;case Q:for(;p<14;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(n.nlen=257+(31&d),d>>>=5,p-=5,n.ndist=1+(31&d),d>>>=5,p-=5,n.ncode=4+(15&d),d>>>=4,p-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=he;break}n.have=0,n.mode=J;case J:for(;n.have<n.ncode;){for(;p<3;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}n.lens[Oe[n.have++]]=7&d,d>>>=3,p-=3}for(;n.have<19;)n.lens[Oe[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ce={bits:n.lenbits},Se=v(_,n.lens,0,19,n.lencode,0,n.work,Ce),n.lenbits=Ce.bits,Se){e.msg="invalid code lengths set",n.mode=he;break}n.have=0,n.mode=ee;case ee:for(;n.have<n.nlen+n.ndist;){for(;Te=n.lencode[d&(1<<n.lenbits)-1],me=Te>>>24,be=Te>>>16&255,we=65535&Te,!(me<=p);){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(we<16)d>>>=me,p-=me,n.lens[n.have++]=we;else{if(16===we){for(Fe=me+2;p<Fe;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(d>>>=me,p-=me,0===n.have){e.msg="invalid bit length repeat",n.mode=he;break}_e=n.lens[n.have-1],m=3+(3&d),d>>>=2,p-=2}else if(17===we){for(Fe=me+3;p<Fe;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}p-=me,_e=0,m=3+(7&(d>>>=me)),d>>>=3,p-=3}else{for(Fe=me+7;p<Fe;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}p-=me,_e=0,m=11+(127&(d>>>=me)),d>>>=7,p-=7}if(n.have+m>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=he;break}for(;m--;)n.lens[n.have++]=_e}}if(n.mode===he)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=he;break}if(n.lenbits=9,Ce={bits:n.lenbits},Se=v(S,n.lens,0,n.nlen,n.lencode,0,n.work,Ce),n.lenbits=Ce.bits,Se){e.msg="invalid literal/lengths set",n.mode=he;break}if(n.distbits=6,n.distcode=n.distdyn,Ce={bits:n.distbits},Se=v(C,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ce),n.distbits=Ce.bits,Se){e.msg="invalid distances set",n.mode=he;break}if(n.mode=te,t===N)break e;case te:n.mode=ne;case ne:if(u>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=u,n.hold=d,n.bits=p,x(e,g),a=e.next_out,o=e.output,l=e.avail_out,s=e.next_in,r=e.input,u=e.avail_in,d=n.hold,p=n.bits,n.mode===W&&(n.back=-1);break}for(n.back=0;Te=n.lencode[d&(1<<n.lenbits)-1],me=Te>>>24,be=Te>>>16&255,we=65535&Te,!(me<=p);){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(be&&0==(240&be)){for(ye=me,xe=be,ve=we;Te=n.lencode[ve+((d&(1<<ye+xe)-1)>>ye)],me=Te>>>24,be=Te>>>16&255,we=65535&Te,!(ye+me<=p);){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}d>>>=ye,p-=ye,n.back+=ye}if(d>>>=me,p-=me,n.back+=me,n.length=we,0===be){n.mode=ae;break}if(32&be){n.back=-1,n.mode=W;break}if(64&be){e.msg="invalid literal/length code",n.mode=he;break}n.extra=15&be,n.mode=ie;case ie:if(n.extra){for(Fe=n.extra;p<Fe;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}n.length+=d&(1<<n.extra)-1,d>>>=n.extra,p-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=re;case re:for(;Te=n.distcode[d&(1<<n.distbits)-1],me=Te>>>24,be=Te>>>16&255,we=65535&Te,!(me<=p);){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(0==(240&be)){for(ye=me,xe=be,ve=we;Te=n.distcode[ve+((d&(1<<ye+xe)-1)>>ye)],me=Te>>>24,be=Te>>>16&255,we=65535&Te,!(ye+me<=p);){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}d>>>=ye,p-=ye,n.back+=ye}if(d>>>=me,p-=me,n.back+=me,64&be){e.msg="invalid distance code",n.mode=he;break}n.offset=we,n.extra=15&be,n.mode=oe;case oe:if(n.extra){for(Fe=n.extra;p<Fe;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}n.offset+=d&(1<<n.extra)-1,d>>>=n.extra,p-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=he;break}n.mode=se;case se:if(0===l)break e;if(m=g-l,n.offset>m){if((m=n.offset-m)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=he;break}m>n.wnext?(m-=n.wnext,fe=n.wsize-m):fe=n.wnext-m,m>n.length&&(m=n.length),ge=n.window}else ge=o,fe=a-n.offset,m=n.length;m>l&&(m=l),l-=m,n.length-=m;do{o[a++]=ge[fe++]}while(--m);0===n.length&&(n.mode=ne);break;case ae:if(0===l)break e;o[a++]=n.length,l--,n.mode=ne;break;case ue:if(n.wrap){for(;p<32;){if(0===u)break e;u--,d|=r[s++]<<p,p+=8}if(g-=l,e.total_out+=g,n.total+=g,g&&(e.adler=n.check=n.flags?y(n.check,o,g,a-g):w(n.check,o,g,a-g)),g=l,(n.flags?d:i(d))!==n.check){e.msg="incorrect data check",n.mode=he;break}d=0,p=0}n.mode=le;case le:if(n.wrap&&n.flags){for(;p<32;){if(0===u)break e;u--,d+=r[s++]<<p,p+=8}if(d!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=he;break}d=0,p=0}n.mode=ce;case ce:Se=M;break e;case he:Se=I;break e;case de:return B;case pe:default:return D}return e.next_out=a,e.avail_out=l,e.next_in=s,e.avail_in=u,n.hold=d,n.bits=p,(n.wsize||g!==e.avail_out&&n.mode<he&&(n.mode<ue||t!==F))&&h(e,e.output,e.next_out,g-e.avail_out)?(n.mode=de,B):(f-=e.avail_in,g-=e.avail_out,e.total_in+=f,e.total_out+=g,n.total+=g,n.wrap&&g&&(e.adler=n.check=n.flags?y(n.check,o,g,e.next_out-g):w(n.check,o,g,e.next_out-g)),e.data_type=n.bits+(n.last?64:0)+(n.mode===W?128:0)+(n.mode===te||n.mode===K?256:0),(0===f&&0===g||t===F)&&Se===O&&(Se=E),Se)}function p(e){if(!e||!e.state)return D;var t=e.state;return t.window&&(t.window=null),e.state=null,O}function f(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?D:(n.head=t,t.done=!1,O):D}var g,m,b=e("../utils/common"),w=e("./adler32"),y=e("./crc32"),x=e("./inffast"),v=e("./inftrees"),_=0,S=1,C=2,F=4,T=5,N=6,O=0,M=1,V=2,D=-2,I=-3,B=-4,E=-5,A=8,P=1,L=2,R=3,k=4,z=5,j=6,X=7,U=8,G=9,q=10,H=11,W=12,Y=13,$=14,K=15,Z=16,Q=17,J=18,ee=19,te=20,ne=21,ie=22,re=23,oe=24,se=25,ae=26,ue=27,le=28,ce=29,he=30,de=31,pe=32,fe=852,ge=592,me=15,be=!0;n.inflateReset=s,n.inflateReset2=a,n.inflateResetKeep=o,n.inflateInit=l,n.inflateInit2=u,n.inflate=d,n.inflateEnd=p,n.inflateGetHeader=f,n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,n){var i=e("../utils/common"),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,u,l,c,h,d){var p,f,g,m,b,w,y,x,v,_=d.bits,S=0,C=0,F=0,T=0,N=0,O=0,M=0,V=0,D=0,I=0,B=null,E=0,A=new i.Buf16(16),P=new i.Buf16(16),L=null,R=0;for(S=0;S<=15;S++)A[S]=0;for(C=0;C<u;C++)A[t[n+C]]++;for(N=_,T=15;T>=1&&0===A[T];T--);if(N>T&&(N=T),0===T)return l[c++]=20971520,l[c++]=20971520,d.bits=1,0;for(F=1;F<T&&0===A[F];F++);for(N<F&&(N=F),V=1,S=1;S<=15;S++)if(V<<=1,(V-=A[S])<0)return-1;if(V>0&&(0===e||1!==T))return-1;for(P[1]=0,S=1;S<15;S++)P[S+1]=P[S]+A[S];for(C=0;C<u;C++)0!==t[n+C]&&(h[P[t[n+C]]++]=C);if(0===e?(B=L=h,w=19):1===e?(B=r,E-=257,L=o,R-=257,w=256):(B=s,L=a,w=-1),I=0,C=0,S=F,b=c,O=N,M=0,g=-1,D=1<<N,m=D-1,1===e&&D>852||2===e&&D>592)return 1;for(var k=0;;){k++,y=S-M,h[C]<w?(x=0,v=h[C]):h[C]>w?(x=L[R+h[C]],v=B[E+h[C]]):(x=96,v=0),p=1<<S-M,F=f=1<<O;do{l[b+(I>>M)+(f-=p)]=y<<24|x<<16|v|0}while(0!==f);for(p=1<<S-1;I&p;)p>>=1;if(0!==p?(I&=p-1,I+=p):I=0,C++,0==--A[S]){if(S===T)break;S=t[n+h[C]]}if(S>N&&(I&m)!==g){for(0===M&&(M=N),b+=F,V=1<<(O=S-M);O+M<T&&!((V-=A[O+M])<=0);)O++,V<<=1;if(D+=1<<O,1===e&&D>852||2===e&&D>592)return 1;l[g=I&m]=N<<24|O<<16|b-c|0}}return 0!==I&&(l[b+I]=S-M<<24|64<<16|0),d.bits=N,0}},{"../utils/common":1}],10:[function(e,t,n){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,n){function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=i},{}],"/lib/inflate.js":[function(e,t,n){function i(e,t){var n=new p(t);if(n.push(e,!0),n.err)throw n.msg;return n.result}function r(e,t){return t=t||{},t.raw=!0,i(e,t)}var o=e("./zlib/inflate.js"),s=e("./utils/common"),a=e("./utils/strings"),u=e("./zlib/constants"),l=e("./zlib/messages"),c=e("./zlib/zstream"),h=e("./zlib/gzheader"),d=Object.prototype.toString,p=function(e){this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=o.inflateInit2(this.strm,t.windowBits);if(n!==u.Z_OK)throw new Error(l[n]);this.header=new h,o.inflateGetHeader(this.strm,this.header)};p.prototype.push=function(e,t){var n,i,r,l,c,h=this.strm,p=this.options.chunkSize,f=!1;if(this.ended)return!1;i=t===~~t?t:!0===t?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof e?h.input=a.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new s.Buf8(p),h.next_out=0,h.avail_out=p),(n=o.inflate(h,u.Z_NO_FLUSH))===u.Z_BUF_ERROR&&!0===f&&(n=u.Z_OK,f=!1),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&n!==u.Z_STREAM_END&&(0!==h.avail_in||i!==u.Z_FINISH&&i!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(r=a.utf8border(h.output,h.next_out),l=h.next_out-r,c=a.buf2string(h.output,r),h.next_out=l,h.avail_out=p-l,l&&s.arraySet(h.output,h.output,r,l,0),this.onData(c)):this.onData(s.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(f=!0)}while((h.avail_in>0||0===h.avail_out)&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(i=u.Z_FINISH),i===u.Z_FINISH?(n=o.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):i!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),h.avail_out=0,!0)},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=p,n.inflate=i,n.inflateRaw=r,n.ungzip=i},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate.js":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}),define("cobweb/DEBUG",["cobweb/Browser/VERSION"],function(e){return e.match(/^\d+\.\d+a$/)}),define("cobweb/InputOutput/FileLoader",["jquery","cobweb/Base/X3DObject","cobweb/Fields","cobweb/Browser/Networking/urls","cobweb/Parser/Parser","cobweb/Parser/XMLParser","standard/Networking/URI","lib/BinaryTransport","lib/pako/dist/pako_inflate","cobweb/DEBUG"],function(e,t,n,i,r,o,s,a,u,l){function c(e,n){t.call(this),this.node=e,this.browser=e.getBrowser(),this.external=void 0===n?this.browser.isExternal():n,this.executionContext=this.external?e.getExecutionContext():this.browser.currentScene,this.userAgent=this.browser.getName()+"/"+this.browser.getVersion()+" (X3D Browser; +"+this.browser.getProviderUrl()+")",this.url=[],this.URL=new s,this.fileReader=new FileReader}a(e);var h=/^\s*(?:vrmlscript|javascript|ecmascript)\:([^]*)$/,d=/^data\:([^]*?)(?:;([^]*?))?(;base64)?,([^]*)$/,p=/^(?:(.*?);(.*?)$)/,f=new RegExp(".(?:html|xhtml)$"),g={"text/html":!0,"application/xhtml+xml":!0},m=new n.MFString;return c.prototype=e.extend(Object.create(t.prototype),{constructor:c,abort:function(){this.callback=Function.prototype,this.bindViewpoint=Function.prototype,this.foreign=Function.prototype},getWorldURL:function(){return this.URL},createX3DFromString:function(t,n,i,o){var s=this.browser.createScene();if(s.setURL(this.browser.getLocation().transform(t)),i)try{setTimeout(this.importDocument.bind(this,s,e.parseXML(n),i,o),17)}catch(e){new r(s).parseIntoScene(n),this.setScene(s,i)}else try{return this.importDocument(s,e.parseXML(n)),s}catch(e){return new r(s).parseIntoScene(n),s}},importDocument:function(e,t,n,i){try{new o(e).parseIntoScene(t),this.node.dom=t,n&&this.setScene(e,n)}catch(e){if(!i)throw e;i(e)}},setScene:function(e,t){e.initLoadCount_.addInterest("set_initLoadCount__",this,e,t),e.initLoadCount_.addEvent()},set_initLoadCount__:function(e,t,n){e.getValue()||(t.initLoadCount_.removeInterest("set_initLoadCount__",this),n(t),l&&this.URL.length&&"data"!==this.URL.scheme&&console.info("Done loading scene "+this.URL))},createX3DFromURL:function(e,t,n,i,r){return this.bindViewpoint=i,this.foreign=r,n?this.loadDocument(e,t,this.createX3DFromURLAsync.bind(this,n)):this.createX3DFromURLSync(e)},createX3DFromURLAsync:function(e,t){null===t?e(null):this.createX3DFromString(this.URL,t,e,this.loadDocumentError.bind(this))},createX3DFromURLSync:function(t){if(0===t.length)throw new Error("No URL given.");for(var n=null,i=!1,r=0;r<t.length&&(this.URL=this.transform(t[r]),e.ajax({url:this.URL,dataType:"text",async:!1,cache:this.browser.getBrowserOptions().getCache(),global:!1,context:this,success:function(e){try{n=this.createX3DFromString(this.URL,e),i=!0}catch(e){this.error(e)}},error:function(e,t,n){}}),!i);++r);if(i)return n;throw new Error("Couldn't load any url of '"+t.getValue().join(", ")+"'.")},loadScript:function(e,t){this.script=!0,this.loadDocument(e,null,t)},loadDocument:function(e,t,n){if(this.url=e.copy(),this.callback=n,0===e.length)return this.loadDocumentError(new Error("No URL given."));this.target=this.getTarget(t||m),this.loadDocumentAsync(this.url.shift())},getTarget:function(e){for(var t=0,n=e.length;t<n;++t){var i=e[t].split("=");if(2===i.length&&"target"===i[0])return i[1]}return""},loadDocumentAsync:function(t){var n=new s(t);{if(0!=t.length){try{if(this.bindViewpoint&&0===n.filename.toString().length&&0===n.query.length)return void this.bindViewpoint(n.fragment)}catch(e){return void this.loadDocumentError(e)}if(this.script)try{if(r=h.exec(t))return void this.callback(r[1])}catch(e){return void this.loadDocumentError(e)}try{var r=d.exec(t);if(r){var o=r[4];return o=";base64"===r[3]?atob(o):unescape(o),this.target.length&&"_self"!==this.target&&this.foreign?this.foreign(this.URL.toString(),this.target):void this.callback(o)}}catch(e){return void this.loadDocumentError(e)}return this.URL=this.transform(t),this.target.length&&"_self"!==this.target&&this.foreign?this.foreign(this.URL.toString().replace(i.fallbackExpression,""),this.target):(n.isDirectory()||n.suffix.match(f))&&this.foreign?this.foreign(t.replace(i.fallbackExpression,""),this.target):void e.ajax({url:this.URL,dataType:"binary",async:!0,cache:this.browser.getBrowserOptions().getCache(),global:!1,context:this,success:function(e,t,n){if(this.foreign&&g[this.getContentType(n)])return this.foreign(this.URL.toString().replace(i.fallbackExpression,""),this.target);this.fileReader.onload=this.readAsText.bind(this,e),this.fileReader.readAsText(e)},error:function(e,t,n){this.loadDocumentError(new Error(n))}})}this.loadDocumentError(new Error("URL is empty."))}},readAsText:function(e){try{this.callback(this.fileReader.result)}catch(t){this.fileReader.onload=this.readAsArrayBuffer.bind(this,t),this.fileReader.readAsArrayBuffer(e)}},readAsArrayBuffer:function(e){try{this.callback(u.ungzip(this.fileReader.result,{to:"string"}))}catch(t){this.loadDocumentError(e)}},loadDocumentError:function(e){this.error(e),this.url.length?this.loadDocumentAsync(this.url.shift()):this.callback(null)},error:function(e){"data"!==this.URL.scheme&&(console.warn("Couldn't load URL '"+this.URL+"':",e.message),l&&console.log(e))},transform:function(e){var t=this.getReferer().transform(new s(e));return t.isLocal()||"localhost"===t.host?t=this.browser.getLocation().getRelativePath(t):e.match(i.fallbackExpression)||this.url.unshift(i.fallbackUrl+t),t},getReferer:function(){return"World"===this.node.getTypeName()&&this.external?this.browser.getLocation():this.executionContext.getURL()},getContentType:function(e){var t=e.getResponseHeader("Content-Type"),n=p.exec(t);return n?n[1]:""}}),c}),define("cobweb/Components/Shaders/ShaderPart",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Browser/Shaders/Shader","cobweb/Components/Core/X3DNode","cobweb/Components/Networking/X3DUrlObject","cobweb/InputOutput/FileLoader","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a,u){function l(e){o.call(this,e),s.call(this,e),this.valid=!1,this.addType(u.ShaderPart)}var c={VERTEX:"VERTEX_SHADER",TESS_CONTROL:"TESS_CONTROL_SHADER",TESS_EVALUATION:"TESS_EVALUATION_SHADER",GEOMETRY:"GEOMETRY_SHADER",FRAGMENT:"FRAGMENT_SHADER",COMPUTE:"COMPUTE_SHADER"};return l.prototype=e.extend(Object.create(o.prototype),s.prototype,{constructor:l,fieldDefinitions:new i([new n(u.inputOutput,"metadata",new t.SFNode),new n(u.initializeOnly,"type",new t.SFString("VERTEX")),new n(u.inputOutput,"url",new t.MFString)]),getTypeName:function(){return"ShaderPart"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"parts"},initialize:function(){o.prototype.initialize.call(this),s.prototype.initialize.call(this);var e=this.getBrowser().getContext();this.shader=e.createShader(e[this.getShaderType()]),this.requestAsyncLoad()},isValid:function(){return this.valid},getShader:function(){return this.shader},getShaderType:function(){var e=c[this.type_.getValue()];return e||"VERTEX_SHADER"},getSourceText:function(){return this.url_},requestAsyncLoad:function(){this.checkLoadState()!=u.COMPLETE_STATE&&this.checkLoadState()!=u.IN_PROGRESS_STATE&&(this.setLoadState(u.IN_PROGRESS_STATE),this.valid=!1,new a(this).loadDocument(this.url_,null,function(e,t){if(null===e)this.setLoadState(u.FAILED_STATE);else{var n=this.getBrowser().getContext();if(n.shaderSource(this.shader,r.getShaderSource(this.getBrowser(),e)),n.compileShader(this.shader),this.valid=n.getShaderParameter(this.shader,n.COMPILE_STATUS),!this.valid)throw new Error(this.getTypeName()+" '"+this.getName()+"': "+n.getShaderInfoLog(this.shader));this.setLoadState(u.COMPLETE_STATE)}}.bind(this)))}}),l}),define("text!cobweb/Browser/Shaders/PointSet.fs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform float x3d_LinewidthScaleFactor;\n\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nuniform int   x3d_FogType;\nuniform vec3  x3d_FogColor;\nuniform float x3d_FogVisibilityRange;\n\nvarying vec4 C; // color\nvarying vec3 v; // point on geometry\n\nvoid\nclip ()\n{\n\tfor (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n\t{\n\t\tif (x3d_ClipPlane [i] == x3d_NoneClipPlane)\n\t\t\tbreak;\n\n\t\tif (dot (v, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n\t\t\tdiscard;\n\t}\n}\n\nfloat\ngetFogInterpolant ()\n{\n\tif (x3d_FogType == x3d_NoneFog)\n\t\treturn 1.0;\n\n\tfloat dV = length (v);\n\n\tif (dV >= x3d_FogVisibilityRange)\n\t\treturn 0.0;\n\n\tif (x3d_FogType == x3d_LinearFog)\n\t\treturn (x3d_FogVisibilityRange - dV) / x3d_FogVisibilityRange;\n\n\tif (x3d_FogType == x3d_ExponentialFog)\n\t\treturn exp (-dV / (x3d_FogVisibilityRange - dV));\n\n\treturn 1.0;\n}\n\nvoid\nmain ()\n{\n\tclip ();\n\n\tfloat f0 = getFogInterpolant ();\n\tfloat lw = (x3d_LinewidthScaleFactor + 1.0) / 2.0;\n\tfloat t  = distance (vec2 (0.5, 0.5), gl_PointCoord) * 2.0 * lw - lw + 1.0;\n\n\tgl_FragColor .rgb = mix (x3d_FogColor, C .rgb, f0);\n\tgl_FragColor .a   = mix (C .a, 0.0, clamp (t, 0.0, 1.0));\n}\n"}),define("text!cobweb/Browser/Shaders/Wireframe.vs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform int x3d_GeometryType;\n\nuniform float x3d_LinewidthScaleFactor;\nuniform bool  x3d_ColorMaterial;   // true if a X3DColorNode is attached, otherwise false\nuniform bool  x3d_Lighting;        // true if a X3DMaterialNode is attached, otherwise false\nuniform vec3  x3d_EmissiveColor;\nuniform float x3d_Transparency;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\n\nattribute vec4 x3d_Color;\nattribute vec4 x3d_Vertex;\n\nvarying vec4 C; // color\nvarying vec3 v; // point on geometry\n\nvoid\nmain ()\n{\n\t// If we are points, make the gl_PointSize one pixel larger.\n\tgl_PointSize = x3d_GeometryType == x3d_GeometryLines ? x3d_LinewidthScaleFactor : x3d_LinewidthScaleFactor + 1.0;\n\n\tvec4 p = x3d_ModelViewMatrix * x3d_Vertex;\n\n\tv           = vec3 (p);\n\tgl_Position = x3d_ProjectionMatrix * p;\n\n\tif (x3d_Lighting)\n\t{\n\t\tfloat alpha = 1.0 - x3d_Transparency;\n\n\t\tif (x3d_ColorMaterial)\n\t\t{\n\t\t\tC .rgb = x3d_Color .rgb;\n\t\t\tC .a   = x3d_Color .a * alpha;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tC .rgb = x3d_EmissiveColor;\n\t\t\tC .a   = alpha;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (x3d_ColorMaterial)\n\t\t\tC = x3d_Color;\n\t\telse\n\t\t\tC = vec4 (1.0, 1.0, 1.0, 1.0);\n\t}\n}\n"}),define("text!cobweb/Browser/Shaders/Wireframe.fs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform float x3d_LinewidthScaleFactor;\n\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nuniform int   x3d_FogType;\nuniform vec3  x3d_FogColor;\nuniform float x3d_FogVisibilityRange;\n\nvarying vec4 C; // color\nvarying vec3 v; // point on geometry\n\nvoid\nclip ()\n{\n\tfor (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n\t{\n\t\tif (x3d_ClipPlane [i] == x3d_NoneClipPlane)\n\t\t\tbreak;\n\n\t\tif (dot (v, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n\t\t\tdiscard;\n\t}\n}\n\nfloat\ngetFogInterpolant ()\n{\n\tif (x3d_FogType == x3d_NoneFog)\n\t\treturn 1.0;\n\n\tfloat dV = length (v);\n\n\tif (dV >= x3d_FogVisibilityRange)\n\t\treturn 0.0;\n\n\tif (x3d_FogType == x3d_LinearFog)\n\t\treturn (x3d_FogVisibilityRange - dV) / x3d_FogVisibilityRange;\n\n\tif (x3d_FogType == x3d_ExponentialFog)\n\t\treturn exp (-dV / (x3d_FogVisibilityRange - dV));\n\n\treturn 1.0;\n}\n\nvoid\nmain ()\n{\n\tclip ();\n\n\tfloat f0 = getFogInterpolant ();\n\n\tgl_FragColor .rgb = mix (x3d_FogColor, C .rgb, f0);\n\tgl_FragColor .a   = C .a;\n}\n"}),define("text!cobweb/Browser/Shaders/Gouraud.vs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform mat4 x3d_TextureMatrix [1];\nuniform mat3 x3d_NormalMatrix;\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\n\nuniform float x3d_LinewidthScaleFactor;\nuniform bool  x3d_Lighting;      // true if a X3DMaterialNode is attached, otherwise false\nuniform bool  x3d_ColorMaterial; // true if a X3DColorNode is attached, otherwise false\n\nuniform int   x3d_LightType [x3d_MaxLights];\nuniform bool  x3d_LightOn [x3d_MaxLights];\nuniform vec3  x3d_LightColor [x3d_MaxLights];\nuniform float x3d_LightIntensity [x3d_MaxLights];\nuniform float x3d_LightAmbientIntensity [x3d_MaxLights];\nuniform vec3  x3d_LightAttenuation [x3d_MaxLights];\nuniform vec3  x3d_LightLocation [x3d_MaxLights];\nuniform vec3  x3d_LightDirection [x3d_MaxLights];\nuniform float x3d_LightRadius [x3d_MaxLights];\nuniform float x3d_LightBeamWidth [x3d_MaxLights];\nuniform float x3d_LightCutOffAngle [x3d_MaxLights];\n\nuniform bool x3d_SeparateBackColor;\n\nuniform float x3d_AmbientIntensity;\nuniform vec3  x3d_DiffuseColor;\nuniform vec3  x3d_SpecularColor;\nuniform vec3  x3d_EmissiveColor;\nuniform float x3d_Shininess;\nuniform float x3d_Transparency;\n\nuniform float x3d_BackAmbientIntensity;\nuniform vec3  x3d_BackDiffuseColor;\nuniform vec3  x3d_BackSpecularColor;\nuniform vec3  x3d_BackEmissiveColor;\nuniform float x3d_BackShininess;\nuniform float x3d_BackTransparency;\n\nattribute vec4 x3d_Color;\nattribute vec4 x3d_TexCoord;\nattribute vec3 x3d_Normal;\nattribute vec4 x3d_Vertex;\n\nvarying vec4  frontColor; // color\nvarying vec4  backColor;  // color\nvarying vec4  t;          // texCoord\nvarying vec3  v;          // point on geometry\n\nvec4\ngetMaterialColor (in vec3 N,\n                  in vec3 v,\n                  in float x3d_AmbientIntensity,\n                  in vec3  x3d_DiffuseColor,\n                  in vec3  x3d_SpecularColor,\n                  in vec3  x3d_EmissiveColor,\n                  in float x3d_Shininess,\n                  in float x3d_Transparency)\n{\n\tvec3 V = normalize (-v); // normalized vector from point on geometry to viewer's position\n\n\t// Calculate diffuseFactor & alpha\n\n\tvec3  diffuseFactor = vec3 (1.0, 1.0, 1.0);\n\tfloat alpha         = 1.0 - x3d_Transparency;\n\n\tif (x3d_ColorMaterial)\n\t{\n\t\tdiffuseFactor  = x3d_Color .rgb;\n\t\talpha         *= x3d_Color .a;\n\t}\n\telse\n\t\tdiffuseFactor = x3d_DiffuseColor;\n\n\tvec3 ambientTerm = diffuseFactor * x3d_AmbientIntensity;\n\n\t// Apply light sources\n\n\tvec3 finalColor = vec3 (0.0, 0.0, 0.0);\n\n\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n\t{\n\t\tint lightType = x3d_LightType [i];\n\n\t\tif (lightType == x3d_NoneLight)\n\t\t\tbreak;\n\n\t\tvec3  vL = x3d_LightLocation [i] - v;\n\t\tfloat dL = length (vL);\n\t\tbool  di = lightType == x3d_DirectionalLight;\n\n\t\tif (di || dL <= x3d_LightRadius [i])\n\t\t{\n\t\t\tvec3 d = x3d_LightDirection [i];\n\t\t\tvec3 c = x3d_LightAttenuation [i];\n\t\t\tvec3 L = di ? -d : normalize (vL);\n\t\t\tvec3 H = normalize (L + V); // specular term\n\n\t\t\tvec3  diffuseTerm    = diffuseFactor * max (dot (N, L), 0.0);\n\t\t\tfloat specularFactor = x3d_Shininess > 0.0 ? pow (max (dot (N, H), 0.0), x3d_Shininess * 128.0) : 1.0;\n\t\t\tvec3  specularTerm   = x3d_SpecularColor * specularFactor;\n\n\t\t\tfloat attenuation = di ? 1.0 : 1.0 / max (c [0] + c [1] * dL + c [2] * (dL * dL), 1.0);\n\t\t\tfloat spot        = 1.0;\n\n\t\t\tif (lightType == x3d_SpotLight)\n\t\t\t{\n\t\t\t\tfloat spotAngle   = acos (clamp (dot (-L, d), -1.0, 1.0));\n\t\t\t\tfloat cutOffAngle = x3d_LightCutOffAngle [i];\n\t\t\t\tfloat beamWidth   = x3d_LightBeamWidth [i];\n\t\t\t\t\n\t\t\t\tif (spotAngle >= cutOffAngle)\n\t\t\t\t\tspot = 0.0;\n\t\t\t\telse if (spotAngle <= beamWidth)\n\t\t\t\t\tspot = 1.0;\n\t\t\t\telse\n\t\t\t\t\tspot = (spotAngle - cutOffAngle) / (beamWidth - cutOffAngle);\n\t\t\t}\n\t\t\n\t\t\tvec3 lightFactor  = (attenuation * spot) * x3d_LightColor [i];\n\t\t\tvec3 ambientLight = (lightFactor * x3d_LightAmbientIntensity [i]) * ambientTerm;\n\n\t\t\tlightFactor *= x3d_LightIntensity [i];\n\t\t\tfinalColor  += ambientLight + lightFactor * (diffuseTerm + specularTerm);\n\t\t}\n\t}\n\n\tfinalColor += x3d_EmissiveColor;\n\n\treturn vec4 (clamp (finalColor, 0.0, 1.0), alpha);\n}\n\nvoid\nmain ()\n{\n\tgl_PointSize = x3d_LinewidthScaleFactor;\n\n\tvec4 p = x3d_ModelViewMatrix * x3d_Vertex;\n\n\tt = x3d_TextureMatrix [0] * x3d_TexCoord;\n\tv = p .xyz;\n\n\tgl_Position = x3d_ProjectionMatrix * p;\n\n\tif (x3d_Lighting)\n\t{\n\t\tvec3 N = normalize (x3d_NormalMatrix * x3d_Normal);\n\n\t\tfloat ambientIntensity = x3d_AmbientIntensity;\n\t\tvec3  diffuseColor     = x3d_DiffuseColor;\n\t\tvec3  specularColor    = x3d_SpecularColor;\n\t\tvec3  emissiveColor    = x3d_EmissiveColor;\n\t\tfloat shininess        = x3d_Shininess;\n\t\tfloat transparency     = x3d_Transparency;\n\n\t\tfrontColor = getMaterialColor (N, v,\n\t\t                               ambientIntensity,\n\t\t                               diffuseColor,\n\t\t                               specularColor,\n\t\t                               emissiveColor,\n\t\t                               shininess,\n\t\t                               transparency);\n\n\t\tif (x3d_SeparateBackColor)\n\t\t{\n\t\t\tambientIntensity = x3d_BackAmbientIntensity;\n\t\t\tdiffuseColor     = x3d_BackDiffuseColor;\n\t\t\tspecularColor    = x3d_BackSpecularColor;\n\t\t\temissiveColor    = x3d_BackEmissiveColor;\n\t\t\tshininess        = x3d_BackShininess;\n\t\t\ttransparency     = x3d_BackTransparency;\n\t\t}\n\n\t\tbackColor = getMaterialColor (-N, v,\n\t\t                              ambientIntensity,\n\t\t                              diffuseColor,\n\t\t                              specularColor,\n\t\t                              emissiveColor,\n\t\t                              shininess,\n\t\t                              transparency);\n\t}\n\telse\n\t{\n\t   frontColor = backColor = x3d_ColorMaterial ? x3d_Color : vec4 (1.0, 1.0, 1.0, 1.0);\n\t}\n}\n"}),define("text!cobweb/Browser/Shaders/Gouraud.fs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform int x3d_GeometryType;\n\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nuniform int   x3d_FogType;\nuniform vec3  x3d_FogColor;\nuniform float x3d_FogVisibilityRange;\n\nuniform float x3d_LinewidthScaleFactor;\nuniform bool  x3d_Lighting;      // true if a X3DMaterialNode is attached, otherwise false\nuniform bool  x3d_ColorMaterial; // true if a X3DColorNode is attached, otherwise false\n\nuniform int         x3d_TextureType [x3d_MaxTextures]; // x3d_NoneTexture, x3d_TextureType2D or x3d_TextureTypeCubeMapTexture\nuniform sampler2D   x3d_Texture2D [x3d_MaxTextures];\nuniform samplerCube x3d_CubeMapTexture [x3d_MaxTextures];\n\nvarying vec4 frontColor; // color\nvarying vec4 backColor;  // color\nvarying vec4 t;          // texCoord\nvarying vec3 v;          // point on geometry\n\nvoid\nclip ()\n{\n\tfor (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n\t{\n\t\tif (x3d_ClipPlane [i] == x3d_NoneClipPlane)\n\t\t\tbreak;\n\n\t\tif (dot (v, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n\t\t\tdiscard;\n\t}\n}\n\nfloat\ngetFogInterpolant ()\n{\n\tif (x3d_FogType == x3d_NoneFog)\n\t\treturn 1.0;\n\n\tfloat dV = length (v);\n\n\tif (dV >= x3d_FogVisibilityRange)\n\t\treturn 0.0;\n\n\tif (x3d_FogType == x3d_LinearFog)\n\t\treturn (x3d_FogVisibilityRange - dV) / x3d_FogVisibilityRange;\n\n\tif (x3d_FogType == x3d_ExponentialFog)\n\t\treturn exp (-dV / (x3d_FogVisibilityRange - dV));\n\n\treturn 1.0;\n}\n\nvec4\ngetTextureColor ()\n{\n\tif (x3d_TextureType [0] == x3d_TextureType2D)\n\t{\n\t\tif (x3d_GeometryType == x3d_Geometry3D || gl_FrontFacing)\n\t\t\treturn texture2D (x3d_Texture2D [0], vec2 (t));\n\t\t\n\t\t// If dimension is x3d_Geometry2D the texCoords must be flipped.\n\t\treturn texture2D (x3d_Texture2D [0], vec2 (1.0 - t .s, t .t));\n\t}\n\n \tif (x3d_TextureType [0] == x3d_TextureTypeCubeMapTexture)\n\t{\n\t\tif (x3d_GeometryType == x3d_Geometry3D || gl_FrontFacing)\n\t\t\treturn textureCube (x3d_CubeMapTexture [0], vec3 (t));\n\t\t\n\t\t// If dimension is x3d_Geometry2D the texCoords must be flipped.\n\t\treturn textureCube (x3d_CubeMapTexture [0], vec3 (1.0 - t .s, t .t, t .z));\n\t}\n \n\treturn vec4 (1.0, 1.0, 1.0, 1.0);\n}\n\nvoid\nmain ()\n{\n \tclip ();\n\n\tfloat f0 = getFogInterpolant ();\n\n\tvec4 finalColor = gl_FrontFacing ? frontColor : backColor;\n\n\tif (x3d_TextureType [0] != x3d_NoneTexture)\n\t{\n\t\tif (x3d_Lighting)\n\t\t\tfinalColor *= getTextureColor ();\n\t\telse\n\t\t{\n\t\t\tif (x3d_ColorMaterial)\n\t\t\t\tfinalColor *= getTextureColor ();\n\t\t\telse\n\t\t\t\tfinalColor = getTextureColor ();\n\t\t}\n\t}\n\n\tgl_FragColor .rgb = mix (x3d_FogColor, finalColor .rgb, f0);\n\tgl_FragColor .a   = finalColor .a;\n}\n"}),define("text!cobweb/Browser/Shaders/Phong.vs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform mat4 x3d_TextureMatrix [x3d_MaxTextures];\nuniform mat3 x3d_NormalMatrix;\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\n\nuniform float x3d_LinewidthScaleFactor;\nuniform bool  x3d_Lighting;  // true if a X3DMaterialNode is attached, otherwise false\n\nattribute vec4 x3d_Color;\nattribute vec4 x3d_TexCoord;\nattribute vec3 x3d_Normal;\nattribute vec4 x3d_Vertex;\n\nvarying vec4 C;  // color\nvarying vec4 t;  // texCoord\nvarying vec3 vN; // normalized normal vector at this point on geometry\nvarying vec3 v;  // point on geometry\n\nvoid\nmain ()\n{\n\tgl_PointSize = x3d_LinewidthScaleFactor;\n\n\tvec4 p = x3d_ModelViewMatrix * x3d_Vertex;\n\n\tif (x3d_Lighting)\n\t\tvN = normalize (x3d_NormalMatrix * x3d_Normal);\n\n\tt = x3d_TextureMatrix [0] * x3d_TexCoord;\n\tC = x3d_Color;\n\tv = p .xyz;\n\n\tgl_Position = x3d_ProjectionMatrix * p;\n}\n"}),define("text!cobweb/Browser/Shaders/Phong.fs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform int x3d_GeometryType;\n\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nuniform int   x3d_FogType;\nuniform vec3  x3d_FogColor;\nuniform float x3d_FogVisibilityRange;\n\nuniform float x3d_LinewidthScaleFactor;\nuniform bool  x3d_Lighting;      // true if a X3DMaterialNode is attached, otherwise false\nuniform bool  x3d_ColorMaterial; // true if a X3DColorNode is attached, otherwise false\n\nuniform int   x3d_LightType [x3d_MaxLights];\nuniform bool  x3d_LightOn [x3d_MaxLights];\nuniform vec3  x3d_LightColor [x3d_MaxLights];\nuniform float x3d_LightIntensity [x3d_MaxLights];\nuniform float x3d_LightAmbientIntensity [x3d_MaxLights];\nuniform vec3  x3d_LightAttenuation [x3d_MaxLights];\nuniform vec3  x3d_LightLocation [x3d_MaxLights];\nuniform vec3  x3d_LightDirection [x3d_MaxLights];\nuniform float x3d_LightRadius [x3d_MaxLights];\nuniform float x3d_LightBeamWidth [x3d_MaxLights];\nuniform float x3d_LightCutOffAngle [x3d_MaxLights];\n\nuniform bool x3d_SeparateBackColor;\n\nuniform float x3d_AmbientIntensity;\nuniform vec3  x3d_DiffuseColor;\nuniform vec3  x3d_SpecularColor;\nuniform vec3  x3d_EmissiveColor;\nuniform float x3d_Shininess;\nuniform float x3d_Transparency;\n\nuniform float x3d_BackAmbientIntensity;\nuniform vec3  x3d_BackDiffuseColor;\nuniform vec3  x3d_BackSpecularColor;\nuniform vec3  x3d_BackEmissiveColor;\nuniform float x3d_BackShininess;\nuniform float x3d_BackTransparency;\n\nuniform int         x3d_TextureType [x3d_MaxTextures]; // true if a X3DTexture2DNode is attached, otherwise false\nuniform sampler2D   x3d_Texture2D [x3d_MaxTextures];\nuniform samplerCube x3d_CubeMapTexture [x3d_MaxTextures];\n\nvarying vec4 C;  // color\nvarying vec4 t;  // texCoord\nvarying vec3 vN; // normalized normal vector at this point on geometry\nvarying vec3 v;  // point on geometry\n\nvoid\nclip ()\n{\n\tfor (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n\t{\n\t\tif (x3d_ClipPlane [i] == x3d_NoneClipPlane)\n\t\t\tbreak;\n\n\t\tif (dot (v, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n\t\t\tdiscard;\n\t}\n}\n\nvec4\ngetTextureColor ()\n{\n\tif (x3d_TextureType [0] == x3d_TextureType2D)\n\t{\n\t\tif (x3d_GeometryType == x3d_Geometry3D || gl_FrontFacing)\n\t\t\treturn texture2D (x3d_Texture2D [0], vec2 (t));\n\t\t\n\t\t// If dimension is x3d_Geometry2D the texCoords must be flipped.\n\t\treturn texture2D (x3d_Texture2D [0], vec2 (1.0 - t .s, t .t));\n\t}\n\n\tif (x3d_TextureType [0] == x3d_TextureTypeCubeMapTexture)\n\t{\n\t\tif (x3d_GeometryType == x3d_Geometry3D || gl_FrontFacing)\n\t\t\treturn textureCube (x3d_CubeMapTexture [0], vec3 (t));\n\t\t\n\t\t// If dimension is x3d_Geometry2D the texCoords must be flipped.\n\t\treturn textureCube (x3d_CubeMapTexture [0], vec3 (1.0 - t .s, t .t, t .z));\n\t}\n\n\treturn vec4 (1.0, 1.0, 1.0, 1.0);\n}\n\nfloat\ngetSpotFactor (in float cutOffAngle, in float beamWidth, in vec3 L, in vec3 d)\n{\n\tfloat spotAngle = acos (clamp (dot (-L, d), -1.0, 1.0));\n\t\n\tif (spotAngle >= cutOffAngle)\n\t\treturn 0.0;\n\telse if (spotAngle <= beamWidth)\n\t\treturn 1.0;\n\n\treturn (spotAngle - cutOffAngle) / (beamWidth - cutOffAngle);\n}\n\nvec4\ngetMaterialColor ()\n{\n\tif (x3d_Lighting)\n\t{\n\t\tvec3  N  = normalize (gl_FrontFacing ? vN : -vN);\n\t\tvec3  V  = normalize (-v); // normalized vector from point on geometry to viewer's position\n\t\tfloat dV = length (v);\n\n\t\t// Calculate diffuseFactor & alpha\n\n\t\tbool frontColor = gl_FrontFacing || ! x3d_SeparateBackColor;\n\n\t\tfloat ambientIntensity = frontColor ? x3d_AmbientIntensity : x3d_BackAmbientIntensity;\n\t\tvec3  diffuseColor     = frontColor ? x3d_DiffuseColor     : x3d_BackDiffuseColor;\n\t\tvec3  specularColor    = frontColor ? x3d_SpecularColor    : x3d_BackSpecularColor;\n\t\tvec3  emissiveColor    = frontColor ? x3d_EmissiveColor    : x3d_BackEmissiveColor;\n\t\tfloat shininess        = frontColor ? x3d_Shininess        : x3d_BackShininess;\n\t\tfloat transparency     = frontColor ? x3d_Transparency     : x3d_BackTransparency;\n\n\t\tvec3  diffuseFactor = vec3 (1.0, 1.0, 1.0);\n\t\tfloat alpha         = 1.0 - transparency;\n\n\t\tif (x3d_ColorMaterial)\n\t\t{\n\t\t\tif (x3d_TextureType [0] != x3d_NoneTexture)\n\t\t\t{\n\t\t\t\tvec4 T = getTextureColor ();\n\n\t\t\t\tdiffuseFactor  = T .rgb * C .rgb;\n\t\t\t\talpha         *= T .a;\n\t\t\t}\n\t\t\telse\n\t\t\t\tdiffuseFactor = C .rgb;\n\n\t\t\talpha *= C .a;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (x3d_TextureType [0] != x3d_NoneTexture)\n\t\t\t{\n\t\t\t\tvec4 T = getTextureColor ();\n\n\t\t\t\tdiffuseFactor  = T .rgb * diffuseColor;\n\t\t\t\talpha         *= T .a;\n\t\t\t}\n\t\t\telse\n\t\t\t\tdiffuseFactor = diffuseColor;\n\t\t}\n\n\t\tvec3 ambientTerm = diffuseFactor * ambientIntensity;\n\n\t\t// Apply light sources\n\n\t\tvec3 finalColor = vec3 (0.0, 0.0, 0.0);\n\n\t\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n\t\t{\n\t\t\tint lightType = x3d_LightType [i];\n\n\t\t\tif (lightType == x3d_NoneLight)\n\t\t\t\tbreak;\n\n\t\t\tvec3  vL = x3d_LightLocation [i] - v;\n\t\t\tfloat dL = length (vL);\n\t\t\tbool  di = lightType == x3d_DirectionalLight;\n\n\t\t\tif (di || dL <= x3d_LightRadius [i])\n\t\t\t{\n\t\t\t\tvec3 d = x3d_LightDirection [i];\n\t\t\t\tvec3 c = x3d_LightAttenuation [i];\n\t\t\t\tvec3 L = di ? -d : normalize (vL);      // Normalized vector from point on geometry to light source i position.\n\t\t\t\tvec3 H = normalize (L + V);             // Specular term\n\n\t\t\t\tfloat lightAngle     = dot (N, L);      // Angle between normal and light ray.\n\t\t\t\tvec3  diffuseTerm    = diffuseFactor * clamp (lightAngle, 0.0, 1.0);\n\t\t\t\tfloat specularFactor = shininess > 0.0 ? pow (max (dot (N, H), 0.0), shininess * 128.0) : 1.0;\n\t\t\t\tvec3  specularTerm   = specularColor * specularFactor;\n\n\t\t\t\tfloat attenuationFactor           = di ? 1.0 : 1.0 / max (c [0] + c [1] * dL + c [2] * (dL * dL), 1.0);\n\t\t\t\tfloat spotFactor                  = lightType == x3d_SpotLight ? getSpotFactor (x3d_LightCutOffAngle [i], x3d_LightBeamWidth [i], L, d) : 1.0;\n\t\t\t\tfloat attenuationSpotFactor       = attenuationFactor * spotFactor;\n\t\t\t\tvec3  ambientColor                = x3d_LightAmbientIntensity [i] * ambientTerm;\n\t\t\t\tvec3  ambientDiffuseSpecularColor = ambientColor + x3d_LightIntensity [i] * (diffuseTerm + specularTerm);\n\n\t\t\t\tfinalColor += attenuationSpotFactor * (x3d_LightColor [i] * ambientDiffuseSpecularColor);\n\t\t\t}\n\t\t}\n\n\t\tfinalColor += emissiveColor;\n\n\t\treturn vec4 (finalColor, alpha);\n\t}\n\telse\n\t{\n\t\tvec4 finalColor = vec4 (1.0, 1.0, 1.0, 1.0);\n\t\n\t\tif (x3d_ColorMaterial)\n\t\t{\n\t\t\tif (x3d_TextureType [0] != x3d_NoneTexture)\n\t\t\t{\n\t\t\t\tvec4 T = getTextureColor ();\n\n\t\t\t\tfinalColor = T * C;\n\t\t\t}\n\t\t\telse\n\t\t\t\tfinalColor = C;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (x3d_TextureType [0] != x3d_NoneTexture)\n\t\t\t\tfinalColor = getTextureColor ();\n\t\t}\n\n\t\treturn finalColor;\n\t}\n}\n\nvec3\ngetFogColor (in vec3 color)\n{\n\tif (x3d_FogType == x3d_NoneFog)\n\t\treturn color;\n\n\tfloat dV = length (v);\n\n\tif (dV >= x3d_FogVisibilityRange)\n\t\treturn x3d_FogColor;\n\n\tif (x3d_FogType == x3d_LinearFog)\n\t\treturn mix (x3d_FogColor, color, (x3d_FogVisibilityRange - dV) / x3d_FogVisibilityRange);\n\n\tif (x3d_FogType == x3d_ExponentialFog)\n\t\treturn mix (x3d_FogColor, color, exp (-dV / (x3d_FogVisibilityRange - dV)));\n\n\treturn color;\n}\n\nvoid\nmain ()\n{\n\tclip ();\n\n\tgl_FragColor = getMaterialColor ();\n\n\tgl_FragColor .rgb = getFogColor (gl_FragColor .rgb);\n}\n"}),define("text!cobweb/Browser/Shaders/Depth.vs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\n\nattribute vec4 x3d_Vertex;\n\nvarying vec3 v; // point on geometry\n\nvoid\nmain ()\n{\n\tvec4 p = x3d_ModelViewMatrix * x3d_Vertex;\n\n\tv = p .xyz;\n\n\tgl_Position = x3d_ProjectionMatrix * p;\n}\n"}),define("text!cobweb/Browser/Shaders/Depth.fs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nvarying vec3 v; // point on geometry\n\nvoid\nclip ()\n{\n\tfor (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n\t{\n\t\tif (x3d_ClipPlane [i] == x3d_NoneClipPlane)\n\t\t\tbreak;\n\n\t\tif (dot (v, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n\t\t\tdiscard;\n\t}\n}\n\nvec4\npack (in float f)\n{\n\tvec4 color;\n\n\tf *= 255.0;\n\tcolor .r = floor (f);\n\n\tf -= color .r;\n\tf *= 255.0;\n\tcolor .g = floor (f);\n\n\tf -= color .g;\n\tf *= 255.0;\n\tcolor .b = floor (f);\n\n\tf -= color .b;\n\tf *= 255.0;\n\tcolor .a = floor (f);\n\n\treturn color / 255.0;\n}\n\nvoid\nmain ()\n{\n\tclip ();\n\n\tgl_FragColor = pack (gl_FragCoord .z);\n}\n"}),define("cobweb/Browser/Rendering/X3DRenderingContext",["cobweb/Fields","cobweb/Components/Shaders/ComposedShader","cobweb/Components/Shaders/ShaderPart","text!cobweb/Browser/Shaders/PointSet.fs","text!cobweb/Browser/Shaders/Wireframe.vs","text!cobweb/Browser/Shaders/Wireframe.fs","text!cobweb/Browser/Shaders/Gouraud.vs","text!cobweb/Browser/Shaders/Gouraud.fs","text!cobweb/Browser/Shaders/Phong.vs","text!cobweb/Browser/Shaders/Phong.fs","text!cobweb/Browser/Shaders/Depth.vs","text!cobweb/Browser/Shaders/Depth.fs","standard/Math/Numbers/Vector4"],function(e,t,n,i,r,o,s,a,u,l,c,h,d){function p(){this.addChildObjects("viewport",new e.MFInt32(0,0,300,150)),this.clipPlanes=[]}return p.prototype={initialize:function(){var e=this.getContext();e.enable(e.SCISSOR_TEST),e.cullFace(e.BACK),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clearDepth(1),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.enable(e.BLEND),$(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",this.onfullscreen.bind(this)),setInterval(this.reshape.bind(this),401),this.reshape(),this.depthShader=this.createShader(this,"DepthShader",c,h),this.pointShader=this.createShader(this,"PointShader",r,i),this.lineShader=this.createShader(this,"WireframeShader",r,o),this.pointShader.setGeometryType(0),this.lineShader.setGeometryType(1),this.setShading("GOURAUD")},getVendor:function(){return this.getContext().getParameter(this.getContext().VENDOR)},getWebGLVersion:function(){return this.getContext().getParameter(this.getContext().VERSION)},getAntialiased:function(){return this.getContext().getParameter(this.getContext().SAMPLES)>0},getMaxClipPlanes:function(){return 6},getDepthSize:function(){var e=this.context;return e.getParameter(e.DEPTH_BITS)},getColorDepth:function(){var e=this.context,t=0;return t+=e.getParameter(e.RED_BITS),t+=e.getParameter(e.BLUE_BITS),t+=e.getParameter(e.GREEN_BITS),t+=e.getParameter(e.ALPHA_BITS)},getViewport:function(){return this.viewport_},createShader:function(e,i,r,o){var s=new n(e.getPrivateScene());s.url_.push(r),s.setup();var a=new n(e.getPrivateScene());a.type_="FRAGMENT",a.url_.push(o),a.setup();var u=new t(e.getPrivateScene());return u.setName(i),u.language_="GLSL",u.parts_.push(s),u.parts_.push(a),u.setCustom(!1),u.setup(),this.getLoadSensor().watchList_.push(s),this.getLoadSensor().watchList_.push(a),u},setShading:function(e){this.context;switch(e){case"PHONG":this.phongShader||(this.phongShader=this.createShader(this,"PhongShader",u,l)),this.defaultShader=this.phongShader;break;default:this.gouraudShader||(this.gouraudShader=this.createShader(this,"GouraudShader",s,a)),this.defaultShader=this.gouraudShader}this.pointShader.setGeometryType(0),this.lineShader.setGeometryType(1),this.defaultShader.setGeometryType(3);var t=this.getShaders();for(var n in t)t[n].setShading(e)},getDefaultShader:function(){return this.defaultShader},getPointShader:function(){return this.pointShader},getLineShader:function(){return this.lineShader},getGouraudShader:function(){return this.gouraudShader},getDepthShader:function(){return this.depthShader},getClipPlanes:function(){return this.clipPlanes},reshape:function(){var e=this.canvas,t=e.width(),n=e.height();t===(e=e[0]).width&&n===e.height||(this.viewport_.setValue([0,0,t,n]),this.context.viewport(0,0,t,n),this.context.scissor(0,0,t,n),e.width=t,e.height=n,this.addBrowserEvent())},onfullscreen:function(){this.getElement().fullScreen()?this.getElement().addClass("cobweb-fullscreen"):this.getElement().removeClass("cobweb-fullscreen")}},p}),define("cobweb/Browser/Geometry2D/Arc2DOptions",["jquery","cobweb/Basic/X3DBaseNode","cobweb/Fields"],function(e,t,n){function i(e){t.call(this,e),this.addChildObjects("dimension",new n.SFInt32(32))}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,getTypeName:function(){return"ArcClose2DOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"arcClose2DOptions"}}),i}),define("cobweb/Browser/Geometry2D/ArcClose2DOptions",["jquery","cobweb/Basic/X3DBaseNode","cobweb/Fields"],function(e,t,n){function i(e){t.call(this,e),this.addChildObjects("dimension",new n.SFInt32(32))}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,getTypeName:function(){return"Arc2DOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"arc2DOptions"}}),i}),define("standard/Math/Numbers/Complex",["jquery"],function(e){function t(e,t){this.real=e,this.imag=t}return t.prototype={constructor:t,copy:function(){var e=Object.create(t.prototype);return e.real=this.real,e.imag=this.imag,e},assign:function(e){return this.real=e.real,this.imag=e.imag,this},equals:function(e){return this.real===e.real&&this.imag===e.imag},setRadius:function(e){return this.setPolar(e,this.getAngle())},getRadius:function(){return this.real?this.imag?Math.sqrt(this.real*this.real+this.imag*this.imag):Math.abs(this.real):Math.abs(this.imag)},setAngle:function(e){return this.setPolar(this.getRadius(),e)},getAngle:function(){return Math.atan2(this.imag,this.real)},setPolar:function(e,t){this.real=e*Math.cos(t),this.imag=e*Math.sin(t)},conjugate:function(){return this.imag=-this.imag,this},negate:function(){return this.real=-this.real,this.imag=-this.imag,this},inverse:function(){var e=this.real*this.real+this.imag*this.imag;return this.real/=e,this.imag/=-e,this},add:function(e){return this.real+=e.real,this.imag+=e.imag,this},subtract:function(e){return this.real-=e.real,this.imag-=e.imag,this},multiply:function(e){return this.real*=e,this.imag*=e,this},multComp:function(){var e=this.real,t=this.imag;return this.real=e*value.real-t*value.imag,this.imag=e*value.imag+t*value.real,this},divComp:function(e){var t=this.real,n=this.imag,i=e.real,r=e.imag,o=i*i+r*r;return this.real=(t*i+n*r)/o,this.imag=(n*i-t*r)/o,this},toString:function(){return this.imag?this.real+" "+this.imag+"i":String(this.real)}},e.extend(t,{Polar:function(e,n){var i=Object.create(t.prototype);return i.real=e*Math.cos(n),i.imag=e*Math.sin(n),i},multiply:function(e,t){var n=Object.create(this.prototype);return n.real=e.real*t,n.imag=e.imag*t,n},multComp:function(e,t){var n=Object.create(this.prototype);return n.real=e.real*t.real-lsh.imag*t.imag,n.imag=e.real*t.imag+lsh.imag*t.real,n}}),t}),define("cobweb/Browser/Geometry2D/Circle2DOptions",["jquery","cobweb/Basic/X3DBaseNode","cobweb/Fields","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector3"],function(e,t,n,i,r){function o(e){t.call(this,e),this.addChildObjects("dimension",new n.SFInt32(40)),this.vertices=[]}return o.prototype=e.extend(Object.create(t.prototype),{constructor:o,getTypeName:function(){return"Circle2DOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"circle2DOptions"},initialize:function(){this.addInterest("build",this),this.build()},getVertices:function(){return this.vertices},build:function(){var e=this.dimension_.getValue(),t=2*Math.PI/e;this.vertices.length=0;for(var n=0;n<e;++n){var r=i.Polar(1,t*n);this.vertices.push(r.real,r.imag,0,1)}}}),o}),define("cobweb/Browser/Geometry2D/Disk2DOptions",["jquery","cobweb/Basic/X3DBaseNode","cobweb/Fields","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector3"],function(e,t,n,i,r){function o(e){t.call(this,e),this.addChildObjects("dimension",new n.SFInt32(40)),this.circleVertices=[],this.diskTexCoords=[],this.diskNormals=[],this.diskVertices=[]}var s=new i(.5,.5);return o.prototype=e.extend(Object.create(t.prototype),{constructor:o,getTypeName:function(){return"Disk2DOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"circle2DOptions"},initialize:function(){this.addInterest("build",this),this.build()},getCircleVertices:function(){return this.circleVertices},getDiskTexCoords:function(){return this.diskTexCoords},getDiskNormals:function(){return this.diskNormals},getDiskVertices:function(){return this.diskVertices},build:function(){var e=this.dimension_.getValue(),t=2*Math.PI/e;this.circleVertices.length=0,this.diskTexCoords.length=0,this.diskNormals.length=0,this.diskVertices.length=0;for(var n=0;n<e;++n){var r=t*n,o=t*(n+1),a=i.Polar(.5,r).add(s),u=i.Polar(.5,o).add(s),l=i.Polar(1,r),c=i.Polar(1,o);this.circleVertices.push(l.real,l.imag,0,1),this.diskTexCoords.push(.5,.5,0,1,a.real,a.imag,0,1,u.real,u.imag,0,1),this.diskNormals.push(0,0,1,0,0,1,0,0,1),this.diskVertices.push(0,0,0,1,l.real,l.imag,0,1,c.real,c.imag,0,1)}}}),o}),function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define("lib/poly2tri.js/dist/poly2tri.js",e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.poly2tri=e()}}(function(){return function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return r(n||e)},l,l.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,t,n){t.exports={version:"1.3.5"}},{}],2:[function(e,t,n){var i=function(e,t){this.point=e,this.triangle=t||null,this.next=null,this.prev=null,this.value=e.x},r=function(e,t){this.head_=e,this.tail_=t,this.search_node_=e};r.prototype.head=function(){return this.head_},r.prototype.setHead=function(e){this.head_=e},r.prototype.tail=function(){return this.tail_},r.prototype.setTail=function(e){this.tail_=e},r.prototype.search=function(){return this.search_node_},r.prototype.setSearch=function(e){this.search_node_=e},r.prototype.findSearchNode=function(){return this.search_node_},r.prototype.locateNode=function(e){var t=this.search_node_;if(e<t.value){for(;t=t.prev;)if(e>=t.value)return this.search_node_=t,t}else for(;t=t.next;)if(e<t.value)return this.search_node_=t.prev,t.prev;return null},r.prototype.locatePoint=function(e){var t=e.x,n=this.findSearchNode(t),i=n.point.x;if(t===i){if(e!==n.point)if(e===n.prev.point)n=n.prev;else{if(e!==n.next.point)throw new Error("poly2tri Invalid AdvancingFront.locatePoint() call");n=n.next}}else if(t<i)for(;(n=n.prev)&&e!==n.point;);else for(;(n=n.next)&&e!==n.point;);return n&&(this.search_node_=n),n},t.exports=r,t.exports.Node=i},{}],3:[function(e,t,n){function i(e,t){if(!e)throw new Error(t||"Assert Failed")}t.exports=i},{}],4:[function(e,t,n){var i=e("./xy"),r=function(e,t){this.x=+e||0,this.y=+t||0,this._p2t_edge_list=null};r.prototype.toString=function(){return i.toStringBase(this)},r.prototype.toJSON=function(){return{x:this.x,y:this.y}},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set_zero=function(){return this.x=0,this.y=0,this},r.prototype.set=function(e,t){return this.x=+e||0,this.y=+t||0,this},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},r.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},r.prototype.mul=function(e){return this.x*=e,this.y*=e,this},r.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.normalize=function(){var e=this.length();return this.x/=e,this.y/=e,e},r.prototype.equals=function(e){return this.x===e.x&&this.y===e.y},r.negate=function(e){return new r(-e.x,-e.y)},r.add=function(e,t){return new r(e.x+t.x,e.y+t.y)},r.sub=function(e,t){return new r(e.x-t.x,e.y-t.y)},r.mul=function(e,t){return new r(e*t.x,e*t.y)},r.cross=function(e,t){return"number"==typeof e?"number"==typeof t?e*t:new r(-e*t.y,e*t.x):"number"==typeof t?new r(t*e.y,-t*e.x):e.x*t.y-e.y*t.x},r.toString=i.toString,r.compare=i.compare,r.cmp=i.compare,r.equals=i.equals,r.dot=function(e,t){return e.x*t.x+e.y*t.y},t.exports=r},{"./xy":11}],5:[function(e,t,n){var i=e("./xy"),r=function(e,t){this.name="PointError",this.points=t=t||[],this.message=e||"Invalid Points!";for(var n=0;n<t.length;n++)this.message+=" "+i.toString(t[n])};(r.prototype=new Error).constructor=r,t.exports=r},{"./xy":11}],6:[function(e,t,n){(function(t){var i=t.poly2tri;n.noConflict=function(){return t.poly2tri=i,n},n.VERSION=e("../dist/version.json").version,n.PointError=e("./pointerror"),n.Point=e("./point"),n.Triangle=e("./triangle"),n.SweepContext=e("./sweepcontext");var r=e("./sweep");n.triangulate=r.triangulate,n.sweep={Triangulate:r.triangulate}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dist/version.json":1,"./point":4,"./pointerror":5,"./sweep":7,"./sweepcontext":8,"./triangle":9}],7:[function(e,t,n){function i(e){e.initTriangulation(),e.createAdvancingFront(),r(e),o(e)}function r(e){var t,n=e.pointCount();for(t=1;t<n;++t)for(var i=e.getPoint(t),r=s(e,i),o=i._p2t_edge_list,u=0;o&&u<o.length;++u)a(e,o[u],r)}function o(e){for(var t=e.front().head().next.triangle,n=e.front().head().next.point;!t.getConstrainedEdgeCW(n);)t=t.neighborCCW(n);e.meshClean(t)}function s(e,t){var n=e.locateNode(t),i=c(e,t,n);return t.x<=n.point.x+R&&h(e,n),d(e,i),i}function a(e,t,n){e.edge_event.constrained_edge=t,e.edge_event.right=t.p.x>t.q.x,l(n.triangle,t.p,t.q)||(x(e,t,n),u(e,t.p,t.q,n.triangle,t.q))}function u(e,t,n,i,r){if(!l(i,t,n)){var o=i.pointCCW(r),s=z(n,o,t);if(s===k.COLLINEAR)throw new E("poly2tri EdgeEvent: Collinear not supported!",[n,o,t]);var a=i.pointCW(r),c=z(n,a,t);if(c===k.COLLINEAR)throw new E("poly2tri EdgeEvent: Collinear not supported!",[n,a,t]);s===c?u(e,t,n,i=s===k.CW?i.neighborCCW(r):i.neighborCW(r),r):M(e,t,n,i,r)}}function l(e,t,n){var i=e.edgeIndex(t,n);if(-1!==i){e.markConstrainedEdgeByIndex(i);var r=e.getNeighbor(i);return r&&r.markConstrainedEdgeByPoints(t,n),!0}return!1}function c(e,t,n){var i=new A(t,n.point,n.next.point);i.markNeighbor(n.triangle),e.addToMap(i);var r=new P(t);return r.next=n.next,r.prev=n,n.next.prev=r,n.next=r,f(e,i)||e.mapTriangleToNodes(i),r}function h(e,t){var n=new A(t.prev.point,t.point,t.next.point);n.markNeighbor(t.prev.triangle),n.markNeighbor(t.triangle),e.addToMap(n),t.prev.next=t.next,t.next.prev=t.prev,f(e,n)||e.mapTriangleToNodes(n)}function d(e,t){for(var n=t.next;n.next&&!X(n.point,n.next.point,n.prev.point);)h(e,n),n=n.next;for(n=t.prev;n.prev&&!X(n.point,n.next.point,n.prev.point);)h(e,n),n=n.prev;t.next&&t.next.next&&p(t)&&b(e,t)}function p(e){var t=e.point.x-e.next.next.point.x,n=e.point.y-e.next.next.point.y;return B(n>=0,"unordered y"),t>=0||Math.abs(t)<n}function f(e,t){for(var n=0;n<3;++n)if(!t.delaunay_edge[n]){var i=t.getNeighbor(n);if(i){var r=t.getPoint(n),o=i.oppositePoint(t,r),s=i.index(o);if(i.constrained_edge[s]||i.delaunay_edge[s]){t.constrained_edge[n]=i.constrained_edge[s];continue}if(g(r,t.pointCCW(r),t.pointCW(r),o)){t.delaunay_edge[n]=!0,i.delaunay_edge[s]=!0,m(t,r,i,o);var a=!f(e,t);return a&&e.mapTriangleToNodes(t),(a=!f(e,i))&&e.mapTriangleToNodes(i),t.delaunay_edge[n]=!1,i.delaunay_edge[s]=!1,!0}}}return!1}function g(e,t,n,i){var r=e.x-i.x,o=e.y-i.y,s=t.x-i.x,a=t.y-i.y,u=r*a-s*o;if(u<=0)return!1;var l=n.x-i.x,c=n.y-i.y,h=l*o-r*c;return!(h<=0)&&(r*r+o*o)*(s*c-l*a)+(s*s+a*a)*h+(l*l+c*c)*u>0}function m(e,t,n,i){var r,o,s,a;r=e.neighborCCW(t),o=e.neighborCW(t),s=n.neighborCCW(i),a=n.neighborCW(i);var u,l,c,h;u=e.getConstrainedEdgeCCW(t),l=e.getConstrainedEdgeCW(t),c=n.getConstrainedEdgeCCW(i),h=n.getConstrainedEdgeCW(i);var d,p,f,g;d=e.getDelaunayEdgeCCW(t),p=e.getDelaunayEdgeCW(t),f=n.getDelaunayEdgeCCW(i),g=n.getDelaunayEdgeCW(i),e.legalize(t,i),n.legalize(i,t),n.setDelaunayEdgeCCW(t,d),e.setDelaunayEdgeCW(t,p),e.setDelaunayEdgeCCW(i,f),n.setDelaunayEdgeCW(i,g),n.setConstrainedEdgeCCW(t,u),e.setConstrainedEdgeCW(t,l),e.setConstrainedEdgeCCW(i,c),n.setConstrainedEdgeCW(i,h),e.clearNeighbors(),n.clearNeighbors(),r&&n.markNeighbor(r),o&&e.markNeighbor(o),s&&e.markNeighbor(s),a&&n.markNeighbor(a),e.markNeighbor(n)}function b(e,t){for(z(t.point,t.next.point,t.next.next.point)===k.CCW?e.basin.left_node=t.next.next:e.basin.left_node=t.next,e.basin.bottom_node=e.basin.left_node;e.basin.bottom_node.next&&e.basin.bottom_node.point.y>=e.basin.bottom_node.next.point.y;)e.basin.bottom_node=e.basin.bottom_node.next;if(e.basin.bottom_node!==e.basin.left_node){for(e.basin.right_node=e.basin.bottom_node;e.basin.right_node.next&&e.basin.right_node.point.y<e.basin.right_node.next.point.y;)e.basin.right_node=e.basin.right_node.next;e.basin.right_node!==e.basin.bottom_node&&(e.basin.width=e.basin.right_node.point.x-e.basin.left_node.point.x,e.basin.left_highest=e.basin.left_node.point.y>e.basin.right_node.point.y,w(e,e.basin.bottom_node))}}function w(e,t){if(!y(e,t)){h(e,t);if(t.prev!==e.basin.left_node||t.next!==e.basin.right_node){if(t.prev===e.basin.left_node){if(z(t.point,t.next.point,t.next.next.point)===k.CW)return;t=t.next}else if(t.next===e.basin.right_node){if(z(t.point,t.prev.point,t.prev.prev.point)===k.CCW)return;t=t.prev}else t=t.prev.point.y<t.next.point.y?t.prev:t.next;w(e,t)}}}function y(e,t){var n;return n=e.basin.left_highest?e.basin.left_node.point.y-t.point.y:e.basin.right_node.point.y-t.point.y,e.basin.width>n}function x(e,t,n){e.edge_event.right?v(e,t,n):F(e,t,n)}function v(e,t,n){for(;n.next.point.x<t.p.x;)z(t.q,n.next.point,t.p)===k.CCW?_(e,t,n):n=n.next}function _(e,t,n){n.point.x<t.p.x&&(z(n.point,n.next.point,n.next.next.point)===k.CCW?S(e,t,n):(C(e,t,n),_(e,t,n)))}function S(e,t,n){h(e,n.next),n.next.point!==t.p&&z(t.q,n.next.point,t.p)===k.CCW&&z(n.point,n.next.point,n.next.next.point)===k.CCW&&S(e,t,n)}function C(e,t,n){z(n.next.point,n.next.next.point,n.next.next.next.point)===k.CCW?S(e,t,n.next):z(t.q,n.next.next.point,t.p)===k.CCW&&C(e,t,n.next)}function F(e,t,n){for(;n.prev.point.x>t.p.x;)z(t.q,n.prev.point,t.p)===k.CW?T(e,t,n):n=n.prev}function T(e,t,n){n.point.x>t.p.x&&(z(n.point,n.prev.point,n.prev.prev.point)===k.CW?O(e,t,n):(N(e,t,n),T(e,t,n)))}function N(e,t,n){z(n.prev.point,n.prev.prev.point,n.prev.prev.prev.point)===k.CW?O(e,t,n.prev):z(t.q,n.prev.prev.point,t.p)===k.CW&&N(e,t,n.prev)}function O(e,t,n){h(e,n.prev),n.prev.point!==t.p&&z(t.q,n.prev.point,t.p)===k.CW&&z(n.point,n.prev.point,n.prev.prev.point)===k.CW&&O(e,t,n)}function M(e,t,n,i,r){var o=i.neighborAcross(r);B(o,"FLIP failed due to missing triangle!");var s=o.oppositePoint(i,r);if(i.getConstrainedEdgeAcross(r)){var a=i.index(r);throw new E("poly2tri Intersecting Constraints",[r,s,i.getPoint((a+1)%3),i.getPoint((a+2)%3)])}j(r,i.pointCCW(r),i.pointCW(r),s)?(m(i,r,o,s),e.mapTriangleToNodes(i),e.mapTriangleToNodes(o),r===n&&s===t?n===e.edge_event.constrained_edge.q&&t===e.edge_event.constrained_edge.p&&(i.markConstrainedEdgeByPoints(t,n),o.markConstrainedEdgeByPoints(t,n),f(e,i),f(e,o)):M(e,t,n,i=V(e,z(n,s,t),i,o,r,s),r)):(I(e,t,n,i,o,D(t,n,o,s)),u(e,t,n,i,r))}function V(e,t,n,i,r,o){var s;return t===k.CCW?(s=i.edgeIndex(r,o),i.delaunay_edge[s]=!0,f(e,i),i.clearDelaunayEdges(),n):(s=n.edgeIndex(r,o),n.delaunay_edge[s]=!0,f(e,n),n.clearDelaunayEdges(),i)}function D(e,t,n,i){var r=z(t,i,e);if(r===k.CW)return n.pointCCW(i);if(r===k.CCW)return n.pointCW(i);throw new E("poly2tri [Unsupported] nextFlipPoint: opposing point on constrained edge!",[t,i,e])}function I(e,t,n,i,r,o){var s=r.neighborAcross(o);B(s,"FLIP failed due to missing triangle");var a=s.oppositePoint(r,o);j(n,i.pointCCW(n),i.pointCW(n),a)?M(e,n,a,s,a):I(e,t,n,i,s,D(t,n,s,a))}var B=e("./assert"),E=e("./pointerror"),A=e("./triangle"),P=e("./advancingfront").Node,L=e("./utils"),R=L.EPSILON,k=L.Orientation,z=L.orient2d,j=L.inScanArea,X=L.isAngleObtuse;n.triangulate=i},{"./advancingfront":2,"./assert":3,"./pointerror":5,"./triangle":9,"./utils":10}],8:[function(e,t,n){var i=e("./pointerror"),r=e("./point"),o=e("./triangle"),s=e("./sweep"),a=e("./advancingfront"),u=a.Node,l=function(e,t){if(this.p=e,this.q=t,e.y>t.y)this.q=e,this.p=t;else if(e.y===t.y)if(e.x>t.x)this.q=e,this.p=t;else if(e.x===t.x)throw new i("poly2tri Invalid Edge constructor: repeated points!",[e]);this.q._p2t_edge_list||(this.q._p2t_edge_list=[]),this.q._p2t_edge_list.push(this)},c=function(){this.left_node=null,this.bottom_node=null,this.right_node=null,this.width=0,this.left_highest=!1};c.prototype.clear=function(){this.left_node=null,this.bottom_node=null,this.right_node=null,this.width=0,this.left_highest=!1};var h=function(){this.constrained_edge=null,this.right=!1},d=function(e,t){t=t||{},this.triangles_=[],this.map_=[],this.points_=t.cloneArrays?e.slice(0):e,this.edge_list=[],this.pmin_=this.pmax_=null,this.front_=null,this.head_=null,this.tail_=null,this.af_head_=null,this.af_middle_=null,this.af_tail_=null,this.basin=new c,this.edge_event=new h,this.initEdges(this.points_)};d.prototype.addHole=function(e){this.initEdges(e);var t,n=e.length;for(t=0;t<n;t++)this.points_.push(e[t]);return this},d.prototype.AddHole=d.prototype.addHole,d.prototype.addHoles=function(e){var t,n=e.length;for(t=0;t<n;t++)this.initEdges(e[t]);return this.points_=this.points_.concat.apply(this.points_,e),this},d.prototype.addPoint=function(e){return this.points_.push(e),this},d.prototype.AddPoint=d.prototype.addPoint,d.prototype.addPoints=function(e){return this.points_=this.points_.concat(e),this},d.prototype.triangulate=function(){return s.triangulate(this),this},d.prototype.getBoundingBox=function(){return{min:this.pmin_,max:this.pmax_}},d.prototype.getTriangles=function(){return this.triangles_},d.prototype.GetTriangles=d.prototype.getTriangles,d.prototype.front=function(){return this.front_},d.prototype.pointCount=function(){return this.points_.length},d.prototype.head=function(){return this.head_},d.prototype.setHead=function(e){this.head_=e},d.prototype.tail=function(){return this.tail_},d.prototype.setTail=function(e){this.tail_=e},d.prototype.getMap=function(){return this.map_},d.prototype.initTriangulation=function(){var e,t=this.points_[0].x,n=this.points_[0].x,i=this.points_[0].y,o=this.points_[0].y,s=this.points_.length;for(e=1;e<s;e++){var a=this.points_[e];a.x>t&&(t=a.x),a.x<n&&(n=a.x),a.y>i&&(i=a.y),a.y<o&&(o=a.y)}this.pmin_=new r(n,o),this.pmax_=new r(t,i);var u=.3*(t-n),l=.3*(i-o);this.head_=new r(t+u,o-l),this.tail_=new r(n-u,o-l),this.points_.sort(r.compare)},d.prototype.initEdges=function(e){var t,n=e.length;for(t=0;t<n;++t)this.edge_list.push(new l(e[t],e[(t+1)%n]))},d.prototype.getPoint=function(e){return this.points_[e]},d.prototype.addToMap=function(e){this.map_.push(e)},d.prototype.locateNode=function(e){return this.front_.locateNode(e.x)},d.prototype.createAdvancingFront=function(){var e,t,n,i=new o(this.points_[0],this.tail_,this.head_);this.map_.push(i),e=new u(i.getPoint(1),i),t=new u(i.getPoint(0),i),n=new u(i.getPoint(2)),this.front_=new a(e,n),e.next=t,t.next=n,t.prev=e,n.prev=t},d.prototype.removeNode=function(e){},d.prototype.mapTriangleToNodes=function(e){for(var t=0;t<3;++t)if(!e.getNeighbor(t)){var n=this.front_.locatePoint(e.pointCW(e.getPoint(t)));n&&(n.triangle=e)}},d.prototype.removeFromMap=function(e){var t,n=this.map_,i=n.length;for(t=0;t<i;t++)if(n[t]===e){n.splice(t,1);break}},d.prototype.meshClean=function(e){for(var t,n,i=[e];t=i.pop();)if(!t.isInterior())for(t.setInterior(!0),this.triangles_.push(t),n=0;n<3;n++)t.constrained_edge[n]||i.push(t.getNeighbor(n))},t.exports=d},{"./advancingfront":2,"./point":4,"./pointerror":5,"./sweep":7,"./triangle":9}],9:[function(e,t,n){var i=function(e,t,n){this.points_=[e,t,n],this.neighbors_=[null,null,null],this.interior_=!1,this.constrained_edge=[!1,!1,!1],this.delaunay_edge=[!1,!1,!1]},r=e("./xy").toString;i.prototype.toString=function(){return"["+r(this.points_[0])+r(this.points_[1])+r(this.points_[2])+"]"},i.prototype.getPoint=function(e){return this.points_[e]},i.prototype.GetPoint=i.prototype.getPoint,i.prototype.getPoints=function(){return this.points_},i.prototype.getNeighbor=function(e){return this.neighbors_[e]},i.prototype.containsPoint=function(e){var t=this.points_;return e===t[0]||e===t[1]||e===t[2]},i.prototype.containsEdge=function(e){return this.containsPoint(e.p)&&this.containsPoint(e.q)},i.prototype.containsPoints=function(e,t){return this.containsPoint(e)&&this.containsPoint(t)},i.prototype.isInterior=function(){return this.interior_},i.prototype.setInterior=function(e){return this.interior_=e,this},i.prototype.markNeighborPointers=function(e,t,n){var i=this.points_;if(e===i[2]&&t===i[1]||e===i[1]&&t===i[2])this.neighbors_[0]=n;else if(e===i[0]&&t===i[2]||e===i[2]&&t===i[0])this.neighbors_[1]=n;else{if(!(e===i[0]&&t===i[1]||e===i[1]&&t===i[0]))throw new Error("poly2tri Invalid Triangle.markNeighborPointers() call");this.neighbors_[2]=n}},i.prototype.markNeighbor=function(e){var t=this.points_;e.containsPoints(t[1],t[2])?(this.neighbors_[0]=e,e.markNeighborPointers(t[1],t[2],this)):e.containsPoints(t[0],t[2])?(this.neighbors_[1]=e,e.markNeighborPointers(t[0],t[2],this)):e.containsPoints(t[0],t[1])&&(this.neighbors_[2]=e,e.markNeighborPointers(t[0],t[1],this))},i.prototype.clearNeighbors=function(){this.neighbors_[0]=null,this.neighbors_[1]=null,this.neighbors_[2]=null},i.prototype.clearDelaunayEdges=function(){this.delaunay_edge[0]=!1,this.delaunay_edge[1]=!1,this.delaunay_edge[2]=!1},i.prototype.pointCW=function(e){var t=this.points_;return e===t[0]?t[2]:e===t[1]?t[0]:e===t[2]?t[1]:null},i.prototype.pointCCW=function(e){var t=this.points_;return e===t[0]?t[1]:e===t[1]?t[2]:e===t[2]?t[0]:null},i.prototype.neighborCW=function(e){return e===this.points_[0]?this.neighbors_[1]:e===this.points_[1]?this.neighbors_[2]:this.neighbors_[0]},i.prototype.neighborCCW=function(e){return e===this.points_[0]?this.neighbors_[2]:e===this.points_[1]?this.neighbors_[0]:this.neighbors_[1]},i.prototype.getConstrainedEdgeCW=function(e){return e===this.points_[0]?this.constrained_edge[1]:e===this.points_[1]?this.constrained_edge[2]:this.constrained_edge[0]},i.prototype.getConstrainedEdgeCCW=function(e){return e===this.points_[0]?this.constrained_edge[2]:e===this.points_[1]?this.constrained_edge[0]:this.constrained_edge[1]},i.prototype.getConstrainedEdgeAcross=function(e){return e===this.points_[0]?this.constrained_edge[0]:e===this.points_[1]?this.constrained_edge[1]:this.constrained_edge[2]},i.prototype.setConstrainedEdgeCW=function(e,t){e===this.points_[0]?this.constrained_edge[1]=t:e===this.points_[1]?this.constrained_edge[2]=t:this.constrained_edge[0]=t},i.prototype.setConstrainedEdgeCCW=function(e,t){e===this.points_[0]?this.constrained_edge[2]=t:e===this.points_[1]?this.constrained_edge[0]=t:this.constrained_edge[1]=t},i.prototype.getDelaunayEdgeCW=function(e){return e===this.points_[0]?this.delaunay_edge[1]:e===this.points_[1]?this.delaunay_edge[2]:this.delaunay_edge[0]},i.prototype.getDelaunayEdgeCCW=function(e){return e===this.points_[0]?this.delaunay_edge[2]:e===this.points_[1]?this.delaunay_edge[0]:this.delaunay_edge[1]},i.prototype.setDelaunayEdgeCW=function(e,t){e===this.points_[0]?this.delaunay_edge[1]=t:e===this.points_[1]?this.delaunay_edge[2]=t:this.delaunay_edge[0]=t},i.prototype.setDelaunayEdgeCCW=function(e,t){e===this.points_[0]?this.delaunay_edge[2]=t:e===this.points_[1]?this.delaunay_edge[0]=t:this.delaunay_edge[1]=t},i.prototype.neighborAcross=function(e){return e===this.points_[0]?this.neighbors_[0]:e===this.points_[1]?this.neighbors_[1]:this.neighbors_[2]},i.prototype.oppositePoint=function(e,t){var n=e.pointCW(t);return this.pointCW(n)},i.prototype.legalize=function(e,t){var n=this.points_;if(e===n[0])n[1]=n[0],n[0]=n[2],n[2]=t;else if(e===n[1])n[2]=n[1],n[1]=n[0],n[0]=t;else{if(e!==n[2])throw new Error("poly2tri Invalid Triangle.legalize() call");n[0]=n[2],n[2]=n[1],n[1]=t}},i.prototype.index=function(e){var t=this.points_;if(e===t[0])return 0;if(e===t[1])return 1;if(e===t[2])return 2;throw new Error("poly2tri Invalid Triangle.index() call")},i.prototype.edgeIndex=function(e,t){var n=this.points_;if(e===n[0]){if(t===n[1])return 2;if(t===n[2])return 1}else if(e===n[1]){if(t===n[2])return 0;if(t===n[0])return 2}else if(e===n[2]){if(t===n[0])return 1;if(t===n[1])return 0}return-1},i.prototype.markConstrainedEdgeByIndex=function(e){this.constrained_edge[e]=!0},i.prototype.markConstrainedEdgeByEdge=function(e){this.markConstrainedEdgeByPoints(e.p,e.q)},i.prototype.markConstrainedEdgeByPoints=function(e,t){var n=this.points_;t===n[0]&&e===n[1]||t===n[1]&&e===n[0]?this.constrained_edge[2]=!0:t===n[0]&&e===n[2]||t===n[2]&&e===n[0]?this.constrained_edge[1]=!0:(t===n[1]&&e===n[2]||t===n[2]&&e===n[1])&&(this.constrained_edge[0]=!0)},t.exports=i},{"./xy":11}],10:[function(e,t,n){function i(e,t,n){var i=(e.x-n.x)*(t.y-n.y)-(e.y-n.y)*(t.x-n.x);return i>-s&&i<s?a.COLLINEAR:i>0?a.CCW:a.CW}function r(e,t,n,i){return!((e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)>=-s)&&!((e.x-n.x)*(i.y-n.y)-(i.x-n.x)*(e.y-n.y)<=s)}function o(e,t,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)<0}var s=1e-12;n.EPSILON=s;var a={CW:1,CCW:-1,COLLINEAR:0};n.Orientation=a,n.orient2d=i,n.inScanArea=r,n.isAngleObtuse=o},{}],11:[function(e,t,n){function i(e){return"("+e.x+";"+e.y+")"}function r(e){var t=e.toString();return"[object Object]"===t?i(e):t}function o(e,t){return e.y===t.y?e.x-t.x:e.y-t.y}function s(e,t){return e.x===t.x&&e.y===t.y}t.exports={toString:r,toStringBase:i,compare:o,equals:s}},{}]},{},[6])(6)}),define("standard/Math/Geometry/Triangle3",["standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","lib/poly2tri.js/dist/poly2tri.js"],function(e,t,n){var i=new e(0,0,0),r=new e(0,0,0),o=new e(0,0,0),s=new e(0,0,0),a=new e(0,0,0),u=new e(0,0,0),l=new t;return{area:function(e,t,n){return r.assign(t).subtract(e).cross(o.assign(n).subtract(e)).abs()/2},normal:function(e,t,n,i){var r=n.x-t.x,o=n.y-t.y,s=n.z-t.z,a=e.x-t.x,u=e.y-t.y,l=e.z-t.z;return i.set(o*l-s*u,s*a-r*l,r*u-o*a),i.normalize()},quadNormal:function(e,t,n,i,r){var o=n.x-e.x,s=n.y-e.y,a=n.z-e.z,u=i.x-t.x,l=i.y-t.y,c=i.z-t.z;return r.set(s*c-a*l,a*u-o*c,o*l-s*u),r.normalize()},removeCollinearPoints:function(e){for(var t=0,n=0,i=e.length,r=i-1;t<i;++t){var o=(t+r)%i,s=(t+1)%i;this.isCollinear(e[o],e[t],e[s])||(e[n++]=e[t])}e.length=n},isCollinear:function(e,t,n){var r=i.assign(e).subtract(t).normalize(),s=o.assign(n).subtract(t).normalize();return 0==r.abs()||(0==s.abs()||Math.abs(r.dot(s))>=1)},triangulatePolygon:function(e,t){try{this.removeCollinearPoints(e);var i=e[0],r=e[1];this.getPolygonNormal(e,u),s.assign(r).subtract(i),a.assign(u).cross(s),s.normalize(),a.normalize(),l.set(s.x,s.y,s.z,0,a.x,a.y,a.z,0,u.x,u.y,u.z,0,i.x,i.y,i.z,1),l.inverse();for(var o=0,c=e.length;o<c;++o)l.multVecMatrix(e[o]);for(var h=new n.SweepContext(e).triangulate().getTriangles(),o=0,c=h.length;o<c;++o)t.push(h[o].getPoint(0),h[o].getPoint(1),h[o].getPoint(2))}catch(n){this.triangulateConvexPolygon(e,t)}},triangulateConvexPolygon:function(e,t){for(var n=1,i=e.length-1;n<i;++n)t.push(e[0],e[n],e[n+1])},getPolygonNormal:function(e,t){t.set(0,0,0);for(var n=e[0],i=0,r=e.length;i<r;++i){var o=n,n=e[(i+1)%r];t.x+=(o.y-n.y)*(o.z+n.z),t.y+=(o.z-n.z)*(o.x+n.x),t.z+=(o.x-n.x)*(o.y+n.y)}return t.normalize()}}}),define("standard/Math/Algorithms/SAT",[],function(){function e(){}function t(e,t,n){n.min=Number.POSITIVE_INFINITY,n.max=Number.NEGATIVE_INFINITY;for(var i=0,r=e.length;i<r;++i){var o=e[i].dot(t);o<n.min&&(n.min=o),o>n.max&&(n.max=o)}}function n(e,t,n,r){return i(n,e,t)||i(e,n,r)}function i(e,t,n){return t<=e&&e<=n}var r={min:0,max:0},o={min:0,max:0};return e.isSeparated=function(e,i,s){for(var a=0,u=e.length;a<u;++a){var l=e[a];if(t(i,l,r),t(s,l,o),!n(r.min,r.max,o.min,o.max))return!0}return!1},e}),define("standard/Math/Geometry/Box3",["standard/Math/Geometry/Triangle3","standard/Math/Numbers/Matrix4","standard/Math/Numbers/Vector3","standard/Math/Algorithms/SAT"],function(e,t,n,i){function r(e,n){switch(arguments.length){case 0:return void(this.matrix=new t(.5,0,0,0,0,.5,0,0,0,0,.5,0,0,0,0,0));case 2:return void(this.matrix=new t(e.x/2,0,0,0,0,e.y/2,0,0,0,0,e.z/2,0,n.x,n.y,n.z,1));case 3:var i=arguments[0],r=arguments[1],o=(r.x-i.x)/2,s=(r.y-i.y)/2,a=(r.z-i.z)/2,u=(r.x+i.x)/2,l=(r.y+i.y)/2,c=(r.z+i.z)/2;return void(this.matrix=new t(o,0,0,0,0,s,0,0,0,0,a,0,u,l,c,1))}}var o=new n(0,0,0),s=new n(0,0,0),a=new n(0,0,0),u=new n(0,0,0),l=new n(0,0,0),c=new n(0,0,0),h=new n(0,0,0),d=new n(0,0,0),p=new n(0,0,0),f=new n(0,0,0),g=new n(0,0,0),m=new n(0,0,0),b=[new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0)],w=[new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0)],y=[new n(0,0,0),new n(0,0,0),new n(0,0,0)],x=[new n(0,0,0),new n(0,0,0),new n(0,0,0)],v=[new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0),new n(0,0,0)],_=[new n(0,0,0),new n(0,0,0),new n(0,0,0)],S=[],C=[new n(0,0,0)],F=[new n(0,0,0),new n(0,0,0),new n(0,0,0)];return r.prototype={constructor:r,copy:function(){var e=Object.create(r.prototype);return e.matrix=this.matrix.copy(),e},assign:function(e){return this.matrix.assign(e.matrix),this},equals:function(e){return this.matrix.equals(e.matrix)},getMatrix:function(){return this.matrix},set:function(e,t){b.box===this&&(b.box=null),y.box===this&&(y.box=null);var n=this.matrix;switch(arguments.length){case 0:return n[0]=.5,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=.5,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=.5,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=0,this;case 2:return n[0]=e.x/2,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e.y/2,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e.z/2,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}},setExtents:function(e,t){b.box===this&&(b.box=null),y.box===this&&(y.box=null);var n=this.matrix,i=(t.x-e.x)/2,r=(t.y-e.y)/2,o=(t.z-e.z)/2,s=(t.x+e.x)/2,a=(t.y+e.y)/2,u=(t.z+e.z)/2;return n[0]=i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=r,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=o,n[11]=0,n[12]=s,n[13]=a,n[14]=u,n[15]=1,this},getExtents:function(e,t){this.getAbsoluteExtents(e,t),e.add(this.center),t.add(this.center)},getAbsoluteExtents:function(e,t){var n=this.matrix;a.set(n[0],n[1],n[2]),u.set(n[4],n[5],n[6]),l.set(n[8],n[9],n[10]),c.assign(u).add(l);var i=l.subtract(u);h.assign(a).add(c),d.assign(a).add(i);var r=c.subtract(a),o=i.subtract(a);e.assign(h),t.assign(h),e.min(r,o,d),t.max(r,o,d),h.negate(),r.negate(),o.negate(),d.negate(),e.min(h,r,o,d),t.max(h,r,o,d)},getPoints:function(e){var t=this.matrix;a.set(t[0],t[1],t[2]),u.set(t[4],t[5],t[6]),l.set(t[8],t[9],t[10]),c.assign(u).add(l);var n=l.subtract(u);e[0].assign(a).add(c),e[1].assign(c).subtract(a),e[2].assign(n).subtract(a),e[3].assign(a).add(n),e[4].assign(e[2]).negate(),e[5].assign(e[3]).negate(),e[6].assign(e[0]).negate(),e[7].assign(e[1]).negate();var i=this.center;return e[0].add(i),e[1].add(i),e[2].add(i),e[3].add(i),e[4].add(i),e[5].add(i),e[6].add(i),e[7].add(i),e},getAxes:function(e){var t=this.matrix;return e[0].set(t[0],t[1],t[2]),e[1].set(t[4],t[5],t[6]),e[2].set(t[8],t[9],t[10]),e},getPlanes:function(e){var t=this.matrix;return e[0].set(t[0],t[1],t[2]).cross(l),e[1].set(t[4],t[5],t[6]).cross(a),e[2].set(t[8],t[9],t[10]).cross(u),e},isEmpty:function(){return 0===this.matrix[15]},add:function(e){return this.isEmpty()?this.assign(e):e.isEmpty()?this:(this.getExtents(p,f),e.getExtents(g,m),this.assign(new r(p.min(g),f.max(m),!0)))},multLeft:function(e){return this.matrix.multLeft(e),this},multRight:function(e){return this.matrix.multRight(e),this},intersectsPoint:function(e){return this.getExtents(o,s),o.x<=e.x&&s.x>=e.x&&o.y<=e.y&&s.y>=e.y&&o.z<=e.z&&s.z>=e.z},intersectsBox:function(e){if(this.isEmpty())return!1;if(e.isEmpty())return!1;if(this.getPoints(b),e.getPoints(w),i.isSeparated(this.getPlanes(_),b,w))return!1;if(i.isSeparated(e.getPlanes(_),b,w))return!1;this.getAxes(y),e.getAxes(x);for(var t=0;t<3;++t)for(var n=0;n<3;++n)v[3*t+n].assign(y[t]).cross(x[n]);return!i.isSeparated(v,b,w)},intersectsTriangle:function(t,n,r){if(this.isEmpty())return!1;if(b.box!==this&&(b.box=this,this.getPoints(b)),S[0]=t,S[1]=n,S[2]=r,i.isSeparated(this.getPlanes(_),b,S))return!1;if(e.normal(t,n,r,C[0]),i.isSeparated(C,b,S))return!1;y.box!==this&&(y.box=this,this.getAxes(y)),F[0].assign(t).subtract(n),F[1].assign(n).subtract(r),F[2].assign(r).subtract(t);for(var o=0;o<3;++o)for(var s=0;s<3;++s)v[3*o+s].assign(y[o]).cross(F[s]);return!i.isSeparated(v,b,w)},toString:function(){return this.size+", "+this.center}},Object.defineProperty(r.prototype,"size",{get:function(){var e=new n(0,0,0);return this.getAbsoluteExtents(o,e),e.subtract(o)},enumerable:!0,configurable:!1}),Object.defineProperty(r.prototype,"center",{get:function(){return this.matrix.origin},enumerable:!0,configurable:!1}),r}),define("standard/Math/Geometry/Plane3",["standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(e,t){function n(e,t){this.normal=t.copy(),this.distanceFromOrigin=t.dot(e)}var i=new e(0,0,0),r=new e(0,0,0),o=new t;return n.prototype={constructor:n,copy:function(){var e=Object.create(n.prototype);return e.normal=this.normal.copy(),e.distanceFromOrigin=this.distanceFromOrigin,e},assign:function(e){return this.normal.assign(e.normal),this.distanceFromOrigin=e.distanceFromOrigin,this},set:function(e,t){return this.normal.assign(t),this.distanceFromOrigin=t.dot(e),this},multRight:function(e){return r.assign(this.normal).multiply(this.distanceFromOrigin),o.assign(e).inverse(),o.multMatrixDir(i.assign(this.normal)).normalize(),e.multVecMatrix(r),this.normal.assign(i),this.distanceFromOrigin=i.dot(r),this},multLeft:function(e){return r.assign(this.normal).multiply(this.distanceFromOrigin),o.assign(e).inverse(),o.multDirMatrix(i.assign(this.normal)).normalize(),e.multḾatrixVec(r),this.normal.assign(i),this.distanceFromOrigin=i.dot(r),this},getDistanceToPoint:function(t){return e.dot(t,this.normal)-this.distanceFromOrigin},intersectsLine:function(e,t){var n=e.point,i=e.direction,r=i.dot(this.normal);if(0===r)return!1;var o=(this.distanceFromOrigin-this.normal.dot(n))/r;return t.x=n.x+i.x*o,t.y=n.y+i.y*o,t.z=n.z+i.z*o,!0},toString:function(){return this.normal.toString()+" "+this.distanceFromOrigin}},n}),define("cobweb/Components/Rendering/X3DGeometryNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Color3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Box3","standard/Math/Geometry/Plane3","standard/Math/Geometry/Triangle3","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l,c,h,d){function p(e){n.call(this,e),this.addType(i.X3DGeometryNode),this.addChildObjects("transparent",new t.SFBool,"bbox_changed",new t.SFTime),this.geometryType=3,this.currentTexCoordNode=this.getBrowser().getDefaultTextureCoordinate()}var f=new s(0,0,0),g=new s(0,0,0),m=new s(0,0,0),b=new u,w=new u,y=[new s(0,0,1),new s(0,0,-1),new s(0,1,0),new s(0,-1,0),new s(1,0,0)];return p.prototype=e.extend(Object.create(n.prototype),{constructor:p,intersection:new s(0,0,0),uvt:{u:0,v:0,t:0},v0:new s(0,0,0),v1:new s(0,0,0),v2:new s(0,0,0),normal:new s(0,0,0),setup:function(){this.setTainted(!0),n.prototype.setup.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed(),this.setTainted(!1)},initialize:function(){n.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this);var e=this.getBrowser().getContext();if(this.min=new s(0,0,0),this.max=new s(0,0,0),this.bbox=new l(this.min,this.max,!0),this.solid=!0,this.flatShading=void 0,this.attribNodes=[],this.attribs=[],this.colors=[],this.texCoords=[],this.defaultTexCoords=[],this.texCoordParams={min:new s(0,0,0)},this.normals=[],this.flatNormals=[],this.vertices=[],this.vertexCount=0,this.primitiveMode=e.TRIANGLES,this.frontFace=e.CCW,this.attribBuffers=[],this.colorBuffer=e.createBuffer(),this.texCoordBuffers=[],this.normalBuffer=e.createBuffer(),this.vertexBuffer=e.createBuffer(),this.attribArray=[],this.colorArray=new Float32Array,this.texCoordArray=[],this.vertexArray=new Float32Array,this.planes=[],this.geometryType>1)for(var t=0;t<5;++t)this.planes[t]=new c(s.Zero,y[0]);this.depth=Function.prototype,this.display=Function.prototype,this.displayParticles=Function.prototype,this.set_live__()},getExtendedEventHandling:function(){return!1},setGeometryType:function(e){this.geometryType=e},getGeometryType:function(){return this.geometryType},getBBox:function(){return this.bbox},setBBox:function(e){if(!e.equals(this.bbox)){e.getExtents(f,g),this.min.assign(f),this.max.assign(g),this.bbox.assign(e);for(var t=0;t<5;++t)this.planes[t].set(t%2?f:g,y[t]);this.bbox_changed_.addEvent()}},getMin:function(){return this.min},getMax:function(){return this.max},getMatrix:function(){return u.Identity},setPrimitiveMode:function(e){this.primitiveMode=e},getPrimitiveMode:function(){return this.primitiveMode},setSolid:function(e){this.solid=e},setCCW:function(e){this.frontFace=e?this.getBrowser().getContext().CCW:this.getBrowser().getContext().CW},getAttrib:function(){return this.attribNodes},getAttribs:function(){return this.attribs},addColor:function(e){this.colors.push(e.r,e.g,e.b,3===e.length?1:e.a)},setColors:function(e){for(var t=this.colors,n=0,i=e.length;n<i;++n)t[n]=e[n];t.length=i},getColors:function(){return this.colors},setTexCoords:function(e){for(var t=this.texCoords,n=0,i=e.length;n<i;++n)t[n]=e[n];t.length=i},getTexCoords:function(){return this.texCoords},setCurrentTexCoord:function(e){this.currentTexCoordNode=e||this.getBrowser().getDefaultTextureCoordinate()},addNormal:function(e){this.normals.push(e.x,e.y,e.z)},setNormals:function(e){for(var t=this.normals,n=0,i=e.length;n<i;++n)t[n]=e[n];t.length=i},getNormals:function(){return this.normals},addVertex:function(e){this.min.min(e),this.max.max(e),this.vertices.push(e.x,e.y,e.z,1)},setVertices:function(e){for(var t=this.vertices,n=0,i=e.length;n<i;++n)t[n]=e[n];t.length=i},getVertices:function(){return this.vertices},buildTexCoords:function(){var e=this.getTexCoordParams(),t=e.min,n=e.Sindex,i=e.Tindex,r=e.Ssize,o=t[n],s=t[i],a=this.defaultTexCoords,u=this.vertices;a.length=0,this.texCoords.push(a);for(var l=0,c=u.length;l<c;l+=4)a.push((u[l+n]-o)/r,(u[l+i]-s)/r,0,1)},getTexCoordParams:function(){var e=this.texCoordParams,t=this.getBBox(),n=t.size,i=n.x,r=n.y,o=n.z;return e.min.assign(t.center).subtract(n.divide(2)),i>=r&&i>=o?(e.Ssize=i,e.Sindex=0,e.Tindex=r>=o?1:2):r>=i&&r>=o?(e.Ssize=r,e.Sindex=1,e.Tindex=i>=o?0:2):(e.Ssize=o,e.Sindex=2,e.Tindex=i>=r?0:1),e},refineNormals:function(e,t,n){if(0===n)return t;var i=Math.cos(d.clamp(n,0,Math.PI)),r=[];for(var o in e)for(var a=e[o],u=0,l=a.length;u<l;++u){for(var c=a[u],h=t[c],p=new s(0,0,0),f=0;f<l;++f){var g=t[a[f]];g.dot(h)>=i&&p.add(g)}r[c]=p.normalize()}return r},isClipped:function(e,t){return t.some(function(t){return t.isClipped(e)})},transformLine:function(e){},transformMatrix:function(e){},intersectsLine:function(e,t,n,i){try{var r=!1;if(this.intersectsBBox(e)){this.transformLine(e),this.transformMatrix(b.assign(n));for(var a=this.texCoords[0],u=this.normals,l=this.vertices,c=this.uvt,h=this.v0,d=this.v1,p=this.v2,f=0,g=this.vertexCount;f<g;f+=3){var w=4*f;if(h.x=l[w+0],h.y=l[w+1],h.z=l[w+2],d.x=l[w+4],d.y=l[w+5],d.z=l[w+6],p.x=l[w+8],p.y=l[w+9],p.z=l[w+10],e.intersectsTriangle(h,d,p,c)){var y=c.u,x=c.v,v=1-y-x,_=new s(v*l[w+0]+y*l[w+4]+x*l[w+8],v*l[w+1]+y*l[w+5]+x*l[w+9],v*l[w+2]+y*l[w+6]+x*l[w+10]);if(this.isClipped(b.multVecMatrix(m.assign(_)),t))continue;var S=new o(v*a[w+0]+y*a[w+4]+x*a[w+8],v*a[w+1]+y*a[w+5]+x*a[w+9]),C=3*f,F=new s(v*u[C+0]+y*u[C+3]+x*u[C+6],v*u[C+1]+y*u[C+4]+x*u[C+7],v*u[C+2]+y*u[C+5]+x*u[C+8]);i.push({texCoord:S,normal:F,point:this.getMatrix().multVecMatrix(_)}),r=!0}}}return r}catch(e){return console.log(e),!1}},intersectsBBox:function(e){var t=this.planes,n=this.min,i=this.max,r=n.x,o=i.x,s=n.y,a=i.y,u=n.z,l=i.z,c=this.intersection;return!!(t[0].intersectsLine(e,c)&&c.x>=r&&c.x<=o&&c.y>=s&&c.y<=a)||(!!(t[1].intersectsLine(e,c)&&c.x>=r&&c.x<=o&&c.y>=s&&c.y<=a)||(!!(t[2].intersectsLine(e,c)&&c.x>=r&&c.x<=o&&c.z>=u&&c.z<=l)||(!!(t[3].intersectsLine(e,c)&&c.x>=r&&c.x<=o&&c.z>=u&&c.z<=l)||!!(t[4].intersectsLine(e,c)&&c.y>=s&&c.y<=a&&c.z>=u&&c.z<=l))))},intersectsBox:function(e,t,n){try{if(e.intersectsBox(this.bbox)){e.multRight(w.assign(this.getMatrix()).inverse()),this.transformMatrix(n);for(var i=this.vertices,r=this.v0,o=this.v1,s=this.v2,a=0,u=this.vertexCount;a<u;a+=3){var l=4*a;if(r.x=i[l+0],r.y=i[l+1],r.z=i[l+2],o.x=i[l+4],o.y=i[l+5],o.z=i[l+6],s.x=i[l+8],s.y=i[l+9],s.z=i[l+10],e.intersectsTriangle(r,o,s)){if(t.length){if(this.isClipped(n.multVecMatrix(m.assign(r)),t))continue;if(this.isClipped(n.multVecMatrix(m.assign(o)),t))continue;if(this.isClipped(n.multVecMatrix(m.assign(s)),t))continue}return!0}}}return!1}catch(e){return console.log(e),!1}},set_live__:function(){this.isLive().getValue()?this.getBrowser().getBrowserOptions().Shading_.addInterest("set_shading__",this):this.getBrowser().getBrowserOptions().Shading_.removeInterest("set_shading__",this)},set_shading__:function(e){if(!(this.geometryType<2)){var t="FLAT"===e.getValue();if(t!==this.flatShading){this.flatShading=t;var n=this.getBrowser().getContext();if(t&&!this.flatNormals.length)for(var i=this.frontFace===n.CW,r=this.flatNormals,o=this.vertices,s=this.v0,a=this.v1,u=this.v2,l=this.normal,c=0,d=o.length;c<d;c+=12)h.normal(s.set(o[c+0],o[c+1],o[c+2]),a.set(o[c+4],o[c+5],o[c+6]),u.set(o[c+8],o[c+9],o[c+10]),l),i&&l.negate(),r.push(l.x,l.y,l.z,l.x,l.y,l.z,l.x,l.y,l.z);n.bindBuffer(n.ARRAY_BUFFER,this.normalBuffer),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t?this.flatNormals:this.normals),n.STATIC_DRAW)}}},eventsProcessed:function(){if(n.prototype.eventsProcessed.call(this),this.clear(),this.build(),this.vertices.length?this.bbox.setExtents(this.min,this.max):this.bbox.setExtents(this.min.set(0,0,0),this.max.set(0,0,0)),this.bbox_changed_.addEvent(),this.geometryType>1){for(var e=this.min,t=this.max,i=0;i<5;++i)this.planes[i].set(i%2?e:t,y[i]);0===this.texCoords.length&&this.buildTexCoords()}this.set_shading__(this.getBrowser().getBrowserOptions().Shading_),this.transfer()},clear:function(){this.min.set(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this.max.set(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(var e=this.getAttrib().length,t=this.getAttribs(),n=0,i=t.length;n<i;++n)t[n].length=0;for(n=t.length;n<e;++n)t[n]=[];t.length=e,this.flatShading=void 0,this.colors.length=0,this.texCoords.length=0,this.normals.length=0,this.flatNormals.length=0,this.vertices.length=0},transfer:function(){for(var e=this.getBrowser().getContext(),t=this.vertices.length/4,n=this.attribBuffers.length,i=this.attribs.length;n<i;++n)this.attribBuffers.push(e.createBuffer()),this.attribArray.push(new Float32Array);this.attribBuffers.length=this.attribs.length;for(var n=0,i=this.attribs.length;n<i;++n)this.attribArray[n].length!==this.attribs[n].length?this.attribArray[n]=new Float32Array(this.attribs[n]):this.attribArray[n].set(this.attribs[n]),e.bindBuffer(e.ARRAY_BUFFER,this.attribBuffers[n]),e.bufferData(e.ARRAY_BUFFER,this.attribArray[n],e.STATIC_DRAW);this.colorArray.length!==this.colors.length?this.colorArray=new Float32Array(this.colors):this.colorArray.set(this.colors),e.bindBuffer(e.ARRAY_BUFFER,this.colorBuffer),e.bufferData(e.ARRAY_BUFFER,this.colorArray,e.STATIC_DRAW);for(var n=this.texCoordBuffers.length,i=this.texCoords.length;n<i;++n)this.texCoordBuffers.push(e.createBuffer()),this.texCoordArray.push(new Float32Array);this.texCoordBuffers.length=this.texCoords.length;for(var n=0,i=this.texCoords.length;n<i;++n)this.texCoordArray[n].length!==this.texCoords[n].length?this.texCoordArray[n]=new Float32Array(this.texCoords[n]):this.texCoordArray[n].set(this.texCoords[n]),e.bindBuffer(e.ARRAY_BUFFER,this.texCoordBuffers[n]),e.bufferData(e.ARRAY_BUFFER,this.texCoordArray[n],e.STATIC_DRAW);this.vertexArray.length!==this.vertices.length?this.vertexArray=new Float32Array(this.vertices):this.vertexArray.set(this.vertices),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertexArray,e.STATIC_DRAW),this.vertexCount=t,this.vertexCount?(delete this.depth,delete this.display,delete this.displayParticles):(this.depth=Function.prototype,this.display=Function.prototype,this.displayParticles=Function.prototype)},traverse:function(e,t){},depth:function(e,t){var n=e.renderer.getBrowser().getContext();t.enableVertexAttribute(n,this.vertexBuffer),n.drawArrays(this.primitiveMode,0,this.vertexCount)},display:function(e){try{var t=e.renderer.getBrowser().getContext(),n=e.shaderNode,i=this.attribNodes,r=this.attribBuffers;e.geometryType=this.geometryType,e.colorMaterial=this.colors.length,n.setLocalUniforms(t,e);for(var o=0,s=i.length;o<s;++o)i[o].enable(t,n,r[o]);if(this.colors.length&&n.enableColorAttribute(t,this.colorBuffer),n.enableTexCoordAttribute(t,this.texCoordBuffers),n.enableNormalAttribute(t,this.normalBuffer),n.enableVertexAttribute(t,this.vertexBuffer),n.wireframe)for(var o=0,s=this.vertexCount;o<s;o+=3)t.drawArrays(n.primitiveMode,o,3);else{var a=u.prototype.determinant3.call(e.modelViewMatrix)>0;t.frontFace(a?this.frontFace:this.frontFace===t.CCW?t.CW:t.CCW),e.transparent&&!this.solid?(t.enable(t.CULL_FACE),t.cullFace(t.FRONT),t.drawArrays(n.primitiveMode,0,this.vertexCount),t.cullFace(t.BACK),t.drawArrays(n.primitiveMode,0,this.vertexCount)):(this.solid?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.drawArrays(n.primitiveMode,0,this.vertexCount))}for(var o=0,s=i.length;o<s;++o)i[o].disable(t,n);n.disableColorAttribute(t),n.disableTexCoordAttribute(t),n.disableNormalAttribute(t)}catch(e){console.log(e)}},displayParticlesDepth:function(e,t,n,i){var r=e.renderer.getBrowser().getContext();t.enableVertexAttribute(r,this.vertexBuffer);for(var o=e.modelViewMatrix,s=o[12],a=o[13],l=o[14],c=0;c<i;++c)o[12]=s,o[13]=a,o[14]=l,u.prototype.translate.call(o,n[c].position),r.uniformMatrix4fv(t.x3d_ModelViewMatrix,!1,o),r.drawArrays(t.primitiveMode,0,this.vertexCount)},displayParticles:function(e,t,n){try{var i=e.renderer.getBrowser().getContext(),r=e.shaderNode,o=this.attribNodes,s=this.attribBuffers;e.geometryType=this.geometryType,e.colorMaterial=this.colors.length,r.setLocalUniforms(i,e);for(var l=0,c=o.length;l<c;++l)o[l].enable(i,r,s[l]);this.colors.length&&r.enableColorAttribute(i,this.colorBuffer),r.enableTexCoordAttribute(i,this.texCoordBuffers),r.enableNormalAttribute(i,this.normalBuffer),r.enableVertexAttribute(i,this.vertexBuffer);var h=e.materialNode,d=h||r.getCustom(),p=r.normalMatrixArray,f=e.modelViewMatrix,g=f[12],m=f[13],b=f[14];if(r.wireframe)for(y=0;y<n;++y){f[12]=g,f[13]=m,f[14]=b,u.prototype.translate.call(f,t[y].position),d&&(p[0]=f[0],p[1]=f[4],p[2]=f[8],p[3]=f[1],p[4]=f[5],p[5]=f[9],p[6]=f[2],p[7]=f[6],p[8]=f[10],a.prototype.inverse.call(p),i.uniformMatrix3fv(r.x3d_NormalMatrix,!1,p)),i.uniformMatrix4fv(r.x3d_ModelViewMatrix,!1,f);for(var l=0,c=this.vertexCount;l<c;l+=3)i.drawArrays(r.primitiveMode,l,3)}else{var w=u.prototype.determinant3.call(e.modelViewMatrix)>0;if(i.frontFace(w?this.frontFace:this.frontFace===i.CCW?i.CW:i.CCW),e.transparent&&!this.solid)for(y=0;y<n;++y)f[12]=g,f[13]=m,f[14]=b,u.prototype.translate.call(f,t[y].position),d&&(p[0]=f[0],p[1]=f[4],p[2]=f[8],p[3]=f[1],p[4]=f[5],p[5]=f[9],p[6]=f[2],p[7]=f[6],p[8]=f[10],a.prototype.inverse.call(p),i.uniformMatrix3fv(r.x3d_NormalMatrix,!1,p)),i.uniformMatrix4fv(r.x3d_ModelViewMatrix,!1,f),i.enable(i.CULL_FACE),i.cullFace(i.FRONT),i.drawArrays(r.primitiveMode,0,this.vertexCount),i.cullFace(i.BACK),i.drawArrays(r.primitiveMode,0,this.vertexCount);else{this.solid?i.enable(i.CULL_FACE):i.disable(i.CULL_FACE);for(var y=0;y<n;++y)f[12]=g,f[13]=m,f[14]=b,u.prototype.translate.call(f,t[y].position),(h||r.getCustom())&&(p[0]=f[0],p[1]=f[4],p[2]=f[8],p[3]=f[1],p[4]=f[5],p[5]=f[9],p[6]=f[2],p[7]=f[6],p[8]=f[10],a.prototype.inverse.call(p),i.uniformMatrix3fv(r.x3d_NormalMatrix,!1,p)),i.uniformMatrix4fv(r.x3d_ModelViewMatrix,!1,f),i.drawArrays(r.primitiveMode,0,this.vertexCount)}}for(var l=0,c=o.length;l<c;++l)o[l].disable(i,r);r.disableColorAttribute(i),r.disableTexCoordAttribute(i),r.disableNormalAttribute(i)}catch(e){console.log(e)}}}),p}),define("cobweb/Components/Rendering/X3DComposedGeometryNode",["jquery","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r){function o(e){t.call(this,e),this.addType(i.X3DComposedGeometryNode),this.colorNode=null,this.texCoordNode=null,this.normalNode=null,this.coordNode=null}return o.prototype=e.extend(Object.create(t.prototype),{constructor:o,initialize:function(){t.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.color_.addInterest("set_color__",this),this.texCoord_.addInterest("set_texCoord__",this),this.normal_.addInterest("set_normal__",this),this.coord_.addInterest("set_coord__",this),this.set_attrib__(),this.set_color__(),this.set_texCoord__(),this.set_normal__(),this.set_coord__()},getColor:function(){return this.colorNode},getTexCoord:function(){return this.texCoordNode},getNormal:function(){return this.normalNode},getCoord:function(){return this.coordNode},set_attrib__:function(){for(var e=this.getAttrib(),t=0,r=e.length;t<r;++t)e[t].removeInterest("addNodeEvent",this);e.length=0;for(var t=0,r=this.attrib_.length;t<r;++t){var o=n(i.X3DVertexAttributeNode,this.attrib_[t]);o&&e.push(o)}for(t=0;t<this.attribNodes.length;++t)e[t].addInterest("addNodeEvent",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("addNodeEvent",this),this.colorNode.removeInterest("set_transparent__",this)),this.colorNode=n(i.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("addNodeEvent",this),this.colorNode.addInterest("set_transparent__",this),this.set_transparent__()):this.transparent_=!1},set_transparent__:function(){this.transparent_=this.colorNode.isTransparent()},set_texCoord__:function(){this.texCoordNode&&this.texCoordNode.removeInterest("addNodeEvent",this),this.texCoordNode=n(i.X3DTextureCoordinateNode,this.texCoord_),this.texCoordNode&&this.texCoordNode.addInterest("addNodeEvent",this),this.setCurrentTexCoord(this.texCoordNode)},set_normal__:function(){this.normalNode&&this.normalNode.removeInterest("addNodeEvent",this),this.normalNode=n(i.X3DNormalNode,this.normal_),this.normalNode&&this.normalNode.addInterest("addNodeEvent",this)},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("addNodeEvent",this),this.coordNode=n(i.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("addNodeEvent",this)},getPolygonIndex:function(e){return e},getTriangleIndex:function(e){return e},build:function(e,t,n,i){if(this.coordNode&&!this.coordNode.isEmpty()){t-=t%e,i-=i%n;var r=this.colorPerVertex_.getValue(),o=this.normalPerVertex_.getValue(),s=this.getAttrib().length,a=this.getAttribs(),u=this.getColor(),l=this.getTexCoord(),c=this.getNormal(),h=this.getCoord(),d=this.getTexCoords(),p=0;l&&l.init(d);for(var f=0;f<i;++f){p=Math.floor(f/n);for(var g=this.getPolygonIndex(this.getTriangleIndex(f)),m=0;m<s;++m)attrib[m].addValue(a[m],g);u&&(r?this.addColor(u.get1Color(g)):this.addColor(u.get1Color(p))),l&&l.addTexCoord(d,g),c&&(o?this.addNormal(c.get1Vector(g)):this.addNormal(c.get1Vector(p))),this.addVertex(h.get1Point(g))}this.getNormal()||this.buildNormals(e,t,i),this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}},buildNormals:function(e,t,n){for(var i=this.createNormals(e,t),r=0;r<n;++r)this.addNormal(i[this.getTriangleIndex(r)])},createNormals:function(e,t){var n=this.createFaceNormals(e,t);if(this.normalPerVertex_.getValue()){for(var i=[],r=0;r<t;++r){var o=this.getPolygonIndex(r);i[o]||(i[o]=[]),i[o].push(r)}return this.refineNormals(i,n,Math.PI)}return n},createFaceNormals:function(e,t){for(var n=!this.ccw_.getValue(),i=this.coordNode,r=[],o=0;o<t;o+=e){var s=this.getPolygonNormal(e,i);n&&s.negate();for(var a=0;a<e;++a)r.push(s)}return r},getPolygonNormal:function(e,t){for(var n=new r(0,0,0),i=t.get1Point(this.getPolygonIndex(0)),o=0;o<e;++o){var s=i,i=t.get1Point(this.getPolygonIndex((o+1)%e));n.x+=(s.y-i.y)*(s.z+i.z),n.y+=(s.z-i.z)*(s.x+i.x),n.z+=(s.x-i.x)*(s.y+i.y)}return n.normalize()}}),o}),define("cobweb/Components/Geometry3D/IndexedFaceSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Triangle3"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(o.IndexedFaceSet)}var c=[0,1,2],h=[],d=[],p=[];return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"convex",new t.SFBool(!0)),new n(o.initializeOnly,"creaseAngle",new t.SFFloat),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.inputOutput,"colorIndex",new t.MFInt32),new n(o.inputOutput,"texCoordIndex",new t.MFInt32),new n(o.inputOutput,"normalIndex",new t.MFInt32),new n(o.inputOutput,"coordIndex",new t.MFInt32),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedFaceSet"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},getTexCoordPerVertexIndex:function(e){return e<this.texCoordIndex_.length?this.texCoordIndex_[e]:this.coordIndex_[e]},getColorPerVertexIndex:function(e){return e<this.colorIndex_.length?this.colorIndex_[e]:this.coordIndex_[e]},getColorIndex:function(e){return e<this.colorIndex_.length?this.colorIndex_[e]:e},getNormalPerVertexIndex:function(e){return e<this.normalIndex_.length?this.normalIndex_[e]:this.coordIndex_[e]},getNormalIndex:function(e){return e<this.normalIndex_.length?this.normalIndex_[e]:e},build:function(){var e=this.triangulate();if(0!==e.length){var t=this.colorPerVertex_.getValue(),n=this.normalPerVertex_.getValue(),i=this.coordIndex_.getValue(),r=this.getAttrib(),o=r.length,s=this.getAttribs(),a=this.getColor(),u=this.getTexCoord(),l=this.getNormal(),c=this.getCoord(),h=this.getTexCoords();u&&u.init(h);for(var d=0,p=e.length;d<p;++d){for(var f=e[d],g=f.vertices,m=f.triangles,b=f.face,w=0,y=m.length;w<y;++w){for(var x=g[m[w]],v=i[x].getValue(),_=0;_<o;++_)r[_].addValue(s[_],v);a&&(t?this.addColor(a.get1Color(this.getColorPerVertexIndex(x))):this.addColor(a.get1Color(this.getColorIndex(b)))),u&&u.addTexCoord(h,this.getTexCoordPerVertexIndex(x)),l&&(n?this.addNormal(l.get1Vector(this.getNormalPerVertexIndex(x))):this.addNormal(l.get1Vector(this.getNormalIndex(b)))),this.addVertex(c.get1Point(v))}++b}this.getNormal()||this.buildNormals(e),this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}},triangulate:function(){var e=this.convex_.getValue(),t=this.coordIndex_.getValue(),n=t.length,i=[];if(!this.getCoord())return i;if(n){this.coordIndex_[n-1]>-1&&(this.coordIndex_.push(-1),++n);for(var r=[],o=0,s=0;s<n;++s)if(t[s].getValue()>-1)r.push(s);else{if(r.length)switch(r[0]===r[r.length-1]&&r.pop(),r.length){case 0:case 1:case 2:r.length=0;break;case 3:i.push({vertices:r,triangles:c,face:o}),r=[];break;default:var a=[],u={vertices:r,triangles:a,face:o};e?this.triangulateConvexPolygon(u):this.triangulatePolygon(u),a.length<3?r.length=0:(i.push(u),r=[])}++o}}return i},triangulatePolygon:function(e){for(var t=e.vertices,n=e.triangles,i=this.coordIndex_.getValue(),r=this.getCoord(),o=0,s=t.length;o<s;++o){var a=r.get1Point(i[t[o]].getValue()).copy();a.index=o,h[o]=a}h.length=s,u.triangulatePolygon(h,n);for(var o=0,s=n.length;o<s;++o)n[o]=n[o].index},triangulateConvexPolygon:function(e){for(var t=e.vertices,n=e.triangles,i=1,r=t.length-1;i<r;++i)n.push(0,i,i+1)},buildNormals:function(e){for(var t=0,n=this.createNormals(e),i=0,r=e.length;i<r;++i){for(var o=e[i],s=o.vertices,a=o.triangles,u=0,l=a.length;u<l;++u)this.addNormal(n[t+a[u]]);t+=s.length}},createNormals:function(e){var t=!this.ccw_.getValue(),n=this.coordIndex_.getValue(),i=this.getCoord(),r=null;d.length=0,p.length=0;for(var o=0,s=e.length;o<s;++o){var a=e[o].vertices,u=a.length;switch(u){case 3:r=i.getNormal(n[a[0]].getValue(),n[a[1]].getValue(),n[a[2]].getValue());break;case 4:r=i.getQuadNormal(n[a[0]].getValue(),n[a[1]].getValue(),n[a[2]].getValue(),n[a[3]].getValue());break;default:r=this.getPolygonNormal(a,n,i)}for(c=0;c<u;++c){var l=n[a[c]].getValue();p[l]||(p[l]=[]),p[l].push(d.length+c)}t&&r.negate();for(var c=0,h=u;c<h;++c)d.push(r)}return this.refineNormals(p,d,this.creaseAngle_.getValue())},getPolygonNormal:function(e,t,n){for(var i=new s(0,0,0),r=n.get1Point(t[e[0]].getValue()),o=0,a=e.length;o<a;++o){var u=r,r=n.get1Point(t[e[(o+1)%a]].getValue());i.x+=(u.y-r.y)*(u.z+r.z),i.y+=(u.z-r.z)*(u.x+r.x),i.z+=(u.x-r.x)*(u.y+r.y)}return i.normalize()}}),l}),define("cobweb/Components/Rendering/X3DGeometricPropertyNode",["jquery","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DGeometricPropertyNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Rendering/X3DCoordinateNode",["jquery","cobweb/Components/Rendering/X3DGeometricPropertyNode","cobweb/Bits/X3DConstants","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector3"],function(e,t,n,i,r){function o(e){t.call(this,e),this.addType(n.X3DCoordinateNode),this.point=this.point_.getValue()}return o.prototype=e.extend(Object.create(t.prototype),{constructor:o,isEmpty:function(){return 0==this.point.length},getSize:function(){return this.point.length},get1Point:function(e){return e<this.point.length?this.point[e].getValue():new r(0,0,0)},getNormal:function(e,t,n){var o=this.point,s=o.length;return e<s&&t<s&&n<s?i.normal(o[e].getValue(),o[t].getValue(),o[n].getValue(),new r(0,0,0)):new r(0,0,0)},getQuadNormal:function(e,t,n,o){var s=this.point,a=s.length;return e<a&&t<a&&n<a&&o<a?i.quadNormal(s[e].getValue(),s[t].getValue(),s[n].getValue(),s[o].getValue(),new r(0,0,0)):new r(0,0,0)}}),o}),define("cobweb/Components/Rendering/Coordinate",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DCoordinateNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.Coordinate)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"point",new t.MFVec3f)]),getTypeName:function(){return"Coordinate"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"coord"}}),s}),define("cobweb/Components/Texturing/X3DTextureCoordinateNode",["jquery","cobweb/Components/Rendering/X3DGeometricPropertyNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DTextureCoordinateNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,init:function(e){e.push([])},addTexCoord:function(e,t){this.addTexCoordToChannel(e[0],t)}}),i}),define("cobweb/Components/Texturing/TextureCoordinate",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTextureCoordinateNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.TextureCoordinate)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"point",new t.MFVec2f)]),getTypeName:function(){return"TextureCoordinate"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texCoord"},addTexCoordToChannel:function(e,t){if(t>=0&&t<this.point_.length){var n=this.point_[t];e.push(n.x,n.y,0,1)}else e.push(0,0,0,1)},getTexCoord:function(e){for(var t=this.point_.getValue(),n=0,i=t.length;n<i;++n){var r=t[n].getValue();e[n]=new s(r.x,r.y,0,1)}return e.length=i,e}}),a}),define("cobweb/Browser/Geometry2D/Rectangle2DOptions",["jquery","cobweb/Basic/X3DBaseNode","cobweb/Components/Geometry3D/IndexedFaceSet","cobweb/Components/Rendering/Coordinate","cobweb/Components/Texturing/TextureCoordinate","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){t.call(this,e)}return a.prototype=e.extend(Object.create(t.prototype),{constructor:a,getTypeName:function(){return"Rectangle2DOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"rectangle2DOptions"},initialize:function(){t.prototype.initialize.call(this)},getGeometry:function(){if(this.geometry)return this.geometry;this.geometry=new n(this.getExecutionContext()),this.geometry.texCoord_=new r(this.getExecutionContext()),this.geometry.coord_=new i(this.getExecutionContext());var e=this.geometry,t=this.geometry.texCoord_.getValue(),a=this.geometry.coord_.getValue();return e.texCoordIndex_=[0,1,2,3,-1],e.coordIndex_=[0,1,2,3,-1],t.point_=[new o(1,1),new o(0,1),new o(0,0),new o(1,0)],a.point_=[new s(1,1,0),new s(-1,1,0),new s(-1,-1,0),new s(1,-1,0)],t.setup(),a.setup(),e.setup(),this.geometry}}),a}),define("cobweb/Browser/Geometry2D/X3DGeometry2DContext",["cobweb/Browser/Geometry2D/Arc2DOptions","cobweb/Browser/Geometry2D/ArcClose2DOptions","cobweb/Browser/Geometry2D/Circle2DOptions","cobweb/Browser/Geometry2D/Disk2DOptions","cobweb/Browser/Geometry2D/Rectangle2DOptions"],function(e,t,n,i,r){function o(e,t){return this[e]?this[e]:(this[e]=new t(this.getPrivateScene()),this[e].setup(),this[e])}function s(){}return s.prototype={initialize:function(){},getArc2DOptions:function(){return o.call(this,"arc2DOptions",e)},getArcClose2DOptions:function(){return o.call(this,"arcClose2DOptions",t)},getCircle2DOptions:function(){return o.call(this,"circle2DOptions",n)},getDisk2DOptions:function(){return o.call(this,"disk2DOptions",i)},getRectangle2DOptions:function(){return o.call(this,"rectangle2DOptions",r)}},s}),define("cobweb/Browser/Geometry3D/BoxOptions",["jquery","cobweb/Basic/X3DBaseNode","cobweb/Components/Geometry3D/IndexedFaceSet","cobweb/Components/Rendering/Coordinate","cobweb/Components/Texturing/TextureCoordinate","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){t.call(this,e)}return a.prototype=e.extend(Object.create(t.prototype),{constructor:a,getTypeName:function(){return"BoxOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"boxOptions"},initialize:function(){t.prototype.initialize.call(this)},getGeometry:function(){if(this.geometry)return this.geometry;this.geometry=new n(this.getExecutionContext()),this.geometry.texCoord_=new r(this.getExecutionContext()),this.geometry.coord_=new i(this.getExecutionContext());var e=this.geometry,t=this.geometry.texCoord_.getValue(),a=this.geometry.coord_.getValue();return e.texCoordIndex_=[0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1],e.coordIndex_=[0,1,2,3,-1,5,4,7,6,-1,1,5,6,2,-1,4,0,3,7,-1,4,5,1,0,-1,3,2,6,7,-1],t.point_=[new o(1,1),new o(0,1),new o(0,0),new o(1,0)],a.point_=[new s(1,1,1),new s(-1,1,1),new s(-1,-1,1),new s(1,-1,1),new s(1,1,-1),new s(-1,1,-1),new s(-1,-1,-1),new s(1,-1,-1)],t.setup(),a.setup(),e.setup(),this.geometry}}),a}),define("cobweb/Browser/Geometry3D/ConeOptions",["jquery","cobweb/Fields","cobweb/Basic/X3DBaseNode"],function(e,t,n){function i(e){n.call(this,e),this.addChildObjects("xDimension",new t.SFInt32(20),"yDimension",new t.SFInt32(1))}return i.prototype=e.extend(Object.create(n.prototype),{constructor:i,getTypeName:function(){return"ConeOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"coneOptions"}}),i}),define("cobweb/Browser/Geometry3D/CylinderOptions",["jquery","cobweb/Fields","cobweb/Basic/X3DBaseNode"],function(e,t,n){function i(e){n.call(this,e),this.addChildObjects("xDimension",new t.SFInt32(20),"yDimension",new t.SFInt32(1))}return i.prototype=e.extend(Object.create(n.prototype),{constructor:i,getTypeName:function(){return"CylinderOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"cylinderOptions"}}),i}),define("cobweb/Browser/Geometry3D/QuadSphereOptions",["jquery","cobweb/Fields","cobweb/Basic/X3DBaseNode","cobweb/Components/Geometry3D/IndexedFaceSet","cobweb/Components/Rendering/Coordinate","cobweb/Components/Texturing/TextureCoordinate","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u){function l(e){n.call(this,e),this.addChildObjects("xDimension",new t.SFInt32(32),"yDimension",new t.SFInt32(15))}return l.prototype=e.extend(Object.create(n.prototype),{constructor:l,getTypeName:function(){return"QuadSphereOptions"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"quadSphereOptions"},initialize:function(){n.prototype.initialize.call(this),this.addInterest("eventsProcessed",this)},getGeometry:function(){return this.geometry||this.eventsProcessed(),this.geometry},createTexCoordIndex:function(){for(var e=this.xDimension_.getValue()+1,t=this.yDimension_.getValue(),n=this.geometry.texCoordIndex_,i=0,r=e-1;i<r;++i)n.push(i),n.push(i+e-1),n.push(i+e),n.push(-1);for(var o=e-1,s=0,a=t-3;s<a;++s,++o)for(var i=0,r=e-1;i<r;++i,++o)n.push(o),n.push(o+e),n.push(o+e+1),n.push(o+1),n.push(-1);for(var o=(t-2)*e-1,i=0,r=e-1;i<r;++i,++o)n.push(o+e),n.push(o+1),n.push(o),n.push(-1)},createTexCoord:function(){for(var e=this.xDimension_.getValue()+1,t=this.yDimension_.getValue(),n=this.geometry.texCoord_.getValue().point_,i=-.5/(e-1),r=1;r<e;++r){l=r/(e-1)+i;n.push(new a(l,1))}for(var o=1,s=t-1;o<s;++o)for(var u=1-o/(t-1),r=0;r<e;++r){l=r/(e-1);n.push(new a(l,u))}for(r=1;r<e;++r){var l=r/(e-1)+i;n.push(new a(l,0))}},createCoordIndex:function(){for(var e=this.xDimension_.getValue()+1,t=this.yDimension_.getValue(),n=this.geometry.coordIndex_,i=1,r=e-1;i<r;++i)n.push(0),n.push(i),n.push(i+1),n.push(-1);n.push(0),n.push(i),n.push(1),n.push(-1);for(var o=1,s=0,a=t-3;s<a;++s,++o){for(var i=0,r=e-2;i<r;++i,++o)n.push(o),n.push(o+e-1),n.push(o+e),n.push(o+1),n.push(-1);n.push(o),n.push(o+e-1),n.push(o+1),n.push(o-e+2),n.push(-1)}for(var u=o+e-1,i=0,r=e-2;i<r;++i,++o)n.push(u),n.push(o+1),n.push(o),n.push(-1);n.push(u),n.push(u-e+1),n.push(o),n.push(-1)},createPoints:function(){var e=this.xDimension_.getValue()+1,t=this.yDimension_.getValue(),n=this.geometry.coord_.getValue().point_;n.push(new u(0,1,0));for(var i=1,r=t-1;i<r;++i)for(var o=s.Polar(1,-Math.PI*i/r),a=0,l=e-1;a<l;++a){var c=s.Polar(o.imag,2*Math.PI*a/l);n.push(new u(c.imag,o.real,c.real))}n.push(new u(0,-1,0))},eventsProcessed:function(){this.geometry=new i(this.getExecutionContext()),this.geometry.texCoord_=new o(this.getExecutionContext()),this.geometry.coord_=new r(this.getExecutionContext()),this.createTexCoordIndex(),this.createTexCoord(),this.createCoordIndex(),this.createPoints();var e=this.geometry,t=this.geometry.texCoord_.getValue(),n=this.geometry.coord_.getValue();e.creaseAngle_=Math.PI,t.setup(),n.setup(),e.setup()}}),l}),define("cobweb/Browser/Geometry3D/X3DGeometry3DContext",["cobweb/Browser/Geometry3D/BoxOptions","cobweb/Browser/Geometry3D/ConeOptions","cobweb/Browser/Geometry3D/CylinderOptions","cobweb/Browser/Geometry3D/QuadSphereOptions"],function(e,t,n,i){function r(e,t){return this[e]?this[e]:(this[e]=new t(this.getPrivateScene()),this[e].setup(),this[e])}function o(){}return o.prototype={initialize:function(){},getBoxOptions:function(){return r.call(this,"boxOptions",e)},getConeOptions:function(){return r.call(this,"coneOptions",t)},getCylinderOptions:function(){return r.call(this,"cylinderOptions",n)},getSphereOptions:function(){return r.call(this,"sphereOptions",i)}},o}),define("cobweb/Browser/PointingDeviceSensor/PointingDevice",["jquery","cobweb/Basic/X3DBaseNode"],function(e,t){function n(e){t.call(this,e),this.cursor="DEFAULT",this.isOver=!1,this.motionTime=0}return n.prototype=$.extend(Object.create(t.prototype),{constructor:n,initialize:function(){var e=this.getBrowser().getCanvas();e.bind("mousedown.PointingDevice",this.mousedown.bind(this)),e.bind("mouseup.PointingDevice",this.mouseup.bind(this)),e.bind("dblclick.PointingDevice",this.dblclick.bind(this)),e.bind("mousemove.PointingDevice",this.mousemove.bind(this)),e.bind("mouseout.PointingDevice",this.onmouseout.bind(this))},mousewheel:function(e){},mousedown:function(e){var t=this.getBrowser();if(t.getCanvas().focus(),!(t.getShiftKey()&&t.getControlKey()||0!==e.button)){var n=t.getCanvas().offset(),i=e.pageX-n.left,r=t.getCanvas().height()-(e.pageY-n.top);t.getCanvas().unbind("mousemove.PointingDevice"),$(document).bind("mouseup.PointingDevice"+this.getId(),this.mouseup.bind(this)),$(document).bind("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),t.buttonPressEvent(i,r)&&(e.preventDefault(),e.stopImmediatePropagation(),t.setCursor("HAND"),t.finished().addInterest("onverifymotion",this,i,r))}},mouseup:function(e){e.preventDefault();var t=this.getBrowser();if(0===e.button){e.preventDefault(),t.buttonReleaseEvent();var n=t.getCanvas().offset(),i=e.pageX-n.left,r=t.getCanvas().height()-(e.pageY-n.top);$(document).unbind(".PointingDevice"+this.getId()),t.getCanvas().bind("mousemove.PointingDevice",this.mousemove.bind(this)),t.setCursor(this.isOver?"HAND":"DEFAULT"),t.finished().addInterest("onverifymotion",this,i,r),t.addBrowserEvent(),this.cursor="DEFAULT"}},dblclick:function(e){this.isOver&&e.stopImmediatePropagation()},mousemove:function(e){e.preventDefault();var t=this.getBrowser();if(this.motionTime!==t.getCurrentTime()){this.motionTime=t.getCurrentTime();var n=t.getCanvas().offset(),i=e.pageX-n.left,r=t.getCanvas().height()-(e.pageY-n.top);this.onmotion(i,r)}},onmotion:function(e,t){var n=this.getBrowser();n.motionNotifyEvent(e,t)?this.isOver||(this.isOver=!0,this.cursor=n.getCursor(),n.setCursor("HAND")):this.isOver&&(this.isOver=!1,n.setCursor(this.cursor))},onmouseout:function(e){this.getBrowser().leaveNotifyEvent()},onverifymotion:function(e,t,n){this.getBrowser().finished().removeInterest("onverifymotion",this),this.onmotion(t,n)}}),n}),define("standard/Math/Geometry/Line3",["standard/Math/Numbers/Vector3"],function(e){function t(e,t){this.point=e.copy(),this.direction=t.copy()}return t.prototype={constructor:t,u:new e(0,0,0),pvec:new e(0,0,0),tvec:new e(0,0,0),copy:function(){var e=Object.create(t.prototype);return e.point=this.point.copy(),e.direction=this.direction.copy(),e},assign:function(e){return this.point.assign(e.point),this.direction.assign(e.direction),this},set:function(e,t){return this.point.assign(e),this.direction.assign(t),this},setPoints:function(e,t){return this.point.assign(e),this.direction.assign(t).subtract(e).normalize(),this},multMatrixLine:function(e){return e.multMatrixVec(this.point),e.multMatrixDir(this.direction).normalize(),this},multLineMatrix:function(e){return e.multVecMatrix(this.point),e.multDirMatrix(this.direction).normalize(),this},getClosestPointToPoint:function(e,t){var n=t.assign(e).subtract(this.point).dot(this.direction);return t.assign(this.direction).multiply(n).add(this.point)},getClosestPointToLine:function(t,n){var i=this.point,r=t.point,o=this.direction,s=t.direction,a=e.dot(o,s);if(Math.abs(a)>=1)return!1;var u=this.u.assign(r).subtract(i);return a=(e.dot(u,o)-a*e.dot(u,s))/(1-a*a),n.assign(o).multiply(a).add(i),!0},getPerpendicularVector:function(t){var n=e.subtract(this.point,t);return n.subtract(this.direction.copy().multiply(e.dot(n,this.direction)))},intersectsTriangle:function(e,t,n,i){var r=t.subtract(e),o=n.subtract(e),s=this.pvec.assign(this.direction).cross(o),a=r.dot(s);if(0===a)return!1;var u=1/a,l=this.tvec.assign(this.point).subtract(e),c=l.dot(s)*u;if(c<0||c>1)return!1;var h=l.cross(r),d=this.direction.dot(h)*u;if(d<0||c+d>1)return!1;var p=o.dot(h)*u;return i.u=c,i.v=d,i.t=p,!0},toString:function(){return this.point+", "+this.direction}},t.Points=function(n,i){var r=Object.create(t.prototype);return r.point=n.copy(),r.direction=e.subtract(i,n).normalize(),r},t}),define("standard/Math/Geometry/ViewVolume",["jquery","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s){function a(){this.viewport=new o(0,0,0,0),this.scissor=new o(0,0,0,0),this.planes=[new n(r.Zero,r.Zero),new n(r.Zero,r.Zero),new n(r.Zero,r.Zero),new n(r.Zero,r.Zero),new n(r.Zero,r.Zero),new n(r.Zero,r.Zero)]}var u=new r(0,0,0),l=new r(0,0,0),c=new r(0,0,0),h=new r(0,0,0),d=new r(0,0,0),p=new r(0,0,0),f=new r(0,0,0),g=new r(0,0,0),m=new s,b=new r(0,0,0),w=new o(0,0,0,0);return a.prototype={constructor:a,set:function(e,t,n){try{this.viewport.assign(t),this.scissor.assign(n);var r=n[0],o=n[0]+n[2],s=n[1],f=n[1]+n[3];m.assign(e).inverse(),a.unProjectPointMatrix(r,f,1,m,t,u),a.unProjectPointMatrix(r,s,1,m,t,l),a.unProjectPointMatrix(r,s,0,m,t,c),a.unProjectPointMatrix(o,s,0,m,t,h),a.unProjectPointMatrix(o,f,0,m,t,d),a.unProjectPointMatrix(o,f,1,m,t,p),this.planes[0].set(h,i.normal(c,h,d,b)),this.planes[1].set(l,i.normal(u,l,c,b)),this.planes[2].set(d,i.normal(p,d,h,b)),this.planes[3].set(p,i.normal(d,p,u,b)),this.planes[4].set(c,i.normal(h,c,l,b)),this.planes[5].set(u,i.normal(l,u,p,b)),this.valid=!0}catch(e){this.valid=!1,console.log(e)}return this},getViewport:function(){return this.viewport},getScissor:function(){return this.scissor},intersectsSphere:function(e,t){var n=this.planes;return!(n[0].getDistanceToPoint(t)>e)&&(!(n[1].getDistanceToPoint(t)>e)&&(!(n[2].getDistanceToPoint(t)>e)&&(!(n[3].getDistanceToPoint(t)>e)&&(!(n[4].getDistanceToPoint(t)>e)&&!(n[5].getDistanceToPoint(t)>e)))))}},e.extend(a,{unProjectPoint:function(e,t,n,i,r,o,s){return m.assign(i).multRight(r).inverse(),this.unProjectPointMatrix(e,t,n,m,o,s)},unProjectPointMatrix:function(e,t,n,i,r,o){if(w.set((e-r[0])/r[2]*2-1,(t-r[1])/r[3]*2-1,2*n-1,1),i.multVecMatrix(w),0===w.w)throw new Error("Couldn't unproject point: divisor is 0.");var s=1/w.w;return o.set(w.x*s,w.y*s,w.z*s)},unProjectRay:function(e,t,n,i,r,o){return m.assign(n).multRight(i).inverse(),a.unProjectPointMatrix(e,t,0,m,r,f),a.unProjectPointMatrix(e,t,.9,m,r,g),o.setPoints(f,g)},projectPoint:function(e,t,n,i,r){if(w.set(e.x,e.y,e.z,1),n.multVecMatrix(t.multVecMatrix(w)),0===w.w)throw new Error("Couldn't project point: divisor is 0.");var o=1/(2*w.w);return r.set((w.x*o+.5)*i[2]+i[0],(w.y*o+.5)*i[3]+i[1],w.z*o+.5)},projectLine:function(e,t,n,i,o){return a.projectPoint(e.point,t,n,i,f),a.projectPoint(r.multiply(e.direction,1e9).add(e.point),t,n,i,g),f.z=0,g.z=0,o.setPoints(f,g)}}),a}),define("standard/Math/Algorithms/MergeSort",[],function(){function e(e,t){this.array=e,this.auxiliary=[],t&&(this.compare=t)}return e.prototype={compare:function(e,t){return e<t},sort:function(e,t){this.mergeSort(e,t-1)},mergeSort:function(e,t){if(e<t){var n=e+t>>>1;this.mergeSort(e,n),this.mergeSort(n+1,t),this.merge(e,n,t)}},merge:function(e,t,n){var i,r,o;for(i=0,r=e;r<=t;)this.auxiliary[i++]=this.array[r++];for(i=0,o=e;o<r&&r<=n;)this.compare(this.array[r],this.auxiliary[i])?this.array[o++]=this.array[r++]:this.array[o++]=this.auxiliary[i++];for(;o<r;)this.array[o++]=this.auxiliary[i++]}},e}),define("cobweb/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext",["jquery","cobweb/Browser/PointingDeviceSensor/PointingDevice","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Geometry/Line3","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Algorithms/MergeSort","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l,c){function h(){this.pointingDevice=new t(this),this.pointer=new s(0,0),this.hitRay=new r(a.Zero,a.Zero),this.hits=[],this.enabledSensors=[{}],this.selectedLayer=null,this.overSensors={},this.activeSensors={},this.hitPointSorter=new l(this.hits,function(e,t){return e.intersection.point.z<t.intersection.point.z}),this.layerSorter=new l(this.hits,function(e,t){return e.layerNumber<t.layerNumber}),this.pickingTime=0}var d=new r(a.Zero,a.Zero);return h.prototype={initialize:function(){this.getCanvas().attr("tabindex",0),this.setCursor("DEFAULT"),this.pointingDevice.setup()},setCursor:function(e){this.cursorType=e;var t=this.getBrowser().getElement().find(".cobweb-surface");switch(e){case"HAND":t.css("cursor","pointer");break;case"MOVE":t.css("cursor","move");break;case"CROSSHAIR":t.css("cursor","crosshair");break;default:this.loadCount_.getValue()?t.css("cursor","wait"):this.pointingDevice&&this.pointingDevice.isOver?t.css("cursor","pointer"):t.css("cursor","default")}},getCursor:function(){return this.cursorType},isPointerInRectangle:function(e){return this.pointer.x>e.x&&this.pointer.x<e.x+e.z&&this.pointer.y>e.y&&this.pointer.y<e.y+e.w},setLayerNumber:function(e){this.layerNumber=e},getSelectedLayer:function(){return this.selectedLayer},setHitRay:function(e,t){try{o.unProjectRay(this.pointer.x,this.pointer.y,u.Identity,e,t,this.hitRay)}catch(e){this.hitRay.set(a.Zero,a.Zero)}},getHitRay:function(){return this.hitRay},getSensors:function(){return this.enabledSensors},addHit:function(e,t){this.hits.push({pointer:this.pointer,hitRay:this.hitRay.copy(),intersection:e,sensors:this.enabledSensors[this.enabledSensors.length-1],layer:t,layerNumber:this.layerNumber})},getHits:function(){return this.hits},getNearestHit:function(){return this.hits[this.hits.length-1]},buttonPressEvent:function(t,n){if(this.touch(t,n),0===this.hits.length)return!1;var i=this.getNearestHit();this.selectedLayer=i.layer,this.activeSensors=i.sensors;for(var r in this.activeSensors)this.activeSensors[r].set_active__(!0,i);return!e.isEmptyObject(i.sensors)},buttonReleaseEvent:function(){this.selectedLayer=null;for(var e in this.activeSensors)this.activeSensors[e].set_active__(!1,null);return this.activeSensors={},!0},motionNotifyEvent:function(t,n){return this.touch(t,n),this.motion(),this.hits.length&&!e.isEmptyObject(this.hits[this.hits.length-1].sensors)},leaveNotifyEvent:function(){},touch:function(e,t){var i=performance.now();this.pointer.set(e,t),this.hits.length=0,this.getWorld().traverse(n.POINTER,null),this.hitPointSorter.sort(0,this.hits.length),this.layerSorter.sort(0,this.hits.length),this.addBrowserEvent(),this.pickingTime=performance.now()-i},motion:function(){if(this.hits.length)n=this.hits[this.hits.length-1];else var t=this.selectedLayer?this.hitRay:d,n={pointer:this.pointer,modelViewMatrix:new u,hitRay:t,intersection:null,sensors:{},shape:null,layer:null,layerNumber:0};if(this.hits.length)i=c.set_difference(this.overSensors,n.sensors,{});else var i=e.extend({},this.overSensors);for(var r in i)i[r].set_over__(!1,n);if(this.hits.length){this.overSensors=n.sensors;for(var r in this.overSensors)this.overSensors[r].set_over__(!0,n)}else this.overSensors={};for(var r in this.activeSensors)this.activeSensors[r].set_motion__(n)}},h}),define("cobweb/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext",["jquery","cobweb/Fields"],function(e,t){function n(){this.keyDeviceSensorNode=null,this.addChildObjects("controlKey",new t.SFBool,"shiftKey",new t.SFBool,"altKey",new t.SFBool,"altGrKey",new t.SFBool)}return n.prototype={initialize:function(){this.getCanvas().bind("keydown.X3DKeyDeviceSensorContext",this.keydown.bind(this)),this.getCanvas().bind("keyup.X3DKeyDeviceSensorContext",this.keyup.bind(this))},setKeyDeviceSensorNode:function(e){this.keyDeviceSensorNode=e},getKeyDeviceSensorNode:function(){return this.keyDeviceSensorNode},getShiftKey:function(){return this.shiftKey_.getValue()},getControlKey:function(){return this.controlKey_.getValue()},getAltKey:function(){return this.altKey_.getValue()},getAltGrKey:function(){return this.altGrKey_.getValue()},keydown:function(e){switch(e.preventDefault(),e.stopImmediatePropagation(),this.keyDeviceSensorNode&&this.keyDeviceSensorNode.keydown(e),e.which){case 16:this.shiftKey_=!0;break;case 17:this.controlKey_=!0;break;case 18:this.altKey_=!0;break;case 49:this.getControlKey()&&(this.setBrowserOption("Shading","POINTSET"),this.getNotification().string_="Shading: Pointset");break;case 50:this.getControlKey()&&(this.setBrowserOption("Shading","WIREFRAME"),this.getNotification().string_="Shading: Wireframe");break;case 51:this.getControlKey()&&(this.setBrowserOption("Shading","FLAT"),this.getNotification().string_="Shading: Flat");break;case 52:this.getControlKey()&&(this.setBrowserOption("Shading","GOURAUD"),this.getNotification().string_="Shading: Gouraud");break;case 53:this.getControlKey()&&(this.setBrowserOption("Shading","PHONG"),this.getNotification().string_="Shading: Phong");break;case 83:this.getControlKey()&&(this.isLive().getValue()?this.endUpdate():this.beginUpdate(),this.getNotification().string_=this.isLive().getValue()?"Begin Update":"End Update");break;case 225:this.altGrKey_=!0;break;case 171:case 187:this.getControlKey()&&(this.getBrowserTimings().enabled_=!this.getBrowserTimings().enabled_.getValue());break;case 36:this.firstViewpoint();break;case 35:this.lastViewpoint();break;case 33:this.previousViewpoint();break;case 34:this.nextViewpoint()}},keyup:function(e){switch(e.preventDefault(),e.stopImmediatePropagation(),this.keyDeviceSensorNode&&this.keyDeviceSensorNode.keyup(e),e.which){case 16:this.shiftKey_=!1;break;case 17:this.controlKey_=!1;break;case 18:this.altKey_=!1;break;case 225:this.altGrKey_=!1}}},n}),define("cobweb/Components/Core/X3DBindableNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DBindableNode),this.layers=[]}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this),this.set_bind_.addInterest("set_bind__",this)},getCameraObject:function(){return!0},addLayer:function(e){this.layers.push(e)},transitionStart:function(){},set_bind__:function(){if(this.set_bind_.getValue()){this.layers=this.getLayers();for(e=0;e<this.layers.length;++e)this.bindToLayer(this.layers[e])}else for(var e=0;e<this.layers.length;++e)this.unbindFromLayer(this.layers[e])}}),i}),define("cobweb/Components/Time/X3DTimeDependentNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e){this.addType(i.X3DTimeDependentNode),this.startTimeValue=0,this.pauseTimeValue=0,this.resumeTimeValue=0,this.stopTimeValue=0,this.start=0,this.pause=0,this.pauseInterval=0,this.startTimeout=null,this.pauseTimeout=null,this.resumeTimeout=null,this.stopTimeout=null,this.disabled=!1}return r.prototype=e.extend(Object.create(n.prototype),{constructor:r,initialize:function(){n.prototype.initialize.call(this),this.addChildObjects("initialized",new t.SFTime,"isEvenLive",new t.SFBool),this.isLive().addInterest("set_live__",this),this.isEvenLive_.addInterest("_set_live__",this),this.initialized_.addInterest("set_loop__",this),this.enabled_.addInterest("set_enabled__",this),this.loop_.addInterest("set_loop__",this),this.startTime_.addInterest("set_startTime__",this),this.pauseTime_.addInterest("set_pauseTime__",this),this.resumeTime_.addInterest("set_resumeTime__",this),this.stopTime_.addInterest("set_stopTime__",this),this.startTimeValue=this.startTime_.getValue(),this.pauseTimeValue=this.pauseTime_.getValue(),this.resumeTimeValue=this.resumeTime_.getValue(),this.stopTimeValue=this.stopTime_.getValue(),this.initialized_=this.getBrowser().getCurrentTime()},getDisabled:function(){return this.disabled},getElapsedTime:function(){return this.getBrowser().getCurrentTime()-this.start-this.pauseInterval},getLiveState:function(){return this.getLive()&&(this.getExecutionContext().isLive().getValue()||this.isEvenLive_.getValue())},set_live__:function(){this.isLive().getValue()?this.disabled&&(this.disabled=!1,this.isActive_.getValue()&&!this.isPaused_.getValue()&&this.real_resume()):this.disabled||!this.isActive_.getValue()||this.isPaused_.getValue()||(this.disabled=!0,this.real_pause())},set_enabled__:function(){this.enabled_.getValue()?this.set_loop__():this.stop()},set_loop__:function(){this.enabled_.getValue()&&this.loop_.getValue()&&this.stopTimeValue<=this.startTimeValue&&this.startTimeValue<=this.getBrowser().getCurrentTime()&&this.do_start()},set_startTime__:function(){this.startTimeValue=this.startTime_.getValue(),this.enabled_.getValue()&&(this.removeTimeout("startTimeout"),this.startTimeValue<=this.getBrowser().getCurrentTime()?this.do_start():this.addTimeout("startTimeout","do_start",this.startTimeValue))},set_pauseTime__:function(){if(this.pauseTimeValue=this.pauseTime_.getValue(),this.enabled_.getValue()){if(this.removeTimeout("pauseTimeout"),this.pauseTimeValue<=this.resumeTimeValue)return;this.pauseTimeValue<=this.getBrowser().getCurrentTime()?this.do_pause():this.addTimeout("pauseTimeout","do_pause",this.pauseTimeValue)}},set_resumeTime__:function(){if(this.resumeTimeValue=this.resumeTime_.getValue(),this.enabled_.getValue()){if(this.removeTimeout("resumeTimeout"),this.resumeTimeValue<=this.pauseTimeValue)return;this.resumeTimeValue<=this.getBrowser().getCurrentTime()?this.do_resume():this.addTimeout("resumeTimeout","do_resume",this.resumeTimeValue)}},set_stopTime__:function(){if(this.stopTimeValue=this.stopTime_.getValue(),this.enabled_.getValue()){if(this.removeTimeout("stopTimeout"),this.stopTimeValue<=this.startTimeValue)return;this.stopTimeValue<=this.getBrowser().getCurrentTime()?this.do_stop():this.addTimeout("stopTimeout","do_stop",this.stopTimeValue)}},do_start:function(){this.isActive_.getValue()||(this.start=this.getBrowser().getCurrentTime(),this.pauseInterval=0,this.isActive_=!0,this.set_start(),this.isLive().getValue()?this.getBrowser().prepareEvents().addInterest("prepareEvents",this):this.disabled||(this.disabled=!0,this.real_pause()),this.elapsedTime_=0,this.cycleTime_=this.getBrowser().getCurrentTime())},do_pause:function(){this.isActive_.getValue()&&!this.isPaused_.getValue()&&(this.isPaused_=!0,this.pauseTimeValue!==this.getBrowser().getCurrentTime()&&(this.pauseTimeValue=this.getBrowser().getCurrentTime()),this.isLive().getValue()&&this.real_pause())},real_pause:function(){this.pause=performance.now(),this.set_pause(),this.getBrowser().prepareEvents().removeInterest("prepareEvents",this)},do_resume:function(){this.isActive_.getValue()&&this.isPaused_.getValue()&&(this.isPaused_=!1,this.resumeTimeValue!==this.getBrowser().getCurrentTime()&&(this.resumeTimeValue=this.getBrowser().getCurrentTime()),this.isLive().getValue()&&this.real_resume())},real_resume:function(){var e=(performance.now()-this.pause)/1e3;this.pauseInterval+=e,this.set_resume(e),this.getBrowser().prepareEvents().addInterest("prepareEvents",this),this.getBrowser().addBrowserEvent()},do_stop:function(){this.stop()},stop:function(){this.isActive_.getValue()&&(this.set_stop(),this.elapsedTime_=this.getElapsedTime(),this.isPaused_.getValue()&&(this.isPaused_=!1),this.isActive_=!1,this.isLive().getValue()&&this.getBrowser().prepareEvents().removeInterest("prepareEvents",this))},timeout:function(e){this.enabled_.getValue()&&(this.getBrowser().advanceTime(performance.now()),this[e]())},addTimeout:function(e,t,n){this.removeTimeout(e),this[e]=setTimeout(this.timeout.bind(this,t),1e3*(n-this.getBrowser().getCurrentTime()))},removeTimeout:function(e){clearTimeout(this[e]),this[e]=null},prepareEvents:function(){},set_start:function(){},set_pause:function(){},set_resume:function(){},set_stop:function(){}}),r}),define("cobweb/Components/Time/TimeSensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DSensorNode","cobweb/Components/Time/X3DTimeDependentNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.TimeSensor),this.addChildObjects("range",new t.MFFloat(0,0,1)),this.cycle=0,this.interval=0,this.first=0,this.last=1,this.scale=1}return a.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"enabled",new t.SFBool(!0)),new n(s.inputOutput,"cycleInterval",new t.SFTime(1)),new n(s.inputOutput,"loop",new t.SFBool),new n(s.inputOutput,"startTime",new t.SFTime),new n(s.inputOutput,"resumeTime",new t.SFTime),new n(s.inputOutput,"pauseTime",new t.SFTime),new n(s.inputOutput,"stopTime",new t.SFTime),new n(s.outputOnly,"isPaused",new t.SFBool),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"cycleTime",new t.SFTime),new n(s.outputOnly,"elapsedTime",new t.SFTime),new n(s.outputOnly,"fraction_changed",new t.SFFloat),new n(s.outputOnly,"time",new t.SFTime)]),getTypeName:function(){return"TimeSensor"},getComponentName:function(){return"Time"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this)},prepareEvents:function(){var e=this.getBrowser().getCurrentTime();if(e-this.cycle>=this.interval)this.loop_.getValue()?this.interval&&(this.cycle+=this.interval*Math.floor((e-this.cycle)/this.interval),this.fraction_changed_=this.last,this.elapsedTime_=this.getElapsedTime(),this.cycleTime_=e):(this.fraction_changed_=this.last,this.stop());else{var t=(e-this.cycle)/this.interval;this.fraction_changed_=this.first+(t-Math.floor(t))*this.scale,this.elapsedTime_=this.getElapsedTime()}this.time_=e},set_start:function(){this.first=this.range_[0],this.last=this.range_[2],this.scale=this.last-this.first;var e=(this.range_[1]-this.first)*this.cycleInterval_.getValue();this.interval=this.cycleInterval_.getValue()*this.scale,this.cycle=this.getBrowser().getCurrentTime()-e,this.fraction_changed_=this.range_[1],this.time_=this.getBrowser().getCurrentTime()},set_resume:function(e){this.cycle+=e}}),a}),define("cobweb/Components/Interpolation/X3DInterpolatorNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i){function r(e){t.call(this,e),this.addType(n.X3DInterpolatorNode)}return r.prototype=e.extend(Object.create(t.prototype),{constructor:r,setup:function(){this.set_key__(),this.key_.length&&this.interpolate(0,0,0),t.prototype.setup.call(this)},initialize:function(){t.prototype.initialize.call(this),this.set_fraction_.addInterest("set_fraction__",this),this.key_.addInterest("set_key__",this)},set_fraction__:function(){var e=this.key_,t=e.length,n=this.set_fraction_.getValue();switch(t){case 0:return;case 1:return this.interpolate(0,0,0);default:if(n<=e[0])return this.interpolate(0,1,0);var r=i.upperBound(e,0,t,n,i.less);if(r!==t){var o=r-1,s=(n-e[o])/(e[r]-e[o]);this.interpolate(o,r,i.clamp(s,0,1))}else this.interpolate(t-2,t-1,1)}},set_key__:function(){this.set_keyValue__()},set_keyValue__:function(){},interpolate:function(){}}),r}),define("cobweb/Components/Interpolation/EaseInEaseOut",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.EaseInEaseOut)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"easeInEaseOut",new t.MFVec2f),new n(o.outputOnly,"modifiedFraction_changed",new t.SFFloat)]),getTypeName:function(){return"EaseInEaseOut"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.easeInEaseOut_.addInterest("set_keyValue__",this)},set_keyValue__:function(){this.easeInEaseOut_.length<this.key_.length&&this.easeInEaseOut_.resize(this.key_.length,this.easeInEaseOut_.length?this.easeInEaseOut_[this.easeInEaseOut_.length-1]:new t.SFVec2f)},interpolate:function(e,t,n){var i=this.easeInEaseOut_[e].y,r=this.easeInEaseOut_[t].x,o=i+r;if(o<0)this.modifiedFraction_changed_=n;else{o>1&&(r/=o,i/=o);var s=1/(2-i-r);if(n<i)this.modifiedFraction_changed_=s/i*n*n;else if(n<=1-r)this.modifiedFraction_changed_=s*(2*n-i);else{var a=1-n;this.modifiedFraction_changed_=1-s*a*a/r}}}}),s}),define("cobweb/Components/Interpolation/PositionInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.PositionInterpolator)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFVec3f),new n(o.outputOnly,"value_changed",new t.SFVec3f)]),keyValue:new s(0,0,0),getTypeName:function(){return"PositionInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,n=this.keyValue_;n.length<e.length&&n.resize(e.length,n.length?n[n.length-1]:new t.SFVec3f)},interpolate:function(e,t,n){this.value_changed_=this.keyValue.assign(this.keyValue_[e].getValue()).lerp(this.keyValue_[t].getValue(),n)}}),a}),define("cobweb/Components/Interpolation/OrientationInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Rotation4"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.OrientationInterpolator)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFRotation),new n(o.outputOnly,"value_changed",new t.SFRotation)]),keyValue:new s,getTypeName:function(){return"OrientationInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,n=this.keyValue_;n.length<e.length&&n.resize(e.length,n.length?n[n.length-1]:new t.SFRotation)},interpolate:function(e,t,n){try{this.value_changed_=this.keyValue.assign(this.keyValue_[e].getValue()).slerp(this.keyValue_[t].getValue(),n)}catch(e){}}}),a}),define("cobweb/Components/Navigation/X3DViewpointNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DBindableNode","cobweb/Components/Time/TimeSensor","cobweb/Components/Interpolation/EaseInEaseOut","cobweb/Components/Interpolation/PositionInterpolator","cobweb/Components/Interpolation/OrientationInterpolator","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l,c,h,d){function p(e){n.call(this,e),this.addType(u.X3DViewpointNode),this.userPosition=new c(0,1,0),this.userOrientation=new h(0,0,1,0),this.userCenterOfRotation=new c(0,0,0),this.transformationMatrix=new d,this.cameraSpaceMatrix=new d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,10,1),this.inverseCameraSpaceMatrix=new d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,-10,1);var t=this.getBrowser();this.timeSensor=new i(t.getPrivateScene()),this.easeInEaseOut=new r(t.getPrivateScene()),this.positionInterpolator=new o(t.getPrivateScene()),this.orientationInterpolator=new s(t.getPrivateScene()),this.scaleInterpolator=new o(t.getPrivateScene()),this.scaleOrientationInterpolator=new s(t.getPrivateScene())}var f=new c(0,1,0),g=new c(0,0,1),m=new c(0,0,0),b=new h(0,0,1,0),w=new c(0,0,0),y=new h(0,0,1,0),x=new c(0,0,0),v=new c(0,0,0),_=new c(0,0,0),S=new c(0,0,0),C=new h(0,0,1,0);return p.prototype=e.extend(Object.create(n.prototype),{constructor:p,initialize:function(){n.prototype.initialize.call(this),this.addChildObjects("positionOffset",new t.SFVec3f,"orientationOffset",new t.SFRotation,"scaleOffset",new t.SFVec3f(1,1,1),"scaleOrientationOffset",new t.SFRotation,"centerOfRotationOffset",new t.SFVec3f,"fieldOfViewScale",new t.SFFloat(1)),this.timeSensor.stopTime_=1,this.timeSensor.setup(),this.easeInEaseOut.key_=[0,1],this.easeInEaseOut.easeInEaseOut_=[new l(0,0),new l(0,0)],this.easeInEaseOut.setup(),this.positionInterpolator.key_=[0,1],this.orientationInterpolator.key_=[0,1],this.scaleInterpolator.key_=[0,1],this.scaleOrientationInterpolator.key_=[0,1],this.positionInterpolator.setup(),this.orientationInterpolator.setup(),this.scaleInterpolator.setup(),this.scaleOrientationInterpolator.setup(),this.timeSensor.fraction_changed_.addFieldInterest(this.easeInEaseOut.set_fraction_),this.easeInEaseOut.modifiedFraction_changed_.addFieldInterest(this.positionInterpolator.set_fraction_),this.easeInEaseOut.modifiedFraction_changed_.addFieldInterest(this.orientationInterpolator.set_fraction_),this.easeInEaseOut.modifiedFraction_changed_.addFieldInterest(this.scaleInterpolator.set_fraction_),this.easeInEaseOut.modifiedFraction_changed_.addFieldInterest(this.scaleOrientationInterpolator.set_fraction_),this.positionInterpolator.value_changed_.addFieldInterest(this.positionOffset_),this.orientationInterpolator.value_changed_.addFieldInterest(this.orientationOffset_),this.scaleInterpolator.value_changed_.addFieldInterest(this.scaleOffset_),this.scaleOrientationInterpolator.value_changed_.addFieldInterest(this.scaleOrientationOffset_),this.isBound_.addInterest("set_bound__",this)},getEaseInEaseOut:function(){return this.easeInEaseOut},setInterpolators:function(){},bindToLayer:function(e){e.getViewpointStack().push(this)},unbindFromLayer:function(e){e.getViewpointStack().pop(this)},removeFromLayer:function(e){e.getViewpointStack().remove(this)},getPosition:function(){return this.position_.getValue()},getUserPosition:function(){return this.userPosition.assign(this.getPosition()).add(this.positionOffset_.getValue())},getOrientation:function(){return this.orientation_.getValue()},getUserOrientation:function(){return this.userOrientation.assign(this.getOrientation()).multRight(this.orientationOffset_.getValue())},getCenterOfRotation:function(){return this.centerOfRotation_.getValue()},getUserCenterOfRotation:function(){return this.userCenterOfRotation.assign(this.getCenterOfRotation()).add(this.centerOfRotationOffset_.getValue())},getProjectionMatrix:function(e){var t=e.getNavigationInfo();return this.getProjectionMatrixWithLimits(t.getNearValue(),t.getFarValue(this),e.getLayer().getViewport().getRectangle(e.getBrowser()))},getCameraSpaceMatrix:function(){return this.cameraSpaceMatrix},getInverseCameraSpaceMatrix:function(){return this.inverseCameraSpaceMatrix},getTransformationMatrix:function(){return this.transformationMatrix},getUpVector:function(){return f},getSpeedFactor:function(){return 1},getMaxZFar:function(){return 1e5},transitionStart:function(e){try{if(this.jump_.getValue()){var t=this.getLayers();this.retainUserOffsets_.getValue()||this.resetUserOffsets();for(o=0;o<t.length;++o){var n=t[o].getNavigationInfo();n.transitionStart_=!0;var i=n.getTransitionType(),r=n.transitionTime_.getValue()}switch(i){case"TELEPORT":for(var o=0;o<t.length;++o)t[o].getNavigationInfo().transitionComplete_=!0;return;case"ANIMATE":this.easeInEaseOut.easeInEaseOut_=[new l(0,1),new l(1,0)];break;default:this.easeInEaseOut.easeInEaseOut_=[new l(0,0),new l(0,0)]}this.timeSensor.cycleInterval_=r,this.timeSensor.stopTime_=this.getBrowser().getCurrentTime(),this.timeSensor.startTime_=this.getBrowser().getCurrentTime(),this.timeSensor.isActive_.addInterest("set_active__",this),this.getRelativeTransformation(e,m,b,w,y),this.positionInterpolator.keyValue_=[m,this.positionOffset_.getValue()],this.orientationInterpolator.keyValue_=[b,this.orientationOffset_.getValue()],this.scaleInterpolator.keyValue_=[w,this.scaleOffset_.getValue()],this.scaleOrientationInterpolator.keyValue_=[y,this.scaleOrientationOffset_.getValue()],this.positionOffset_=m,this.orientationOffset_=b,this.scaleOffset_=w,this.scaleOrientationOffset_=y,this.setInterpolators(e)}else this.getRelativeTransformation(e,m,b,w,y),this.positionOffset_=m,this.orientationOffset_=b,this.scaleOffset_=w,this.scaleOrientationOffset_=y,this.setInterpolators(e)}catch(e){console.log(e)}},transitionStop:function(){this.timeSensor.stopTime_=this.getBrowser().getCurrentTime(),this.timeSensor.isActive_.removeInterest("set_active__",this)},resetUserOffsets:function(){this.positionOffset_=c.Zero,this.orientationOffset_=h.Identity,this.scaleOffset_=c.One,this.scaleOrientationOffset_=h.Identity,this.centerOfRotationOffset_=c.Zero,this.fieldOfViewScale_=1},getRelativeTransformation:function(e,t,n,i,r){this.transformationMatrix.copy().multRight(e.getInverseCameraSpaceMatrix()).inverse().get(t,n,i,r),t.subtract(this.getPosition()),n.assign(this.getOrientation().copy().inverse().multRight(n))},straightenHorizon:function(e){return e.multVecRot(v.assign(g)),e.multVecRot(x.assign(f)),_.assign(v).cross(this.getUpVector()),S.assign(v).cross(x),C.setFromToVec(S,_),e.multRight(C)},lookAtPoint:function(e,t,n){if(this.getBrowser().getActiveLayer())try{this.getCameraSpaceMatrix().multVecMatrix(e),d.inverse(this.getTransformationMatrix()).multVecMatrix(e);var i=2*this.getBrowser().getActiveLayer().getNavigationInfo().getNearValue();this.lookAt(e,i,t,n)}catch(e){console.error(e)}},lookAt:function(e,t,n,i){for(var r=this.getLayers(),o=e.copy().add(this.getUserOrientation().multVecRot(new c(0,0,t))).subtract(this.getPosition()),s=0;s<r.length;++s)r[s].getNavigationInfo().transitionStart_=!0;this.timeSensor.cycleInterval_=.2,this.timeSensor.stopTime_=this.getBrowser().getCurrentTime(),this.timeSensor.startTime_=this.getBrowser().getCurrentTime(),this.timeSensor.isActive_.addInterest("set_active__",this),this.easeInEaseOut.easeInEaseOut_=[new l(0,1),new l(1,0)];var a=c.lerp(this.positionOffset_.getValue(),o,n),u=c.add(this.getPosition(),a).subtract(e),d=h.multRight(this.orientationOffset_.getValue(),new h(this.getUserOrientation().multVecRot(new c(0,0,1)),u));i&&(d=h.inverse(this.getOrientation()).multRight(this.straightenHorizon(h.multRight(this.getOrientation(),d)))),this.positionInterpolator.keyValue_=[this.positionOffset_.getValue(),a],this.orientationInterpolator.keyValue_=[this.orientationOffset_.getValue(),d],this.scaleInterpolator.keyValue_=[this.scaleOffset_.getValue(),this.scaleOffset_.getValue()],this.scaleOrientationInterpolator.keyValue_=[this.scaleOrientationOffset_.getValue(),this.scaleOrientationOffset_.getValue()],this.centerOfRotationOffset_=c.subtract(e,this.getCenterOfRotation()),this.set_bind_=!0},set_active__:function(e){if(!e.getValue()&&1===this.timeSensor.fraction_changed_.getValue()){for(var t=this.getLayers(),n=0;n<t.length;++n)t[n].getNavigationInfo().transitionComplete_=!0;this.easeInEaseOut.set_fraction_=1}},set_bound__:function(){this.isBound_.getValue()?this.getBrowser().getNotification().string_=this.description_:this.timeSensor.stopTime_=this.getBrowser().getCurrentTime()},traverse:function(e,t){t.getLayer().getViewpoints().push(this),this.transformationMatrix.assign(t.getModelViewMatrix().get())},update:function(){try{this.cameraSpaceMatrix.set(this.getUserPosition(),this.getUserOrientation(),this.scaleOffset_.getValue(),this.scaleOrientationOffset_.getValue()),this.cameraSpaceMatrix.multRight(this.transformationMatrix),this.inverseCameraSpaceMatrix.assign(this.cameraSpaceMatrix).inverse()}catch(e){console.log(e)}}}),p}),define("standard/Math/Geometry/Camera",["standard/Math/Numbers/Vector3"],function(e){var t=new e(0,0,0),n=new e(0,0,0);return{frustum:function(e,t,n,i,r,o,s){var a=t-e,u=i-n,l=o-r,c=2*r,h=(t+e)/a,d=(i+n)/u,p=-(o+r)/l,f=-c*o/l,g=c/a,m=c/u;return s.set(g,0,0,0,0,m,0,0,h,d,p,-1,0,0,f,0)},perspective:function(e,t,n,i,r,o){var s=Math.tan(e/2)*t;if(i>r){a=i*s/r;return this.frustum(-a,a,-s,s,t,n,o)}var a=r*s/i;return this.frustum(-s,s,-a,a,t,n,o)},ortho:function(e,t,n,i,r,o,s){var a=t-e,u=i-n,l=o-r,c=2/a,h=2/u,d=-2/l,p=-(t+e)/a,f=-(i+n)/u,g=-(o+r)/l;return s.set(c,0,0,0,0,h,0,0,0,0,d,0,p,f,g,1)},orthoBox:function(e,i){return e.getExtents(t,n),this.ortho(t.x,n.x,t.y,n.y,-n.z,-t.z,i)}}}),define("cobweb/Components/Navigation/OrthoViewpoint",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Navigation/X3DViewpointNode","cobweb/Bits/X3DConstants","standard/Math/Geometry/Camera","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(o.OrthoViewpoint),this.projectionMatrix=new l}var h=new u(0,0,0),d=new a(0,0);return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_bind",new t.SFBool),new n(o.inputOutput,"description",new t.SFString),new n(o.inputOutput,"position",new t.SFVec3f(0,0,10)),new n(o.inputOutput,"orientation",new t.SFRotation),new n(o.inputOutput,"centerOfRotation",new t.SFVec3f),new n(o.inputOutput,"fieldOfView",new t.MFFloat(-1,-1,1,1)),new n(o.inputOutput,"jump",new t.SFBool(!0)),new n(o.inputOutput,"retainUserOffsets",new t.SFBool),new n(o.outputOnly,"isBound",new t.SFBool),new n(o.outputOnly,"bindTime",new t.SFTime)]),getTypeName:function(){return"OrthoViewpoint"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.fieldOfView_.addInterest("set_fieldOfView___",this),this.fieldOfViewScale_.addInterest("set_fieldOfView___",this),this.set_fieldOfView___()},set_fieldOfView___:function(){var e=this.fieldOfView_.length,t=this.fieldOfViewScale_.getValue();this.minimumX=(e>0?this.fieldOfView_[0]:-1)*t,this.minimumY=(e>1?this.fieldOfView_[1]:-1)*t,this.maximumX=(e>2?this.fieldOfView_[2]:1)*t,this.maximumY=(e>3?this.fieldOfView_[3]:1)*t,this.sizeX=this.maximumX-this.minimumX,this.sizeY=this.maximumY-this.minimumY},getMinimumX:function(){return this.minimumX},getMinimumY:function(){return this.minimumY},getMaximumX:function(){return this.maximumX},getMaximumY:function(){return this.maximumY},getSizeX:function(){return this.sizeX},getSizeY:function(){return this.sizeY},getScreenScale:function(e,t){var n=t[2],i=t[3],r=this.sizeX,o=this.sizeY;if(n/i>r/o){s=o/i;return h.set(s,s,s)}var s=r/n;return h.set(s,s,s)},getViewportSize:function(e){var t=e[2],n=e[3],i=this.sizeX,r=this.sizeY,o=t/n;return o>i/r?d.set(r*o,r):d.set(i,i/o)},getLookAtDistance:function(e){return e.size.abs()/2+10},getProjectionMatrixWithLimits:function(e,t,n){var i=n[2]/n[3],r=this.sizeX,o=this.sizeY;if(i>r/o){var a=(this.minimumX+this.maximumX)/2,u=o*i/2;return s.ortho(a-u,a+u,this.minimumY,this.maximumY,e,t,this.projectionMatrix)}var a=(this.minimumY+this.maximumY)/2,u=r/i/2;return s.ortho(this.minimumX,this.maximumX,a-u,a+u,e,t,this.projectionMatrix)}}),c}),define("cobweb/Browser/Navigation/X3DViewer",["jquery","cobweb/Basic/X3DBaseNode","cobweb/Components/Navigation/OrthoViewpoint","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o){function s(e){t.call(this,e)}function a(e,t,n){var i=Math.sqrt(t*t+n*n);if(i<e*Math.sqrt(.5))return Math.sqrt(e*e-i*i);var r=e/Math.sqrt(2);return r*r/i}var u=new r(0,0,0),l=new r(0,0,0),c=new r(0,0,0);return s.prototype=e.extend(Object.create(t.prototype),{constructor:s,initialize:function(){},getActiveLayer:function(){return this.getBrowser().getActiveLayer()},getViewport:function(){return this.getBrowser().getActiveLayer().getViewport()},getNavigationInfo:function(){return this.getBrowser().getActiveLayer().getNavigationInfo()},getActiveViewpoint:function(){return this.getBrowser().getActiveLayer().getViewpoint()},getScrollDirection:function(e){return e.originalEvent.wheelDelta?-e.originalEvent.wheelDelta/120:e.originalEvent.detail?e.originalEvent.detail/3:0},getPointOnCenterPlane:function(e,t,r){try{var s=this.getNavigationInfo(),a=this.getActiveViewpoint(),h=this.getViewport().getRectangle(this.getBrowser()),d=a.getProjectionMatrixWithLimits(s.getNearValue(),s.getFarValue(a),h);if(i.unProjectPoint(e,this.getBrowser().getViewport()[3]-t,.9,o.Identity,d,h,c),a instanceof n)return r.set(c.x,c.y,-this.getDistanceToCenter(l).abs());var p=c.normalize();return r.assign(p).multiply(this.getDistanceToCenter(l).abs()/p.dot(u.set(0,0,-1)))}catch(e){return console.log(e),r.set(0,0,0)}},getDistanceToCenter:function(e){var t=this.getActiveViewpoint();return e.assign(t.getUserPosition()).subtract(t.getUserCenterOfRotation())},trackballProjectToSphere:function(e,t,n){return e=e/this.getBrowser().getViewport()[2]-.5,t=-t/this.getBrowser().getViewport()[3]+.5,n.set(e,t,a(.5,e,t))},lookAt:function(e,t,n){if(this.touch(e,t)){var i=this.getBrowser().getNearestHit();this.getActiveViewpoint().lookAtPoint(i.intersection.point,.381966,n)}},touch:function(e,t){return this.getBrowser().touch(e,t),this.getBrowser().getHits().length},dispose:function(){}}),s});var jQueryMouseWheel=function(e){function t(t){var n=t||window.event,i=[].slice.call(arguments,1),r=0,o=0,s=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(r=n.wheelDelta/120),n.detail&&(r=-n.detail/3),s=r,void 0!==n.axis&&n.axis===n.HORIZONTAL_AXIS&&(s=0,o=-1*r),void 0!==n.wheelDeltaY&&(s=n.wheelDeltaY/120),void 0!==n.wheelDeltaX&&(o=-1*n.wheelDeltaX/120),i.unshift(t,r,o,s),(e.event.dispatch||e.event.handle).apply(this,i)}var n=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var i=n.length;i;)e.event.fixHooks[n[--i]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=n.length;e;)this.addEventListener(n[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=n.length;e;)this.removeEventListener(n[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})};define("jquery-mousewheel/jquery.mousewheel",["jquery"],jQueryMouseWheel),define("jquery-mousewheel",["jquery-mousewheel/jquery.mousewheel"],function(e){return e}),define("cobweb/Browser/Navigation/ExamineViewer",["jquery","cobweb/Browser/Navigation/X3DViewer","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","lib/gettext","jquery-mousewheel"],function(e,t,n,i,r){function o(e){t.call(this,e),this.button=-1,this.orientationOffset=new i(0,0,1,0),this.rotation=new i(0,0,1,0),this.fromVector=new n(0,0,0),this.toVector=new n(0,0,0),this.fromPoint=new n(0,0,0),this.toPoint=new n(0,0,0),this.pressTime=0,this.motionTime=0,this.spinId=void 0}var s=new n(0,0,0),a=new n(0,0,0),u=new n(0,0,0),l=new n(0,0,0),c=new i(0,0,1,0),h=new i(0,0,1,0),d=new i(0,0,1,0);return o.prototype=e.extend(Object.create(t.prototype),{constructor:o,initialize:function(){t.prototype.initialize.call(this);var e=this.getBrowser().getCanvas();e.bind("mousedown.ExamineViewer",this.mousedown.bind(this)),e.bind("mouseup.ExamineViewer",this.mouseup.bind(this)),e.bind("dblclick.ExamineViewer",this.dblclick.bind(this)),e.bind("mousewheel.ExamineViewer",this.mousewheel.bind(this))},mousedown:function(t){if(!(this.button>=0)){this.pressTime=performance.now();var n=this.getBrowser().getCanvas().offset(),r=t.pageX-n.left,o=t.pageY-n.top;switch(t.button){case 0:t.preventDefault(),t.stopImmediatePropagation(),this.button=t.button,e(document).bind("mouseup.ExamineViewer"+this.getId(),this.mouseup.bind(this)),e(document).bind("mousemove.ExamineViewer"+this.getId(),this.mousemove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.trackballProjectToSphere(r,o,this.fromVector),this.rotation.assign(i.Identity),this.motionTime=0;break;case 1:t.preventDefault(),t.stopImmediatePropagation(),this.button=t.button,this.getBrowser().getCanvas().unbind("mousemove.ExamineViewer"),e(document).bind("mouseup.ExamineViewer"+this.getId(),this.mouseup.bind(this)),e(document).bind("mousemove.ExamineViewer"+this.getId(),this.mousemove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.getPointOnCenterPlane(r,o,this.fromPoint)}}},mouseup:function(t){if(t.button===this.button)switch(this.button=-1,e(document).unbind("mousemove.ExamineViewer"+this.getId()),e(document).unbind("mouseup.ExamineViewer"+this.getId()),t.button){case 0:if(t.preventDefault(),t.stopImmediatePropagation(),this.getBrowser().setCursor("DEFAULT"),Math.abs(this.rotation.angle)>.006&&performance.now()-this.motionTime<10)try{this.rotation.assign(c.assign(i.Identity).slerp(this.rotation,.6)),this.addSpinning()}catch(e){console.log(e)}break;case 1:t.preventDefault(),t.stopImmediatePropagation(),this.getBrowser().setCursor("DEFAULT")}},dblclick:function(e){e.preventDefault(),e.stopImmediatePropagation();var t=this.getBrowser().getCanvas().offset(),n=e.pageX-t.left,i=this.getBrowser().getCanvas().height()-(e.pageY-t.top);this.lookAt(n,i)},mousemove:function(e){var t=this.getBrowser().getCanvas().offset(),n=e.pageX-t.left,i=e.pageY-t.top;switch(this.button){case 0:e.preventDefault();var r=this.getActiveViewpoint(),o=this.trackballProjectToSphere(n,i,this.toVector);if(this.rotation.setFromToVec(o,this.fromVector),Math.abs(this.rotation.angle)<.006&&performance.now()-this.pressTime<50)return!1;r.orientationOffset_=this.getOrientationOffset(),r.positionOffset_=this.getPositionOffset(),this.fromVector.assign(o),this.motionTime=performance.now();break;case 1:e.preventDefault(),e.stopImmediatePropagation();var r=this.getActiveViewpoint(),u=this.getPointOnCenterPlane(n,i,this.toPoint),c=r.getUserOrientation().multVecRot(l.assign(this.fromPoint).subtract(u));r.positionOffset_=s.assign(r.positionOffset_.getValue()).add(c),r.centerOfRotationOffset_=a.assign(r.centerOfRotationOffset_.getValue()).add(c),this.fromPoint.assign(u)}},mousewheel:function(e){e.preventDefault(),e.stopImmediatePropagation();var t=this.getScrollDirection(e),n=this.getActiveViewpoint(),i=this.getDistanceToCenter(u).multiply(.02);n.getUserOrientation().multVecRot(s.set(0,0,i.abs())),t<0?n.positionOffset_=n.positionOffset_.getValue().subtract(s):t>0&&(n.positionOffset_=n.positionOffset_.getValue().add(s))},getPositionOffset:function(){var e=this.getActiveViewpoint();return this.getDistanceToCenter(u),h.assign(this.orientationOffset).inverse().multRight(e.orientationOffset_.getValue()).multVecRot(l.assign(u)).subtract(u).add(e.positionOffset_.getValue())},getOrientationOffset:function(){var e=this.getActiveViewpoint();return this.orientationOffset.assign(e.orientationOffset_.getValue()),d.assign(e.getOrientation()).inverse().multRight(this.rotation).multRight(e.getUserOrientation())},spin:function(){var e=this.getActiveViewpoint();e.orientationOffset_=this.getOrientationOffset(),e.positionOffset_=this.getPositionOffset()},addSpinning:function(){this.spinId||(this.spinId=setInterval(this.spin.bind(this),1e3/60))},disconnect:function(){clearInterval(this.spinId),this.spinId=void 0},dispose:function(){this.disconnect(),this.getBrowser().getCanvas().unbind(".ExamineViewer"),e(document).unbind(".ExamineViewer"+this.getId())}}),o}),define("cobweb/Browser/Navigation/X3DFlyViewer",["jquery","cobweb/Browser/Navigation/X3DViewer","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Camera","jquery-mousewheel"],function(e,t,n,i,r,o){function s(e){t.call(this,e);var o=this.getBrowser().getContext();this.button=-1,this.fromVector=new n(0,0,0),this.toVector=new n(0,0,0),this.direction=new n(0,0,0),this.sourceRotation=new i(0,0,1,0),this.destinationRotation=new i(0,0,1,0),this.startTime=0,this.lineBuffer=o.createBuffer(),this.lineCount=2,this.lineVertices=new Array(4*this.lineCount),this.lineArray=new Float32Array(this.lineVertices),this.event=null,this.projectionMatrix=new r,this.projectionMatrixArray=new Float32Array(this.projectionMatrix),this.modelViewMatrixArray=new Float32Array(this.projectionMatrix)}var a=Math.PI/32,u=new n(0,1,0),l=(new n(0,0,1),new Float32Array([0,0,0])),c=new Float32Array([1,1,1]),h=new n(0,0,0),d=new n(0,0,0),p=new n(0,0,0),f=new n(0,0,0),g=new n(0,0,0),m=new i(0,0,1,0),b=new i(0,0,1,0),w=new i(0,0,1,0),y=new i(0,0,1,0),x=new i(0,0,1,0),v=new i(0,0,1,0);return s.prototype=e.extend(Object.create(t.prototype),{constructor:s,initialize:function(){t.prototype.initialize.call(this);var e=this.getBrowser().getCanvas();e.bind("mousedown.X3DFlyViewer",this.mousedown.bind(this)),e.bind("mouseup.X3DFlyViewer",this.mouseup.bind(this)),e.bind("mousewheel.X3DFlyViewer",this.mousewheel.bind(this)),this.getBrowser().controlKey_.addInterest("set_controlKey_",this)},addCollision:function(){},removeCollision:function(){},set_controlKey_:function(){this.event&&0===this.event.button&&(this.button=-1,this.mousedown(this.event))},mousedown:function(t){if(!(this.button>=0)){this.event=t;var n=this.getBrowser().getCanvas().offset(),i=t.pageX-n.left,r=t.pageY-n.top;switch(t.button){case 0:t.preventDefault(),t.stopImmediatePropagation(),this.button=t.button,e(document).bind("mouseup.X3DFlyViewer"+this.getId(),this.mouseup.bind(this)),e(document).bind("mousemove.X3DFlyViewer"+this.getId(),this.mousemove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.addCollision(),this.getBrowser().getControlKey()?this.trackballProjectToSphere(i,r,this.fromVector):(this.fromVector.set(i,0,r),this.toVector.assign(this.fromVector),this.direction.set(0,0,0),this.getBrowser().getBrowserOption("Rubberband")&&this.getBrowser().finished().addInterest("display",this,0));break;case 1:t.preventDefault(),t.stopImmediatePropagation(),this.button=t.button,e(document).bind("mouseup.X3DFlyViewer"+this.getId(),this.mouseup.bind(this)),e(document).bind("mousemove.X3DFlyViewer"+this.getId(),this.mousemove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.addCollision(),this.fromVector.set(i,-r,0),this.toVector.assign(this.fromVector),this.getBrowser().getBrowserOption("Rubberband")&&this.getBrowser().finished().addInterest("display",this,1)}}},mouseup:function(t){t.preventDefault(),t.button===this.button&&(this.event=null,this.button=-1,e(document).unbind("mousemove.X3DFlyViewer"+this.getId()),e(document).unbind("mouseup.X3DFlyViewer"+this.getId()),this.disconnect(),this.getBrowser().setCursor("DEFAULT"),this.removeCollision())},mousemove:function(e){this.getBrowser().addBrowserEvent(),this.event=e;var t=this.getBrowser().getCanvas().offset(),n=e.pageX-t.left,i=e.pageY-t.top;switch(this.button){case 0:if(this.getBrowser().getControlKey()){e.preventDefault();var r=this.getActiveViewpoint(),o=r.getUserOrientation(),s=this.trackballProjectToSphere(n,i,this.toVector);b.setFromToVec(s,this.fromVector).multRight(o),r.straightenHorizon(b),r.orientationOffset_=w.assign(r.getOrientation()).inverse().multRight(b),this.fromVector.assign(s)}else this.toVector.set(n,0,i),this.direction.assign(this.toVector).subtract(this.fromVector),this.addFly();break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.toVector.set(n,-i,0),this.direction.assign(this.toVector).subtract(this.fromVector),this.addPan()}},mousewheel:function(e){e.preventDefault(),e.stopImmediatePropagation();var t=this.getScrollDirection(e),n=this.getActiveViewpoint();n.transitionStop(),t<0?(this.sourceRotation.assign(n.orientationOffset_.getValue()),this.destinationRotation=this.sourceRotation.multRight(m.setAxisAngle(n.getUserOrientation().multVecRot(g.set(-1,0,0)),a)),this.addRoll()):t>0&&(this.sourceRotation.assign(n.orientationOffset_.getValue()),this.destinationRotation=this.sourceRotation.multRight(m.setAxisAngle(n.getUserOrientation().multVecRot(g.set(1,0,0)),a)),this.addRoll())},fly:function(){var e=performance.now(),t=(e-this.startTime)/1e3,n=this.getNavigationInfo(),r=this.getActiveViewpoint();p.assign(r.getUpVector()),x.setFromToVec(u,p),this.direction.z>0?y.setFromToVec(x.multVecRot(f.assign(this.direction)),x.multVecRot(g.set(0,0,1))):y.setFromToVec(x.multVecRot(g.set(0,0,-1)),x.multVecRot(f.assign(this.direction)));var o=this.direction.abs(),s=1-y.angle/(Math.PI/2);s*=n.speed_.getValue(),s*=r.getSpeedFactor(),s*=this.getBrowser().getShiftKey()?.028:.007,s*=t;var a=this.getTranslationOffset(f.assign(this.direction).multiply(s));this.getActiveLayer().constrainTranslation(a,!0),r.positionOffset_=a.add(r.positionOffset_.getValue());var l=1.4*t;l*=Math.pow(o/(o+40),2),r.orientationOffset_=w.assign(i.Identity).slerp(y,l).multLeft(r.orientationOffset_.getValue()),v.setFromToVec(p,r.getUpVector()),r.orientationOffset_=v.multLeft(r.orientationOffset_.getValue()),this.startTime=e},pan:function(){var e=performance.now(),t=(e-this.startTime)/1e3,n=this.getNavigationInfo(),i=this.getActiveViewpoint(),r=i.getUpVector();this.constrainPanDirection(f.assign(this.direction));var o=1;o*=n.speed_.getValue(),o*=i.getSpeedFactor(),o*=this.getBrowser().getShiftKey()?.0098:.007,o*=t;var s=i.getUserOrientation().multRight(m.setFromToVec(i.getUserOrientation().multVecRot(g.assign(u)),r)).multVecRot(f.multiply(o));this.getActiveLayer().constrainTranslation(s,!0),i.positionOffset_=s.add(i.positionOffset_.getValue()),this.startTime=e},roll:function(){var e=(performance.now()-this.startTime)/1e3;if(e>.2)return this.disconnect();this.getActiveViewpoint().orientationOffset_=w.assign(this.sourceRotation).slerp(this.destinationRotation,e/.2)},addFly:function(){this.startTime||(this.getBrowser().prepareEvents().addInterest("fly",this),this.getBrowser().addBrowserEvent(),this.startTime=performance.now())},addPan:function(){this.startTime||(this.getBrowser().prepareEvents().addInterest("pan",this),this.getBrowser().addBrowserEvent(),this.startTime=performance.now())},addRoll:function(){this.startTime||(this.getBrowser().prepareEvents().addInterest("roll",this),this.getBrowser().addBrowserEvent(),this.startTime=performance.now())},display:function(e,t){var n=this.getBrowser(),i=n.getViewport(),r=i[2],s=i[3];o.ortho(0,r,0,s,-1,1,this.projectionMatrix),this.projectionMatrixArray.set(this.projectionMatrix),0===t?(h.set(this.fromVector.x,s-this.fromVector.z,0),d.set(this.toVector.x,s-this.toVector.z,0)):(h.set(this.fromVector.x,s+this.fromVector.y,0),d.set(this.toVector.x,s+this.toVector.y,0)),this.transfer(h,d);var a=n.getContext(),u=n.getLineShader(),p=a.getParameter(a.LINE_WIDTH);u.useProgram(a),u.enableVertexAttribute(a,this.lineBuffer),a.uniform4fv(u.x3d_ClipPlane[0],u.x3d_NoneClipPlane),a.uniform1i(u.x3d_FogType,0),a.uniform1i(u.x3d_ColorMaterial,!1),a.uniform1i(u.x3d_Lighting,!0),a.uniformMatrix4fv(u.x3d_ProjectionMatrix,!1,this.projectionMatrixArray),a.uniformMatrix4fv(u.x3d_ModelViewMatrix,!1,this.modelViewMatrixArray),a.disable(a.DEPTH_TEST),a.lineWidth(2),a.uniform3fv(u.x3d_EmissiveColor,l),a.uniform1f(u.x3d_Transparency,0),a.drawArrays(a.LINES,0,this.lineCount),a.lineWidth(1),a.uniform3fv(u.x3d_EmissiveColor,c),a.drawArrays(a.LINES,0,this.lineCount),a.enable(a.DEPTH_TEST),a.lineWidth(p)},transfer:function(e,t){var n=this.getBrowser().getContext(),i=this.lineVertices;i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=1,i[4]=t.x,i[5]=t.y,i[6]=t.z,i[7]=1,this.lineArray.set(i),n.bindBuffer(n.ARRAY_BUFFER,this.lineBuffer),n.bufferData(n.ARRAY_BUFFER,this.lineArray,n.STATIC_DRAW)},disconnect:function(){var e=this.getBrowser();e.addBrowserEvent(),e.prepareEvents().removeInterest("fly",this),e.prepareEvents().removeInterest("pan",this),e.prepareEvents().removeInterest("roll",this),e.finished().removeInterest("display",this),this.startTime=0},dispose:function(){this.disconnect(),this.getBrowser().controlKey_.removeInterest("set_controlKey_",this),this.getBrowser().getCanvas().unbind(".X3DFlyViewer"),e(document).unbind(".X3DFlyViewer"+this.getId())}}),s}),define("cobweb/Browser/Navigation/WalkViewer",["cobweb/Browser/Navigation/X3DFlyViewer","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","lib/gettext"],function(e,t,n,i){function r(t){e.call(this,t)}var o=new t(0,1,0);return r.prototype=$.extend(Object.create(e.prototype),{constructor:r,initialize:function(){e.prototype.initialize.call(this),this.getBrowser().addCollision(this)},getTranslationOffset:function(e){var t=this.getActiveViewpoint(),i=t.getUpVector(),r=t.getUserOrientation().copy();return r.multRight(new n(r.multVecRot(o.copy()),i)).multVecRot(e)},constrainPanDirection:function(e){return e.y<0&&(e.y=0),e},dispose:function(){this.getBrowser().removeCollision(this),e.prototype.dispose.call(this)}}),r}),define("cobweb/Browser/Navigation/FlyViewer",["cobweb/Browser/Navigation/X3DFlyViewer","lib/gettext"],function(e,t){function n(t){e.call(this,t)}return n.prototype=$.extend(Object.create(e.prototype),{constructor:n,addCollision:function(){this.getBrowser().addCollision(this)},removeCollision:function(){this.getBrowser().removeCollision(this)},getTranslationOffset:function(e){return this.getActiveViewpoint().getUserOrientation().multVecRot(e)},constrainPanDirection:function(e){return e}}),n}),define("cobweb/Components/Interpolation/ScalarInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.ScalarInterpolator)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFFloat),new n(o.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"ScalarInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,t=this.keyValue_;t.length<e.length&&t.resize(e.length,t.length?t[t.length-1]:0)},interpolate:function(e,t,n){this.value_changed_=s.lerp(this.keyValue_[e],this.keyValue_[t],n)}}),a}),define("cobweb/Components/Navigation/Viewpoint",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Navigation/X3DViewpointNode","cobweb/Components/Interpolation/ScalarInterpolator","cobweb/Bits/X3DConstants","standard/Math/Geometry/Camera","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(s.Viewpoint),this.projectionMatrix=new l,this.fieldOfViewInterpolator=new o(this.getBrowser().getPrivateScene())}var h=new u(0,0,1),d=new u(0,0,0),p=new u(0,0,0);return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_bind",new t.SFBool),new n(s.inputOutput,"description",new t.SFString),new n(s.inputOutput,"position",new t.SFVec3f(0,0,10)),new n(s.inputOutput,"orientation",new t.SFRotation),new n(s.inputOutput,"centerOfRotation",new t.SFVec3f),new n(s.inputOutput,"fieldOfView",new t.SFFloat(.7854)),new n(s.inputOutput,"jump",new t.SFBool(!0)),new n(s.inputOutput,"retainUserOffsets",new t.SFBool),new n(s.outputOnly,"isBound",new t.SFBool),new n(s.outputOnly,"bindTime",new t.SFTime)]),getTypeName:function(){return"Viewpoint"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.fieldOfViewInterpolator.key_=[0,1],this.fieldOfViewInterpolator.setup(),this.getEaseInEaseOut().modifiedFraction_changed_.addFieldInterest(this.fieldOfViewInterpolator.set_fraction_),this.fieldOfViewInterpolator.value_changed_.addFieldInterest(this.fieldOfViewScale_)},setInterpolators:function(e){if(e.getType().indexOf(s.Viewpoint)<0)this.fieldOfViewInterpolator.keyValue_=[this.fieldOfViewScale_.getValue(),this.fieldOfViewScale_.getValue()];else{var t=e.getFieldOfView()/this.fieldOfView_.getValue();this.fieldOfViewInterpolator.keyValue_=[t,this.fieldOfViewScale_.getValue()],this.fieldOfViewScale_=t}},getFieldOfView:function(){var e=this.fieldOfView_.getValue()*this.fieldOfViewScale_.getValue();return e>0&&e<Math.PI?e:Math.PI/4},getScreenScale:function(e,t){var n=t[2],i=t[3],r=2*Math.tan(this.getFieldOfView()/2)*e.abs();return r*=Math.abs(p.assign(e).normalize().dot(h)),r/=n>i?i:n,d.set(r,r,r)},getLookAtDistance:function(e){return e.size.abs()/2/Math.tan(this.getFieldOfView()/2)},getProjectionMatrixWithLimits:function(e,t,n){return a.perspective(this.getFieldOfView(),e,t,n[2],n[3],this.projectionMatrix)}}),c}),define("standard/Math/Geometry/Spheroid3",[],function(){function e(e,t){switch(arguments.length){case 0:this.semiMajorAxis=0,this.semiMinorAxis=0;break;case 2:this.semiMajorAxis=e,this.semiMinorAxis=t;break;case 3:var n=arguments[1];this.semiMajorAxis=e,this.semiMinorAxis=e*(1-1/n)}}return e.prototype={constructor:e,getSemiMajorAxis:function(){return this.semiMajorAxis},getSemiMinorAxis:function(){return this.semiMinorAxis},toString:function(){return this.semiMajorAxis+" "+this.semiMinorAxis}},e}),define("standard/Geospatial/ReferenceEllipsoids",["standard/Math/Geometry/Spheroid3"],function(e){return{AA:new e(6377563.396,299.3249646,!0),AM:new e(6377340.189,299.3249646,!0),AN:new e(6378160,298.25,!0),BN:new e(6377483.865,299.1528128,!0),BR:new e(6377397.155,299.1528128,!0),CC:new e(6378206.4,294.9786982,!0),CD:new e(6378249.145,293.465,!0),EA:new e(6377276.345,300.8017,!0),EB:new e(6377298.556,300.8017,!0),EC:new e(6377301.243,300.8017,!0),ED:new e(6377295.664,300.8017,!0),EE:new e(6377304.063,300.8017,!0),EF:new e(6377309.613,300.8017,!0),FA:new e(6378155,298.3,!0),HE:new e(6378200,298.3,!0),HO:new e(6378270,297,!0),ID:new e(6378160,298.247,!0),IN:new e(6378388,297,!0),KA:new e(6378245,298.3,!0),RF:new e(6378137,298.257222101,!0),SA:new e(6378160,298.25,!0),WD:new e(6378135,298.26,!0),WE:new e(6378137,298.257223563,!0),SUN:new e(696342e3,1/9e-6,!0),MERCURY:new e(2439700,2439700),VENUS:new e(6051800,6051800),MOON:new e(1738140,1735970),MARS:new e(3395428,3377678),JUPITER:new e(71492e3,66854e3),SATURN:new e(60268e3,54364e3),URANUS:new e(2555e3,24973e3),NEPTUNE:new e(24764e3,24341e3),PLUTO:new e(1153e3,1153e3)}}),define("standard/Geospatial/Geodetic",["standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t){function n(e,t,n){this.longitudeFirst=!t,this.degrees=!n,this.a=e.getSemiMajorAxis(),this.c=e.getSemiMinorAxis(),this.c2a2=Math.pow(e.getSemiMinorAxis()/this.a,2),this.ecc2=1-this.c2a2}return n.prototype={constructor:n,convert:function(e,t){var n=e.z;if(this.longitudeFirst){i=e.y;r=e.x}else var i=e.x,r=e.y;return this.degrees&&(i*=Math.PI/180,r*=Math.PI/180),this.convertRadians(i,r,n,t)},convertRadians:function(e,t,n,i){var r=Math.sin(e),o=Math.pow(r,2),s=Math.cos(e),a=this.a/Math.sqrt(1-this.ecc2*o),u=(a+n)*s;return i.set(u*Math.cos(t),u*Math.sin(t),(a*this.c2a2+n)*r)},apply:function(e,t){if(this.applyRadians(e,t),this.degrees&&(t.x*=180/Math.PI,t.y*=180/Math.PI),this.longitudeFirst){var n=t.x;t.x=t.y,t.y=n}return t},applyRadians:function(e,t){var n=e.x,i=e.y,r=e.z,o=Math.sqrt(n*n+i*i);if(0==o)return t.set(Math.PI,0,r-this.c);for(var s=0,a=Math.atan2(i,n),u=0,l=this.a,c=l,h=this.ecc2,d=0;d<30;++d){var p=u,f=s;s=Math.atan(r/o/(1-h*c/(c+u)));var g=Math.sin(s);if(c=l/Math.sqrt(1-h*g*g),u=o/Math.cos(s)-c,Math.abs(u-p)<.001&&Math.abs(s-f)<1e-10)break}return t.set(s,a,u)},normal:function(e,t){var n=this.applyRadians(e,t),i=n.x,r=n.y,o=Math.cos(i),s=Math.cos(r)*o,a=Math.sin(r)*o,u=Math.sin(i);return t.set(s,a,u)}},n}),define("standard/Geospatial/UniversalTransverseMercator",["standard/Geospatial/Geodetic","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t,n){function i(t,i,o,s){var a=t.getSemiMajorAxis(),u=1-Math.pow(t.getSemiMinorAxis()/a,2),l=u/(1-u),c=(1-Math.sqrt(1-u))/(1+Math.sqrt(1-u));this.southernHemisphere=!o,this.eastingFirst=!s,this.a=a,this.ecc2=u,this.EE=l,this.E8=8*l,this.E9=9*l,this.E252=252*l,this.e1=c,this.A=r*(a*(1-u/4-3*u*u/64-5*u*u*u/256)),this.B=3*c/2-7*c*c*c/32,this.C=21*c*c/16-55*c*c*c*c/32,this.D=151*c*c*c/96,this.E=a*(1-u),this.W=1-u/4-3*u*u/64-5*u*u*u/256,this.X=3*u/8+3*u*u/32+45*u*u*u/1024,this.Y=15*u*u/256+45*u*u*u/1024,this.Z=35*u*u*u/3072,this.longitude0=n.radians(6*i-183),this.geodeticConverter=new e(t,!0,!0)}var r=.9996;return i.prototype={constructor:i,convert:function(e,t){if(this.eastingFirst){n=e.y;i=e.x}else var n=e.x,i=e.y;var o=this.southernHemisphere;n<0&&(o=!this.southernHemisphere,n=-n),o&&(n-=1e7),i-=5e5;var s=n/this.A,a=s+this.B*Math.sin(2*s)+this.C*Math.sin(4*s)+this.D*Math.sin(6*s),u=Math.pow(Math.sin(a),2),l=Math.cos(a),c=Math.tan(a),h=this.a/Math.sqrt(1-this.ecc2*u),d=Math.pow(c,2),p=Math.pow(c,8),f=this.EE*d,g=f*f,m=this.E/Math.pow(1-this.ecc2*u,1.5),b=i/(h*r),w=(5+3*d+10*f-4*g-this.E9)*Math.pow(b,4)/24,y=(61+90*d+298*f+45*p-this.E252-3*g)*Math.pow(b,6)/720,x=(5-2*f+28*d-3*g+this.E8+24*p)*Math.pow(b,5)/120,v=a-h*c/m*(b*b/2-w+y),_=this.longitude0+(b-(1+2*d+f)*Math.pow(b,3)/6+x)/l;return this.geodeticConverter.convertRadians(v,_,e.z,t)},apply:function(e,t){var n=this.geodeticConverter.applyRadians(e,t),i=n.x,o=n.y,s=Math.tan(i),a=Math.cos(i),u=this.EE,l=this.a/Math.sqrt(1-this.ecc2*Math.pow(Math.sin(i),2)),c=s*s,h=c*c*c,d=u*a*a,p=a*(o-this.longitude0),f=this.a*(this.W*i-this.X*Math.sin(2*i)+this.Y*Math.sin(4*i)-this.Z*Math.sin(6*i)),g=r*l*(p+(1-c+d)*Math.pow(p,3)/6+(5-18*h+72*d-58*u)*Math.pow(p,5)/120)+5e5,m=r*(f+l*s*(p*p/2+(5-c+9*d+4*d*d)*Math.pow(p,4)/24+(61-58*h+600*d-330*u)*Math.pow(p,6)/720));return i<0?(m+=1e7,this.southernHemisphere||(m=-m)):this.southernHemisphere&&(m=-m),this.eastingFirst?t.set(g,m,n.z):t.set(m,g,n.z)}},i}),define("cobweb/Browser/Geospatial/Geocentric",["standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t){function n(){}return n.prototype={constructor:n,convert:function(e,t){return t.assign(e)},apply:function(e,t){return t.assign(e)},slerp:function(e,n,i){var r=e.abs(),o=n.abs();return e.normalize(),n.normalize(),t.simpleSlerp(e,n,i).multiply(t.lerp(r,o,i))}},n}),define("cobweb/Browser/Geospatial/Geospatial",["standard/Geospatial/ReferenceEllipsoids","standard/Geospatial/Geodetic","standard/Geospatial/UniversalTransverseMercator","cobweb/Browser/Geospatial/Geocentric"],function(e,t,n,i){var r=0,o=r++,s=r++,a=r++,u={GD:o,GDC:o,UTM:s,GC:a,GCC:a,GS:a},l=/^Z(\d+)$/;return{GD:o,UTM:s,GC:a,getReferenceFrame:function(r,u){switch(this.getCoordinateSystem(r)){case o:return new t(this.getEllipsoid(r),this.getLatitudeFirst(r),u);case s:return new n(this.getEllipsoid(r),this.getZone(r),this.getNorthernHemisphere(r),this.getNorthingFirst(r));case a:return new i}return new t(e.WE,!0,u)},getElevationFrame:function(e,n){return new t(this.getEllipsoid(e),!0,n)},getCoordinateSystem:function(e){for(var t=0,n=e.length;t<n;++t){var i=u[e[t]];if(void 0!==i)return i}return o},getEllipsoid:function(t){for(var n=0,i=t.length;n<i;++n){var r=e[t[n]];if(void 0!==r)return r}return e.WE},getEllipsoidString:function(t){for(var n=0,i=t.length;n<i;++n)if(void 0!==e[t[n]])return t[n];return"WE"},isStandardOrder:function(e){switch(this.getCoordinateSystem(e)){case o:return this.getLatitudeFirst(e);case s:return this.getNorthingFirst(e);case a:return!0}return this.getLatitudeFirst(e)},getLatitudeFirst:function(e){for(var t=0,n=e.length;t<n;++t)if("longitude_first"===e[t])return!1;return!0},getNorthingFirst:function(e){for(var t=0,n=e.length;t<n;++t)if("easting_first"===e[t])return!1;return!0},getZone:function(e){for(var t=0,n=e.length;t<n;++t){var i=e[t].match(l);if(i)return parseInt(i[1])}return 1},getNorthernHemisphere:function(e){for(var t=0,n=e.length;t<n;++t)if("S"===e[t])return!1;return!0}}}),define("cobweb/Components/Geospatial/X3DGeospatialObject",["jquery","cobweb/Bits/X3DConstants","cobweb/Browser/Geospatial/Geospatial","cobweb/Bits/X3DCast","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o){function s(e){this.addType(t.X3DGeospatialObject),this.radians=!1,this.origin=new r(0,0,0),this.originMatrix=new o,this.invOriginMatrix=new o}function a(e,t){return this.invOriginMatrix.multVecMatrix(this.referenceFrame.convert(e,t))}function u(e,t){return this.referenceFrame.apply(this.originMatrix.multVecMatrix(d.assign(e)),t)}function l(e,t){return this.invOriginMatrix.multDirMatrix(this.elevationFrame.normal(this.originMatrix.multVecMatrix(d.assign(e)),t))}function c(e,t){return h.call(this,e,t).multRight(this.invOriginMatrix)}function h(e,t){return this.referenceFrame.convert(e,f),this.elevationFrame.normal(f,m),g.set(0,0,1).cross(m),g.equals(r.Zero)&&g.set(1,0,0),b.assign(g).cross(m),g.normalize(),b.normalize(),t.set(g.x,g.y,g.z,0,m.x,m.y,m.z,0,b.x,b.y,b.z,0,f.x,f.y,f.z,1)}var d=new r(0,0,0),p=new r(0,0,0),f=new r(0,0,0),g=new r(0,0,0),m=new r(0,0,0),b=new r(0,0,0);return s.prototype={constructor:s,initialize:function(){this.geoSystem_.addInterest("set_geoSystem__",this),this.geoOrigin_.addInterest("set_geoOrigin__",this),this.set_geoSystem__(),this.set_geoOrigin__()},set_geoSystem__:function(){this.coordinateSystem=n.getCoordinateSystem(this.geoSystem_),this.referenceFrame=n.getReferenceFrame(this.geoSystem_,this.radians),this.elevationFrame=n.getElevationFrame(this.geoSystem_,this.radians),this.standardOrder=n.isStandardOrder(this.geoSystem_)},set_geoOrigin__:function(){this.geoOriginNode&&(this.geoOriginNode.removeInterest("set_origin__",this),this.geoOriginNode.removeInterest("set_rotateYUp__",this),this.geoOriginNode.removeInterest("addNodeEvent",this)),this.geoOriginNode=i(t.GeoOrigin,this.geoOrigin_),this.geoOriginNode&&(this.geoOriginNode.addInterest("set_origin__",this),this.geoOriginNode.addInterest("set_rotateYUp__",this),this.geoOriginNode.addInterest("addNodeEvent",this)),this.set_origin__(),this.set_rotateYUp__()},set_origin__:function(){this.geoOriginNode?this.geoOriginNode.getOrigin(this.origin):this.origin.set(0,0,0),this.set_originMatrix__()},set_originMatrix__:function(){try{if(this.geoOriginNode){var e=this.origin;this.elevationFrame.normal(e,m),g.set(0,0,1).cross(m),g.equals(r.Zero)&&g.set(1,0,0),b.assign(g).cross(m),g.normalize(),b.normalize(),this.originMatrix.set(g.x,g.y,g.z,0,m.x,m.y,m.z,0,b.x,b.y,b.z,0,e.x,e.y,e.z,1),this.invOriginMatrix.assign(this.originMatrix).inverse()}}catch(e){}},set_rotateYUp__:function(){this.geoOriginNode&&this.geoOriginNode.rotateYUp_.getValue()?(this.getCoord=a,this.getGeoCoord=u,this.getGeoUpVector=l,this.getLocationMatrix=c):(delete this.getCoord,delete this.getGeoCoord,delete this.getGeoUpVector,delete this.getLocationMatrix)},getReferenceFrame:function(){return this.referenceFrame},getStandardOrder:function(){return this.standardOrder},getCoord:function(e,t){return this.referenceFrame.convert(e,t).subtract(this.origin)},getGeoCoord:function(e,t){return this.referenceFrame.apply(d.assign(e).add(this.origin),t)},getGeoElevation:function(e){return this.getGeoCoord(e,p).z},getGeoUpVector:function(e,t){return this.elevationFrame.normal(d.assign(e).add(this.origin),t)},getLocationMatrix:function(e,t){var n=this.origin,i=h.call(this,e,t);return i[12]-=n.x,i[13]-=n.y,i[14]-=n.z,i}},s}),define("cobweb/Components/Navigation/NavigationInfo",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DBindableNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.NavigationInfo),this.addChildObjects("availableViewers",new t.MFString,"viewer",new t.SFString("EXAMINE"))}var u={TELEPORT:!0,LINEAR:!0,ANIMATE:!0};return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_bind",new t.SFBool),new n(s.inputOutput,"type",new t.MFString("EXAMINE","ANY")),new n(s.inputOutput,"avatarSize",new t.MFFloat(.25,1.6,.75)),new n(s.inputOutput,"speed",new t.SFFloat(1)),new n(s.inputOutput,"headlight",new t.SFBool(!0)),new n(s.inputOutput,"visibilityLimit",new t.SFFloat),new n(s.inputOutput,"transitionType",new t.MFString("LINEAR")),new n(s.inputOutput,"transitionTime",new t.SFTime(1)),new n(s.outputOnly,"transitionComplete",new t.SFBool),new n(s.outputOnly,"isBound",new t.SFBool),new n(s.outputOnly,"bindTime",new t.SFTime)]),getTypeName:function(){return"NavigationInfo"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.type_.addInterest("set_type__",this),this.headlight_.addInterest("set_headlight__",this),this.set_type__(),this.set_headlight__()},set_type__:function(){this.availableViewers_.length=0;var e=!1,t=!1,n=!1,i=!1,r=!1,o=!1;this.viewer_="EXAMINE";for(s=0;s<this.type_.length;++s){switch(a=this.type_[s]){case"EXAMINE":case"WALK":case"FLY":case"LOOKAT":case"PLANE":case"NONE":this.viewer_=a;break;case"PLANE_create3000.de":this.viewer_="PLANE";break;default:continue}break}if(this.type_.length)for(var s=0;s<this.type_.length;++s){var a=this.type_[s];switch(a){case"EXAMINE":e=!0;continue;case"WALK":t=!0;continue;case"FLY":n=!0;continue;case"LOOKAT":o=!0;continue;case"PLANE":i=!0;continue;case"NONE":r=!0;continue}if("ANY"==a){e=!0,t=!0,n=!0,i=!0,r=!0,o=!0;break}e=!0}else e=!0,t=!0,n=!0,i=!0,r=!0,o=!0;e&&this.availableViewers_.push("EXAMINE"),t&&this.availableViewers_.push("WALK"),n&&this.availableViewers_.push("FLY"),i&&this.availableViewers_.push("PLANE"),o&&this.availableViewers_.push("LOOKAT"),r&&this.availableViewers_.push("NONE")},set_headlight__:function(){this.headlight_.getValue()?delete this.enable:this.enable=Function.prototype},bindToLayer:function(e){e.getNavigationInfoStack().push(this)},unbindFromLayer:function(e){e.getNavigationInfoStack().pop(this)},removeFromLayer:function(e){e.getNavigationInfoStack().remove(this)},getViewer:function(){return this.viewer_.getValue()},getCollisionRadius:function(){return this.avatarSize_.length>0&&this.avatarSize_[0]>0?this.avatarSize_[0]:.25},getAvatarHeight:function(){return this.avatarSize_.length>1?this.avatarSize_[1]:1.6},getStepHeight:function(){return this.avatarSize_.length>2?this.avatarSize_[2]:.75},getNearValue:function(){var e=this.getCollisionRadius();return 0===e?1e-5:e/2},getFarValue:function(e){return this.visibilityLimit_.getValue()?this.visibilityLimit_.getValue():e.getMaxZFar()},getTransitionType:function(){for(var e=0,t=this.transitionType_.length;e<t;++e){var n=this.transitionType_[e];if(u[n])return n}return"LINEAR"},enable:function(e,t){e===o.DISPLAY&&this.headlight_.getValue()&&t.getGlobalLights().push(t.getBrowser().getHeadlight())},traverse:function(e,t){t.getLayer().getNavigationInfos().push(this)}}),a}),define("cobweb/Components/Geospatial/GeoViewpoint",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Navigation/X3DViewpointNode","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Components/Interpolation/ScalarInterpolator","cobweb/Components/Navigation/NavigationInfo","cobweb/Bits/X3DConstants","standard/Math/Geometry/Camera","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p){function f(e,t){r.prototype.traverse.call(this,e,t),this.navigationInfoNode.traverse(e,t)}function g(e){switch(r.call(this,e),o.call(this,e),this.addType(u.GeoViewpoint),this.navigationInfoNode=new a(e),this.fieldOfViewInterpolator=new s(this.getBrowser().getPrivateScene()),this.projectionMatrix=new d,this.position=new c,this.elevation=0,e.specificationVersion){case"2.0":case"3.0":case"3.1":case"3.2":this.traverse=f}}var m=new c(0,0,1),b=new c(0,0,0),w=new c(0,0,0),y=new c(0,0,0),x=new d,v=new c(0,0,0),_=new h(0,0,1,0),S=new c(0,0,0),C=new c(0,0,0),F=new h(0,0,1,0);new c(0,0,0);return g.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:g,fieldDefinitions:new i([new n(u.inputOutput,"metadata",new t.SFNode),new n(u.initializeOnly,"geoOrigin",new t.SFNode),new n(u.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(u.inputOnly,"set_bind",new t.SFBool),new n(u.inputOutput,"description",new t.SFString),new n(u.inputOutput,"position",new t.SFVec3d(0,0,1e5)),new n(u.inputOutput,"orientation",new t.SFRotation),new n(u.inputOutput,"centerOfRotation",new t.SFVec3d),new n(u.inputOutput,"fieldOfView",new t.SFFloat(.7854)),new n(u.inputOutput,"jump",new t.SFBool(!0)),new n(u.inputOutput,"retainUserOffsets",new t.SFBool),new n(u.inputOutput,"navType",new t.MFString("EXAMINE","ANY")),new n(u.inputOutput,"headlight",new t.SFBool(!0)),new n(u.initializeOnly,"speedFactor",new t.SFFloat(1)),new n(u.outputOnly,"isBound",new t.SFBool),new n(u.outputOnly,"bindTime",new t.SFTime)]),getTypeName:function(){return"GeoViewpoint"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.position_.addInterest("set_position__",this),this.positionOffset_.addInterest("set_position__",this),this.navType_.addFieldInterest(this.navigationInfoNode.type_),this.headlight_.addFieldInterest(this.navigationInfoNode.headlight_),this.navigationInfoNode.setup(),this.set_position__(),this.fieldOfViewInterpolator.key_=[0,1],this.fieldOfViewInterpolator.setup(),this.getEaseInEaseOut().modifiedFraction_changed_.addFieldInterest(this.fieldOfViewInterpolator.set_fraction_),this.fieldOfViewInterpolator.value_changed_.addFieldInterest(this.fieldOfViewScale_)},setInterpolators:function(e){if(e.getType().indexOf(u.GeoViewpoint)<0)this.fieldOfViewInterpolator.keyValue_=[this.fieldOfViewScale_.getValue(),this.fieldOfViewScale_.getValue()];else{var t=e.getFieldOfView()/this.fieldOfView_.getValue();this.fieldOfViewInterpolator.keyValue_=[t,this.fieldOfViewScale_.getValue()],this.fieldOfViewScale_=t}},setPosition:function(e){this.position_.setValue(this.getGeoCoord(e,C))},getPosition:function(){return this.getCoord(this.position_.getValue(),v)},set_position__:function(){this.getCoord(this.position_.getValue(),this.position),this.elevation=this.getGeoElevation(v.assign(this.position).add(this.positionOffset_.getValue()))},setOrientation:function(e){var t=this.getLocationMatrix(this.position_.getValue(),x).submatrix;F.setMatrix(t),this.orientation_.setValue(F.inverse().multLeft(e))},getOrientation:function(){var e=this.getLocationMatrix(this.position_.getValue(),x).submatrix;return _.setMatrix(e),_.multLeft(this.orientation_.getValue())},getCenterOfRotation:function(){return this.getCoord(this.centerOfRotation_.getValue(),S)},getFieldOfView:function(){var e=this.fieldOfView_*this.fieldOfViewScale_;return e>0&&e<Math.PI?e:Math.PI/4},getUpVector:function(){return this.getGeoUpVector.call(this,v.assign(this.position).add(this.positionOffset_.getValue()),y)},getSpeedFactor:function(){return(Math.max(this.elevation,0)+10)/10*this.speedFactor_.getValue()},getMaxZFar:function(){return 1e9},getScreenScale:function(e,t){var n=t[2],i=t[3],r=2*Math.tan(this.getFieldOfView()/2)*e.abs();return r*=Math.abs(w.assign(e).normalize().dot(m)),r/=n>i?i:n,b.set(r,r,r)},getLookAtDistance:function(e){return e.size.abs()/2/Math.tan(this.getFieldOfView()/2)},getProjectionMatrixWithLimits:function(e,t,n,i){if(i)return l.perspective(this.getFieldOfView(),e,t,n[2],n[3],this.projectionMatrix);var r=Math.max(p.lerp(Math.min(e,1e4),1e4,this.elevation/1e7),1),o=Math.max(p.lerp(1e6,Math.max(t,1e6),this.elevation/1e7),1e6);return l.perspective(this.getFieldOfView(),r,o,n[2],n[3],this.projectionMatrix)}}),g}),define("cobweb/Browser/Navigation/PlaneViewer",["jquery","cobweb/Browser/Navigation/X3DViewer","cobweb/Components/Navigation/Viewpoint","cobweb/Components/Geospatial/GeoViewpoint","standard/Math/Numbers/Vector3","lib/gettext","jquery-mousewheel"],function(e,t,n,i,r,o){function s(e){t.call(this,e),this.button=-1,this.fromPoint=new r(0,0,0),this.toPoint=new r(0,0,0)}var a=new r(0,0,0),u=new r(0,0,0),l=new r(0,0,0);return s.prototype=e.extend(Object.create(t.prototype),{constructor:s,initialize:function(){t.prototype.initialize.call(this);var e=this.getBrowser().getCanvas();e.bind("mousedown.PlaneViewer",this.mousedown.bind(this)),e.bind("mouseup.PlaneViewer",this.mouseup.bind(this)),e.bind("mousemove.PlaneViewer",this.mousemove.bind(this)),e.bind("mousewheel.PlaneViewer",this.mousewheel.bind(this))},mousedown:function(t){if(!(this.button>=0)){this.pressTime=performance.now();var n=this.getBrowser().getCanvas().offset(),i=t.pageX-n.left,r=t.pageY-n.top;switch(t.button){case 1:t.preventDefault(),t.stopImmediatePropagation(),this.button=t.button,this.getBrowser().getCanvas().unbind("mousemove.PlaneViewer"),e(document).bind("mouseup.PlaneViewer"+this.getId(),this.mouseup.bind(this)),e(document).bind("mousemove.PlaneViewer"+this.getId(),this.mousemove.bind(this)),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.getPointOnCenterPlane(i,r,this.fromPoint)}}},mouseup:function(t){t.preventDefault(),t.stopImmediatePropagation(),t.button===this.button&&(this.button=-1,e(document).unbind(".PlaneViewer"+this.getId()),this.getBrowser().getCanvas().bind("mousemove.PlaneViewer",this.mousemove.bind(this)),this.getBrowser().setCursor("DEFAULT"))},mousemove:function(e){var t=this.getBrowser().getCanvas().offset(),n=e.pageX-t.left,i=e.pageY-t.top;switch(this.button){case 1:e.preventDefault(),e.stopImmediatePropagation();var r=this.getActiveViewpoint(),o=this.getPointOnCenterPlane(n,i,this.toPoint),s=r.getUserOrientation().multVecRot(this.fromPoint.subtract(o));r.positionOffset_=u.assign(r.positionOffset_.getValue()).add(s),r.centerOfRotationOffset_=l.assign(r.centerOfRotationOffset_.getValue()).add(s),this.fromPoint.assign(o)}},mousewheel:function(e){e.preventDefault(),e.stopImmediatePropagation();var t=this.getBrowser().getCanvas().offset(),n=e.pageX-t.left,i=e.pageY-t.top,r=this.getScrollDirection(e),o=this.getActiveViewpoint(),s=this.getPointOnCenterPlane(n,i,this.fromPoint);o.transitionStop(),r<0?o.fieldOfViewScale_=Math.max(1e-5,.95*o.fieldOfViewScale_.getValue()):r>0&&(o.fieldOfViewScale_=1.05*o.fieldOfViewScale_.getValue(),this.constrainFieldOfViewScale()),o.set_fieldOfView___&&o.set_fieldOfView___();var c=this.getPointOnCenterPlane(n,i,this.toPoint),h=o.getUserOrientation().multVecRot(a.assign(s).subtract(c));o.positionOffset_=u.assign(o.positionOffset_.getValue()).add(h),o.centerOfRotationOffset_=l.assign(o.centerOfRotationOffset_.getValue()).add(h)},constrainFieldOfViewScale:function(){var e=this.getActiveViewpoint();(e instanceof n||e instanceof i)&&e.fieldOfView_.getValue()*e.fieldOfViewScale_.getValue()>=Math.PI&&(e.fieldOfViewScale_=(Math.PI-.001)/e.fieldOfView_.getValue())},dispose:function(){this.getBrowser().getCanvas().unbind(".PlaneViewer"),e(document).unbind(".PlaneViewer"+this.getId())}}),s}),define("cobweb/Browser/Navigation/NoneViewer",["jquery","cobweb/Browser/Navigation/X3DViewer","lib/gettext"],function(e,t,n){function i(e){t.call(this,e)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Browser/Navigation/LookAtViewer",["jquery","cobweb/Browser/Navigation/X3DViewer","lib/gettext","jquery-mousewheel"],function(e,t,n){function i(e){t.call(this,e),this.button=-1}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this);var e=this.getBrowser().getCanvas();e.bind("mousedown.LookAtViewer",this.mousedown.bind(this)),e.bind("mouseup.LookAtViewer",this.mouseup.bind(this))},mousedown:function(t){if(!(this.button>=0))switch(this.pressTime=performance.now(),t.button){case 0:t.preventDefault(),t.stopImmediatePropagation(),this.button=t.button,e(document).bind("mouseup.LookAtViewer"+this.getId(),this.mouseup.bind(this)),this.getActiveViewpoint().transitionStop()}},mouseup:function(t){if(t.button===this.button){this.button=-1,e(document).unbind(".LookAtViewer"+this.getId());var n=this.getBrowser().getCanvas().offset(),i=t.pageX-n.left,r=this.getBrowser().getCanvas().height()-(t.pageY-n.top);switch(t.button){case 0:t.preventDefault(),t.stopImmediatePropagation(),this.lookAt(i,r,!0)}}},dispose:function(){this.getBrowser().getCanvas().unbind(".LookAtViewer"),e(document).unbind(".LookAtViewer"+this.getId())}}),i}),define("cobweb/Components/Lighting/X3DLightNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(e,t,n,i,r,o){function s(e){t.call(this,e),this.addType(i.X3DLightNode)}var a=new r(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1);return s.prototype=e.extend(Object.create(t.prototype),{constructor:s,getGlobal:function(){return this.global_.getValue()},getColor:function(){return this.color_.getValue()},getIntensity:function(){return o.clamp(this.intensity_.getValue(),0,1)},getAmbientIntensity:function(){return o.clamp(this.ambientIntensity_.getValue(),0,1)},getDirection:function(){return this.direction_.getValue()},getShadowColor:function(){return this.shadowColor_.getValue()},getShadowIntensity:function(){return o.clamp(this.shadowIntensity_.getValue(),0,1)},getShadowDiffusion:function(){return Math.max(this.shadowDiffusion_.getValue(),0)},getShadowMapSize:function(){return Math.min(this.shadowMapSize_.getValue(),this.getBrowser().getMaxTextureSize())},getBiasMatrix:function(){return a},push:function(e,t){if(this.on_.getValue())if(e.isIndependent()){n=this.getLights().pop();this.global_.getValue()?(n.set(e.getBrowser(),this,e.getLayer().getGroup(),e.getModelViewMatrix().get()),e.getGlobalLights().push(n),e.getLights().push(n)):(n.set(e.getBrowser(),this,t,e.getModelViewMatrix().get()),e.getLocalLights().push(n),e.getLights().push(n))}else{var n=e.getLightContainer();this.global_.getValue()?(n.getModelViewMatrix().pushMatrix(e.getModelViewMatrix().get()),e.getGlobalLights().push(n),e.getLights().push(n)):(n.getModelViewMatrix().pushMatrix(e.getModelViewMatrix().get()),e.getLocalLights().push(n),e.getLights().push(n))}},pop:function(e){if(this.on_.getValue()){if(this.global_.getValue())return;e.isIndependent()?e.getBrowser().getLocalLights().push(e.getLocalLights().pop()):e.getLocalLights().pop()}}}),s}),define("cobweb/Components/Grouping/X3DBoundedObject",["jquery","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Geometry/Box3"],function(e,t,n,i,r){function o(e){this.addType(n.X3DBoundedObject),this.childBBox=new r}return o.prototype={constructor:o,defaultBBoxSize:new i(-1,-1,-1),initialize:function(){},getBBox:function(e,i){i.set();for(var r=0,o=e.length;r<o;++r){var s=t(n.X3DBoundedObject,e[r]);s&&i.add(s.getBBox(this.childBBox))}return i}},o}),define("cobweb/Components/Grouping/X3DGroupingNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DChildNode","cobweb/Components/Grouping/X3DBoundedObject","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s){function a(e){return e?e.getValue().getId():-1}function u(e,t,n,i,r,o){function s(e){return u[a(e)]}for(var u={},l=r;l<o;++l)u[a(i[l])]=!0;return e.remove(t,n,s)}function l(e){n.call(this,e),i.call(this,e),this.addType(o.X3DGroupingNode),this.hidden=!1,this.pointingDeviceSensors=[],this.maybeCameraObjects=[],this.cameraObjects=[],this.clipPlanes=[],this.localFogs=[],this.lights=[],this.childNodes=[]}var c=new t.MFBool;return l.prototype=e.extend(Object.create(n.prototype),i.prototype,{constructor:l,initialize:function(){n.prototype.initialize.call(this),i.prototype.initialize.call(this),this.addChildren_.addInterest("set_addChildren__",this),this.removeChildren_.addInterest("set_removeChildren__",this),this.children_.addInterest("set_children__",this),this.set_children__()},getBBox:function(e){return this.bboxSize_.getValue().equals(this.defaultBBoxSize)?i.prototype.getBBox.call(this,this.children_.getValue(),e):e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},getMatrix:function(){return s.Identity},setHidden:function(e){e!==this.hidden&&(this.hidden=e,this.set_children__())},getVisible:function(){return c},getChild:function(e){try{if(e>=0&&e<this.children_.length){var t=this.children_[e];if(t)return t.getValue().getInnerNode()}}catch(e){}return null},set_addChildren__:function(){0!==this.addChildren_.length&&(this.addChildren_.setTainted(!0),this.addChildren_.erase(u(this.addChildren_,0,this.addChildren_.length,this.children_,0,this.children_.length),this.addChildren_.length),this.children_.getTainted()||(this.children_.removeInterest("set_children__",this),this.children_.addInterest("connectChildren",this)),this.children_.insert(this.children_.length,this.addChildren_,0,this.addChildren_.length),this.add(this.addChildren_),this.addChildren_.set([]),this.addChildren_.setTainted(!1))},set_removeChildren__:function(){0!==this.removeChildren_.length&&0!==this.children_.length&&(this.children_.getTainted()||(this.children_.removeInterest("set_children__",this),this.children_.addInterest("connectChildren",this)),this.children_.erase(u(this.children_,0,this.children_.length,this.removeChildren_,0,this.removeChildren_.length),this.children_.length),this.removeChildren_.set([]),this.set_children__())},set_children__:function(){this.clear(),this.add(this.children_)},connectChildren:function(){this.children_.removeInterest("connectChildren",this),this.children_.addInterest("set_children__",this)},add:function(e){if(!this.hidden){for(var t=this.getVisible(),n=t.length,i=0,r=e.length;i<r;++i){var s=e[i];if(s&&(i>=n||t[i]))try{for(var a=s.getValue().getInnerNode(),u=a.getType(),l=u.length-1;l>=0;--l){switch(u[l]){case o.X3DPointingDeviceSensorNode:this.pointingDeviceSensors.push(a);break;case o.ClipPlane:this.clipPlanes.push(a);break;case o.LocalFog:this.localFogs.push(a);break;case o.X3DLightNode:this.lights.push(a);break;case o.X3DBindableNode:this.maybeCameraObjects.push(a);break;case o.X3DBackgroundNode:case o.X3DChildNode:a.isCameraObject_.addInterest("set_cameraObjects__",this),this.maybeCameraObjects.push(a),this.childNodes.push(a);break;case o.BooleanFilter:case o.BooleanToggle:case o.NurbsOrientationInterpolator:case o.NurbsPositionInterpolator:case o.NurbsSurfaceInterpolator:case o.TimeSensor:case o.X3DFollowerNode:case o.X3DInfoNode:case o.X3DInterpolatorNode:case o.X3DLayoutNode:case o.X3DScriptNode:case o.X3DSequencerNode:case o.X3DTriggerNode:break;default:continue}break}}catch(e){}}this.set_cameraObjects__()}},clear:function(){for(var e=0,t=this.childNodes.length;e<t;++e)this.childNodes[e].isCameraObject_.removeInterest("set_cameraObjects__",this);this.pointingDeviceSensors.length=0,this.maybeCameraObjects.length=0,this.cameraObjects.length=0,this.clipPlanes.length=0,this.localFogs.length=0,this.lights.length=0,this.childNodes.length=0},set_cameraObjects__:function(){this.cameraObjects.length=0;for(var e=0,t=this.maybeCameraObjects.length;e<t;++e){var n=this.maybeCameraObjects[e];n.getCameraObject()&&this.cameraObjects.push(n)}this.setCameraObject(this.cameraObjects.length)},traverse:function(e,t){switch(e){case r.POINTER:var n=this.pointingDeviceSensors,i=this.clipPlanes,o=this.childNodes;if(n.length){var s={};t.getBrowser().getSensors().push(s);for(var a=0,u=n.length;a<u;++a)n[a].push(t,s)}for(var a=0,u=i.length;a<u;++a)i[a].push(t);for(var a=0,u=o.length;a<u;++a)o[a].traverse(e,t);for(var a=0,u=i.length;a<u;++a)i[a].pop(t);return void(n.length&&t.getBrowser().getSensors().pop());case r.CAMERA:for(var l=this.cameraObjects,a=0,u=l.length;a<u;++a)l[a].traverse(e,t);return;case r.COLLISION:case r.DEPTH:for(var i=this.clipPlanes,o=this.childNodes,a=0,u=i.length;a<u;++a)i[a].push(t);for(var a=0,u=o.length;a<u;++a)o[a].traverse(e,t);for(var a=0,u=i.length;a<u;++a)i[a].pop(t);return;case r.DISPLAY:for(var i=this.clipPlanes,c=this.localFogs,h=this.lights,o=this.childNodes,a=0,u=i.length;a<u;++a)i[a].push(t);for(var a=0,u=c.length;a<u;++a)c[a].push(t);for(var a=0,u=h.length;a<u;++a)h[a].push(t,this);for(var a=0,u=o.length;a<u;++a)o[a].traverse(e,t);for(var a=0,u=h.length;a<u;++a)h[a].pop(t);for(var a=0,u=c.length;a<u;++a)c[a].pop(t);for(var a=0,u=i.length;a<u;++a)i[a].pop(t);return}}}),l}),define("standard/Math/Utility/MatrixStack",["jquery"],function(e){function t(t){return e.extend([new t],{top:0,set:function(e){this[this.top].assign(e)},get:function(e){return this[this.top]},push:function(){var e=++this.top;e<this.length?this[e].assign(this[e-1]):this[e]=this[e-1].copy()},pushMatrix:function(e){var t=++this.top;t<this.length?this[t].assign(e):this[t]=e.copy()},pop:function(){--this.top},clear:function(){this.top=0},size:function(){return this.top+1},identity:function(){this[this.top].identity()},multLeft:function(e){this[this.top].multLeft(e)},translate:function(e){this[this.top].translate(e)},rotate:function(e){this[this.top].rotate(e)},scale:function(e){this[this.top].scale(e)}})}return t}),define("standard/Utility/ObjectCache",[],function(){return function(e){return{stack:[],last:-1,pop:function(){if(this.last>-1){var t=this.stack[this.last];return this.last--,t}return new e},push:function(e){return this.last++,this.stack[this.last]=e},clear:function(){this.stack.length=0,this.last=-1}}}}),define("cobweb/Components/Lighting/DirectionalLight",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Lighting/X3DLightNode","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Geometry/Box3","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Utility/ObjectCache"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m){function b(){this.direction=new h(0,0,0),this.shadowBuffer=null,this.bbox=new u,this.viewVolume=new c,this.viewport=new d(0,0,0,0),this.projectionMatrix=new f,this.modelViewMatrix=new g(f),this.transformationMatrix=new f,this.invLightSpaceMatrix=new f,this.invLightSpaceProjectionMatrix=new f,this.shadowMatrix=new f,this.shadowMatrixArray=new Float32Array(16),this.invGroupMatrix=new f,this.rotation=new p,this.textureUnit=0}function w(e){r.call(this,e),this.addType(a.DirectionalLight),this.global_=!1}var y=m(b);return b.prototype={constructor:b,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(e,t,n,i){var r=e.getContext(),o=t.getShadowMapSize();this.browser=e,this.lightNode=t,this.groupNode=n,this.modelViewMatrix.pushMatrix(i),t.getShadowIntensity()>0&&o>0&&(this.shadowBuffer=e.popShadowBuffer(o),this.shadowBuffer?e.getCombinedTextureUnits().length?(this.textureUnit=e.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(e){try{if(!this.shadowBuffer)return;var t=this.lightNode,n=e.getCameraSpaceMatrix().get(),i=this.transformationMatrix.assign(this.modelViewMatrix.get()).multRight(n),r=this.invLightSpaceMatrix.assign(t.getGlobal()?i:f.Identity);r.rotate(this.rotation.setFromToVec(h.zAxis,this.direction.assign(t.getDirection()).negate())),r.inverse();var a=o.prototype.getBBox.call(this.groupNode,this.bbox).multRight(r),u=t.getShadowMapSize(),c=this.viewport.set(0,0,u,u),d=l.orthoBox(a,this.projectionMatrix),p=this.invGroupMatrix.assign(this.groupNode.getMatrix()).inverse();this.shadowBuffer.bind(),e.getViewVolumes().push(this.viewVolume.set(d,c,c)),e.getProjectionMatrix().pushMatrix(d),e.getModelViewMatrix().pushMatrix(r),e.getModelViewMatrix().multLeft(p),e.render(s.DEPTH,this.groupNode),e.getModelViewMatrix().pop(),e.getProjectionMatrix().pop(),e.getViewVolumes().pop(),this.shadowBuffer.unbind(),t.getGlobal()||r.multLeft(i.inverse()),this.invLightSpaceProjectionMatrix.assign(r).multRight(d).multRight(t.getBiasMatrix())}catch(e){console.log(e)}},setGlobalVariables:function(e){this.modelViewMatrix.get().multDirMatrix(this.direction.assign(this.lightNode.getDirection())).normalize(),this.shadowMatrix.assign(e.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(e,t,n){var i=this.lightNode,r=i.getColor(),o=this.direction,s=i.getShadowColor();e.uniform1i(t.x3d_LightType[n],1),e.uniform3f(t.x3d_LightColor[n],r.r,r.g,r.b),e.uniform1f(t.x3d_LightIntensity[n],i.getIntensity()),e.uniform1f(t.x3d_LightAmbientIntensity[n],i.getAmbientIntensity()),e.uniform3f(t.x3d_LightDirection[n],o.x,o.y,o.z),this.textureUnit?(e.uniform1f(t.x3d_ShadowIntensity[n],i.getShadowIntensity()),e.uniform1f(t.x3d_ShadowDiffusion[n],i.getShadowDiffusion()),e.uniform3f(t.x3d_ShadowColor[n],s.r,s.g,s.b),e.uniformMatrix4fv(t.x3d_ShadowMatrix[n],!1,this.shadowMatrixArray),e.uniform1i(t.x3d_ShadowMap[n],this.textureUnit)):e.uniform1f(t.x3d_ShadowIntensity[n],0)},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,y.push(this)}},w.prototype=e.extend(Object.create(r.prototype),{constructor:w,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"global",new t.SFBool(!0)),new n(a.inputOutput,"on",new t.SFBool(!0)),new n(a.inputOutput,"color",new t.SFColor(1,1,1)),new n(a.inputOutput,"intensity",new t.SFFloat(1)),new n(a.inputOutput,"ambientIntensity",new t.SFFloat),new n(a.inputOutput,"direction",new t.SFVec3f(0,0,-1)),new n(a.inputOutput,"shadowColor",new t.SFColor),new n(a.inputOutput,"shadowIntensity",new t.SFFloat),new n(a.inputOutput,"shadowDiffusion",new t.SFFloat),new n(a.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"DirectionalLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getLights:function(){return y}}),w}),define("cobweb/Browser/Navigation/X3DNavigationContext",["cobweb/Fields","cobweb/Browser/Navigation/ExamineViewer","cobweb/Browser/Navigation/WalkViewer","cobweb/Browser/Navigation/FlyViewer","cobweb/Browser/Navigation/PlaneViewer","cobweb/Browser/Navigation/NoneViewer","cobweb/Browser/Navigation/LookAtViewer","cobweb/Components/Lighting/DirectionalLight","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u){function l(e){var t=new a(e.getPrivateScene());t.setup();var n=t.getLights().pop();return n.set(e,t,null,u.Identity),n.dispose=function(){},n}function c(){this.addChildObjects("availableViewers",new e.MFString,"viewer",new e.SFString("EXAMINE")),this.activeCollisions={},this.collisionCount=0,this.activeLayerNode=null,this.navigationInfoNode=null,this.viewerNode=null}return c.prototype={initialize:function(){this.viewer_.addInterest("set_viewer__",this),this.initialized().addInterest("set_world__",this),this.shutdown().addInterest("remove_world__",this),this.headlightContainer=l(this)},getHeadlight:function(){return this.headlightContainer},getActiveLayer:function(){return this.activeLayerNode},getCurrentViewer:function(){return this.viewer_.getValue()},addCollision:function(e){this.activeCollisions.hasOwnProperty(e.getId())||(this.activeCollisions[e.getId()]=!0,++this.collisionCount)},removeCollision:function(e){this.activeCollisions.hasOwnProperty(e.getId())&&(delete this.activeCollisions[e.getId()],--this.collisionCount)},getCollisionCount:function(){return this.collisionCount},remove_world__:function(){this.getWorld().activeLayer_.removeInterest("set_activeLayer__",this)},set_world__:function(){this.getWorld().activeLayer_.addInterest("set_activeLayer__",this),this.set_activeLayer__()},set_activeLayer__:function(){this.activeLayerNode&&this.activeLayerNode.getNavigationInfoStack().removeInterest("set_navigationInfo__",this),this.activeLayerNode=this.getWorld().getActiveLayer(),this.activeLayerNode&&this.activeLayerNode.getNavigationInfoStack().addInterest("set_navigationInfo__",this),this.set_navigationInfo__()},set_navigationInfo__:function(){if(this.navigationInfoNode&&this.navigationInfoNode.viewer_.removeFieldInterest(this.viewer_),!this.activeLayerNode)return this.navigationInfoNode=null,void(this.viewer_="NONE");this.navigationInfoNode=this.activeLayerNode.getNavigationInfo(),this.navigationInfoNode.viewer_.addFieldInterest(this.viewer_),this.viewer_=this.navigationInfoNode.viewer_},set_viewer__:function(e){switch(this.navigationInfoNode?this.availableViewers_=this.navigationInfoNode.availableViewers_:this.availableViewers_.length=0,this.viewerNode&&this.viewerNode.dispose(),e.getValue()){case"EXAMINE":this.viewerNode=new t(this);break;case"WALK":this.viewerNode=new n(this);break;case"FLY":this.viewerNode=new i(this);break;case"PLANE":case"PLANE_create3000.de":this.viewerNode=new r(this);break;case"NONE":this.viewerNode=new o(this);break;case"LOOKAT":this.viewerNode=new s(this);break;default:this.viewerNode=new t(this)}this.viewerNode.setup()}},c}),define("cobweb/Components/Layering/X3DViewportNode",["jquery","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DViewportNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Layering/Viewport",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Layering/X3DViewportNode","cobweb/Bits/X3DConstants","cobweb/Bits/TraverseType","standard/Utility/ObjectCache","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector4"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(o.Viewport),this.rectangle=new l(0,0,0,0)}var h=a(u);return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"clipBoundary",new t.MFFloat(0,1,0,1)),new n(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(o.initializeOnly,"bboxCenter",new t.SFVec3f),new n(o.inputOnly,"addChildren",new t.MFNode),new n(o.inputOnly,"removeChildren",new t.MFNode),new n(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Viewport"},getComponentName:function(){return"Layering"},getContainerField:function(){return"viewport"},getRectangle:function(e){var t=e.getViewport(),n=Math.floor(t[2]*this.getLeft()),i=Math.floor(t[2]*this.getRight()),r=Math.floor(t[3]*this.getBottom()),o=Math.floor(t[3]*this.getTop());return this.rectangle.set(n,r,Math.max(0,i-n),Math.max(0,o-r)),this.rectangle},getLeft:function(){return this.clipBoundary_.length>0?this.clipBoundary_[0]:0},getRight:function(){return this.clipBoundary_.length>1?this.clipBoundary_[1]:1},getBottom:function(){return this.clipBoundary_.length>2?this.clipBoundary_[2]:0},getTop:function(){return this.clipBoundary_.length>3?this.clipBoundary_[3]:1},traverse:function(e,t){switch(this.push(t),e){case s.POINTER:t.getBrowser().isPointerInRectangle(this.rectangle)&&r.prototype.traverse.call(this,e,t);break;default:r.prototype.traverse.call(this,e,t)}this.pop(t)},push:function(e){var t=e.getViewVolumes(),n=this.getRectangle(e.getBrowser()),i=t.length?t[t.length-1].getViewport():n,r=h.pop();r.set(e.getProjectionMatrix().get(),i,n),t.push(r)},pop:function(e){h.push(e.getViewVolumes().pop())}}),c}),define("cobweb/Browser/Layering/X3DLayeringContext",["cobweb/Components/Layering/Viewport"],function(e){function t(){this.defaultViewport=new e(this.getPrivateScene())}return t.prototype={initialize:function(){this.defaultViewport.setup()},getDefaultViewport:function(){return this.defaultViewport}},t}),define("cobweb/Components/Texturing/TextureProperties",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.TextureProperties)}var a={CLAMP:"CLAMP_TO_EDGE",CLAMP_TO_EDGE:"CLAMP_TO_EDGE",CLAMP_TO_BOUNDARY:"CLAMP_TO_EDGE",MIRRORED_REPEAT:"MIRRORED_REPEAT",REPEAT:"REPEAT"},u={AVG_PIXEL_AVG_MIPMAP:"LINEAR_MIPMAP_LINEAR",AVG_PIXEL:"LINEAR",AVG_PIXEL_NEAREST_MIPMAP:"LINEAR_MIPMAP_NEAREST",NEAREST_PIXEL_AVG_MIPMAP:"NEAREST_MIPMAP_LINEAR",NEAREST_PIXEL_NEAREST_MIPMAP:"NEAREST_MIPMAP_NEAREST",NEAREST_PIXEL:"NEAREST",NICEST:"LINEAR_MIPMAP_LINEAR",FASTEST:"NEAREST"},l={AVG_PIXEL:"LINEAR",NEAREST_PIXEL:"NEAREST",NICEST:"LINEAR",FASTEST:"NEAREST"};return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"borderColor",new t.SFColorRGBA),new n(o.inputOutput,"borderWidth",new t.SFInt32),new n(o.inputOutput,"anisotropicDegree",new t.SFFloat(1)),new n(o.initializeOnly,"generateMipMaps",new t.SFBool),new n(o.inputOutput,"minificationFilter",new t.SFString("FASTEST")),new n(o.inputOutput,"magnificationFilter",new t.SFString("FASTEST")),new n(o.inputOutput,"boundaryModeS",new t.SFString("REPEAT")),new n(o.inputOutput,"boundaryModeT",new t.SFString("REPEAT")),new n(o.inputOutput,"boundaryModeR",new t.SFString("REPEAT")),new n(o.inputOutput,"textureCompression",new t.SFString("FASTEST")),new n(o.inputOutput,"texturePriority",new t.SFFloat)]),getTypeName:function(){return"TextureProperties"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"textureProperties"},getBoundaryMode:function(e){var t=a[e];return void 0!==t?t:"REPEAT"},getBoundaryModeS:function(){return this.getBoundaryMode(this.boundaryModeS_.getValue())},getBoundaryModeT:function(){return this.getBoundaryMode(this.boundaryModeT_.getValue())},getBoundaryModeR:function(){return this.getBoundaryMode(this.boundaryModeR_.getValue())},getMinificationFilter:function(){if(this.generateMipMaps_.getValue()){var e=u[this.minificationFilter_.getValue()];return void 0!==e?e:this.getBrowser().getDefaultTextureProperties().getMinificationFilter()}return"LINEAR"},getMagnificationFilter:function(){var e=l[this.magnificationFilter_.getValue()];return void 0!==e?e:this.getBrowser().getDefaultTextureProperties().getMagnificationFilter()}}),s}),define("cobweb/Browser/Layout/X3DLayoutContext",["jquery","cobweb/Components/Texturing/TextureProperties"],function(e,t){function n(){this.screenTextureProperties=new t(this.getPrivateScene())}return n.prototype={initialize:function(){this.screenTextureProperties.boundaryModeS_="CLAMP",this.screenTextureProperties.boundaryModeT_="CLAMP",this.screenTextureProperties.boundaryModeR_="CLAMP",this.screenTextureProperties.minificationFilter_="NEAREST",this.screenTextureProperties.magnificationFilter_="NEAREST",this.screenTextureProperties.generateMipMaps_=!1,this.screenTextureProperties.setup();var t=e("<div></div>");this.pointSize=t.appendTo(e("body")).css("height","1in").css("display","none").height()/72,t.remove()},getScreenTextureProperties:function(){return this.screenTextureProperties},getPointSize:function(){return this.pointSize}},n}),define("text!cobweb/Browser/Shaders/BackgroundSphereVertexShader.vs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\n\nattribute vec4 x3d_Color;\nattribute vec4 x3d_Vertex;\n\nvarying vec4 C; // color\nvarying vec3 v; // point on geometry\n\nvoid\nmain ()\n{\n\tvec4 p = x3d_ModelViewMatrix * x3d_Vertex;\n\n\tv           = p .xyz;\n\tgl_Position = x3d_ProjectionMatrix * p;\n\tC           = x3d_Color;\n}\n"}),define("text!cobweb/Browser/Shaders/BackgroundSphereFragmentShader.fs",[],function(){return"data:text/plain;charset=utf-8,\n// -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-\n//\n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.\n// \n//  All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  The copyright notice above does not evidence any actual of intended\n//  publication of such source code, and is an unpublished work by create3000.\n//  This material contains CONFIDENTIAL INFORMATION that is the property of\n//  create3000.\n// \n//  No permission is granted to copy, distribute, or create derivative works from\n//  the contents of this software, in whole or in part, without the prior written\n//  permission of create3000.\n// \n//  NON-MILITARY USE ONLY\n// \n//  All create3000 software are effectively free software with a non-military use\n//  restriction. It is free. Well commented source is provided. You may reuse the\n//  source in any way you please with the exception anything that uses it must be\n//  marked to indicate is contains 'non-military use only' components.\n// \n//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n// \n//  Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.\n// \n//  This file is part of the Cobweb Project.\n// \n//  Cobweb is free software: you can redistribute it and/or modify it under the\n//  terms of the GNU General Public License version 3 only, as published by the\n//  Free Software Foundation.\n// \n//  Cobweb is distributed in the hope that it will be useful, but WITHOUT ANY\n//  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n//  A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more\n//  details (a copy is included in the LICENSE file that accompanied this code).\n// \n//  You should have received a copy of the GNU General Public License version 3\n//  along with Cobweb.  If not, see <http://www.gnu.org/licenses/gpl.html> for a\n//  copy of the GPLv3 License.\n// \n//  For Silvio, Joy and Adi.\n\n\nprecision mediump float;\n\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nvarying vec4 C; // color\nvarying vec3 v; // point on geometry\n\nvoid\nclip ()\n{\n\tfor (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n\t{\n\t\tif (x3d_ClipPlane [i] == x3d_NoneClipPlane)\n\t\t\tbreak;\n\n\t\tif (dot (v, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n\t\t\tdiscard;\n\t}\n}\n\nvoid\nmain ()\n{\n\tclip ();\n\n\tgl_FragColor = C;\n}\n"}),define("cobweb/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext",["cobweb/Components/Shaders/ComposedShader","cobweb/Components/Shaders/ShaderPart","cobweb/Components/Texturing/TextureProperties","text!cobweb/Browser/Shaders/BackgroundSphereVertexShader.vs","text!cobweb/Browser/Shaders/BackgroundSphereFragmentShader.fs"],function(e,t,n,i,r){function o(){this.backgroundTextureProperties=new n(this.getPrivateScene())}return o.prototype={initialize:function(){this.backgroundSphereShader=this.createShader(this,"BackgroundSphereShader",i,r),this.backgroundTextureProperties.boundaryModeS_="CLAMP_TO_EDGE",this.backgroundTextureProperties.boundaryModeT_="CLAMP_TO_EDGE",this.backgroundTextureProperties.boundaryModeR_="CLAMP_TO_EDGE",this.backgroundTextureProperties.minificationFilter_="NICEST",this.backgroundTextureProperties.magnificationFilter_="NICEST",this.backgroundTextureProperties.setup()},getBackgroundSphereShader:function(){return this.backgroundSphereShader},getBackgroundTextureProperties:function(){return this.backgroundTextureProperties}},o}),define("cobweb/Rendering/DepthBuffer",["standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(e,t,n){function i(e,i,r){var o=e.getContext();this.browser=e,this.width=i,this.height=r,this.array=new Uint8Array(i*r*4),this.invProjectionMatrix=new n,this.point=new t(0,0,0),this.lastBuffer=o.getParameter(o.FRAMEBUFFER_BINDING),this.buffer=o.createFramebuffer(),o.bindFramebuffer(o.FRAMEBUFFER,this.buffer),this.depthTexture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.depthTexture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,i,r,0,o.RGBA,o.UNSIGNED_BYTE,null),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,this.depthTexture,0);var s=o.createRenderbuffer();o.bindRenderbuffer(o.RENDERBUFFER,s),o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,i,r),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,s);var a=o.checkFramebufferStatus(o.FRAMEBUFFER)===o.FRAMEBUFFER_COMPLETE;if(o.bindFramebuffer(o.FRAMEBUFFER,this.lastBuffer),!a)throw new Error("Couldn't create frame buffer.")}return i.prototype={constructor:i,getWidth:function(){return this.width},getHeight:function(){return this.height},getDepthTexture:function(){return this.depthTexture},readPixels:function(){var e=this.browser.getContext(),t=this.array,n=this.width,i=this.height;return e.readPixels(0,0,n,i,e.RGBA,e.UNSIGNED_BYTE,t),t},getDepth:function(t,n){try{var i=this.browser.getContext(),r=this.array,o=this.width,s=this.height,a=this.invProjectionMatrix.assign(t).inverse(),u=0,l=0,c=Number.POSITIVE_INFINITY;i.readPixels(0,0,o,s,i.RGBA,i.UNSIGNED_BYTE,r);for(var h=0,d=0;h<s;++h)for(var p=0;p<o;++p,d+=4){var f=r[d]/255+r[d+1]/65025+r[d+2]/16581375+r[d+3]/4228250625;f<c&&(u=p,l=h,c=f)}return e.unProjectPointMatrix(u,l,c,a,n,this.point),this.point.z}catch(e){return 0}},bind:function(){var e=this.browser.getContext();this.lastBuffer=e.getParameter(e.FRAMEBUFFER_BINDING),e.bindFramebuffer(e.FRAMEBUFFER,this.buffer)},unbind:function(){var e=this.browser.getContext();e.bindFramebuffer(e.FRAMEBUFFER,this.lastBuffer)}},i}),define("cobweb/Browser/Lighting/X3DLightingContext",["cobweb/Rendering/DepthBuffer"],function(e){function t(){this.localLights=[],this.shadowBuffers=[]}return t.prototype={initialize:function(){},getMaxLights:function(){return 8},getLocalLights:function(){return this.localLights},popShadowBuffer:function(t){try{var n=this.shadowBuffers[t];if(n){if(n.length)return n.pop()}else this.shadowBuffers[t]=[];return new e(this,t,t)}catch(e){return console.log(e),null}},pushShadowBuffer:function(e){e&&this.shadowBuffers[e.getWidth()].push(e)}},t}),define("cobweb/Browser/Sound/X3DSoundContext",["cobweb/Fields"],function(e){function t(){this.addChildObjects("volume",new e.SFFloat(1),"mute",new e.SFBool)}return t.prototype={initialize:function(){this.volume_.addInterest("set_volume__",this),this.mute_.addInterest("set_mute__",this);var e=this.getDataStorage()["X3DSoundContext.volume"],t=this.getDataStorage()["X3DSoundContext.mute"];void 0!==e&&(this.volume_=e),void 0!==t&&(this.mute_=t)},set_volume__:function(e){this.getDataStorage()["X3DSoundContext.volume"]=e.getValue()},set_mute__:function(e){this.getDataStorage()["X3DSoundContext.mute"]=e.getValue()}},t}),define("cobweb/Browser/Text/TextAlignment",[],function(){var e=0,t={BEGIN:++e,FIRST:++e,MIDDLE:++e,END:++e};return Object.preventExtensions(t),Object.freeze(t),Object.seal(t),t}),define("cobweb/Components/Text/X3DFontStyleNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DNode","cobweb/Components/Networking/X3DUrlObject","cobweb/Browser/Text/TextAlignment","cobweb/InputOutput/FileLoader","cobweb/Bits/X3DConstants","cobweb/Browser/Networking/urls","standard/Networking/URI","cobweb/DEBUG"],function(e,t,n,i,r,o,s,a,u,l){function c(e){n.call(this,e),this.addType(s.X3DFontStyleNode),this.addChildObjects("loadState",new t.SFInt32(s.NOT_STARTED_STATE)),this.familyStack=[],this.alignments=[],this.loader=new o(this)}var h=["http://media.create3000.de/fonts/","https://cdn.rawgit.com/create3000/cobweb/master/cobweb.js/fonts/","http://cdn.rawgit.com/create3000/cobweb/master/cobweb.js/fonts/","https://rawgit.com/create3000/cobweb/master/cobweb.js/fonts/","http://rawgit.com/create3000/cobweb/master/cobweb.js/fonts/"],d={SERIF:{PLAIN:"DroidSerif-Regular.ttf",ITALIC:"DroidSerif-Italic.ttf",BOLD:"DroidSerif-Bold.ttf",BOLDITALIC:"DroidSerif-BoldItalic.ttf"},SANS:{PLAIN:"Ubuntu-R.ttf",ITALIC:"Ubuntu-RI.ttf",BOLD:"Ubuntu-B.ttf",BOLDITALIC:"Ubuntu-BI.ttf"},TYPEWRITER:{PLAIN:"UbuntuMono-R.ttf",ITALIC:"UbuntuMono-RI.ttf",BOLD:"UbuntuMono-B.ttf",BOLDITALIC:"UbuntuMono-BI.ttf"}};return c.prototype=e.extend(Object.create(n.prototype),{constructor:c,initialize:function(){n.prototype.initialize.call(this),this.style_.addInterest("set_style__",this),this.justify_.addInterest("set_justify__",this),this.font=null,this.familyIndex=0,this.set_justify__(),this.set_style__(),this.requestAsyncLoad()},setLoadState:i.prototype.setLoadState,checkLoadState:i.prototype.checkLoadState,getMajorAlignment:function(){return this.alignments[0]},getMinorAlignment:function(){return this.alignments[1]},set_style__:function(){this.setLoadState(s.NOT_STARTED_STATE),this.requestAsyncLoad()},set_justify__:function(){var e=this.horizontal_.getValue()?this.leftToRight_.getValue():this.topToBottom_.getValue();this.alignments[0]=this.justify_.length>0?this.getAlignment(0,e):e?r.BEGIN:r.END;var t=this.horizontal_.getValue()?this.topToBottom_.getValue():this.leftToRight_.getValue();this.alignments[1]=this.justify_.length>1?this.getAlignment(1,t):t?r.FIRST:r.END},getAlignment:function(e,t){if(t)switch(this.justify_[e]){case"FIRST":return r.FIRST;case"BEGIN":return r.BEGIN;case"MIDDLE":return r.MIDDLE;case"END":return r.END}else switch(this.justify_[e]){case"FIRST":case"BEGIN":return r.END;case"MIDDLE":return r.MIDDLE;case"END":return r.BEGIN}return e?r.FIRST:r.BEGIN},requestAsyncLoad:function(){if(this.checkLoadState()!==s.COMPLETE_STATE&&this.checkLoadState()!==s.IN_PROGRESS_STATE){this.setLoadState(s.IN_PROGRESS_STATE);var e=this.family_.copy();e.push("SERIF"),this.familyStack.length=0;for(var t=0,n=e.length;t<n;++t){var i=e[t],r=this.getDefaultFont(i);if(r)for(var o=0;o<h.length;++o)this.familyStack.push(h[o]+r);else this.familyStack.push(i)}this.loadNext()}},getDefaultFont:function(e){var t=d[e];if(t){var n=t[this.style_.getValue()];return n||t.PLAIN}},loadNext:function(){try{if(0===this.familyStack.length)return this.setLoadState(s.FAILED_STATE),void(this.font=null);this.family=this.familyStack.shift(),this.URL=this.loader.transform(this.family),this.getBrowser().getFont(this.URL,this.setFont.bind(this),this.setError.bind(this))}catch(e){this.setError(e.message)}},setError:function(e){var t=this.URL.toString();l&&(this.URL.isLocal()||"localhost"===this.URL.host||t.match(a.fallbackExpression)||this.familyStack.unshift(a.fallbackUrl+t)),"data"!==this.URL.scheme&&console.warn("Error loading font '"+this.URL.toString()+"':",e),this.loadNext()},setFont:function(e){this.font=e,this.setLoadState(s.COMPLETE_STATE),this.addNodeEvent()},getFont:function(){return this.font}}),c}),define("standard/Math/Geometry/Box2",["standard/Math/Numbers/Matrix3","standard/Math/Numbers/Vector2"],function(e,t){function n(t,n){switch(arguments.length){case 0:return void(this.matrix=new e(.5,0,0,0,.5,0,0,0,0));case 2:return void(this.matrix=new e(t.x/2,0,0,0,t.y/2,0,n.x,n.y,1));case 3:var i=arguments[0],r=arguments[1],o=(r.x-i.x)/2,s=(r.y-i.y)/2,a=(r.x+i.x)/2,u=(r.y+i.y)/2;return void(this.matrix=new e(o,0,0,0,s,0,a,u,1))}}var i=new t(0,0),r=new t(0,0),o=new t(0,0),s=new t(0,0),a=new t(0,0),u=new t(0,0),l=new t(0,0),c=new t(0,0),h=new t(0,0);return n.prototype={constructor:n,copy:function(){var e=Object.create(n.prototype);return e.matrix=this.matrix.copy(),e},assign:function(e){return this.matrix.assign(e.matrix),this},equals:function(e){return this.matrix.equals(e.matrix)},set:function(e,t){var n=this.matrix;switch(arguments.length){case 0:return n[0]=.5,n[1]=0,n[2]=0,n[3]=0,n[4]=.5,n[5]=0,n[6]=0,n[7]=0,n[8]=0,this;case 2:return n[0]=e.x/2,n[1]=0,n[2]=0,n[3]=0,n[4]=e.y/2,n[5]=0,n[6]=t.x,n[7]=t.y,n[8]=1,this}},setExtents:function(e,t){var n=this.matrix,i=(t.x-e.x)/2,r=(t.y-e.y)/2,o=(t.x+e.x)/2,s=(t.y+e.y)/2;return n[0]=i,n[1]=0,n[2]=0,n[3]=0,n[4]=r,n[5]=0,n[6]=o,n[7]=s,n[8]=1,this},isEmpty:function(){return 0===this.matrix[8]},add:function(e){return this.isEmpty()?this.assign(e):e.isEmpty()?this:(this.getExtents(u,l),e.getExtents(c,h),this.assign(new n(u.min(c),l.max(h),!0)))},multLeft:function(e){return this.matrix.multLeft(e),this},multRight:function(e){return this.matrix.multRight(e),this},getExtents:function(e,t){this.getAbsoluteExtents(e,t),e.add(this.center),t.add(this.center)},getAbsoluteExtents:function(e,t){var n=this.matrix;i.set(n[0],n[1]),r.set(n[3],n[4]),a.assign(i).add(r);var o=r.subtract(i);e.assign(a).min(o),t.assign(a).max(o),a.negate(),o.negate(),e.min(a,o),t.max(a,o)},intersectsPoint:function(e){return this.getExtents(o,s),o.x<=e.x&&s.x>=e.x&&o.y<=e.y&&s.y>=e.y},toString:function(){return this.size+", "+this.center}},Object.defineProperty(n.prototype,"size",{get:function(){var e=new t(0,0);return this.getAbsoluteExtents(o,e),e.subtract(o)},enumerable:!0,configurable:!1}),Object.defineProperty(n.prototype,"center",{get:function(){return this.matrix.origin},enumerable:!0,configurable:!1}),n}),define("cobweb/Browser/Text/X3DTextGeometry",["cobweb/Browser/Text/TextAlignment","standard/Math/Geometry/Box2","standard/Math/Geometry/Box3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r){function o(e,t){this.text=e,this.fontStyle=t,this.glyphs=[],this.minorAlignment=new i(0,0),this.translations=[],this.charSpacings=[],this.bearing=new i(0,0),this.yPad=[],this.bbox=new n}var s={},a=new t,u=new t,l=new i(0,0),c=new i(0,0),h=new i(0,0),d=new i(0,0),p=new r(0,0,0),f=new r(0,0,0),g=new i(0,0),m=new i(0,0),b=new i(0,0),w=new i(0,0),y=new i(0,0),x=new r(0,0,0),v=new i(0,0),_=new t,S=new i(0,0),C=new r(0,0,0);return o.prototype={constructor:o,getBrowser:function(){return this.text.getBrowser()},getText:function(){return this.text},getFontStyle:function(){return this.fontStyle},getGlyphs:function(){return this.glyphs},getMinorAlignment:function(){return this.minorAlignment},getTranslations:function(){return this.translations},getCharSpacings:function(){return this.charSpacings},getBearing:function(){return this.bearing},getBBox:function(){return this.bbox},update:function(){var e=this.text,t=this.fontStyle,n=e.string_.length;if(e.lineBounds_.length=n,this.glyphs.length=0,0===n||!t.getFont())return e.origin_.setValue(C),e.textBounds_.setValue(S),void this.bbox.set();if(t.horizontal_.getValue())this.resizeArray(this.translations,n),this.resizeArray(this.charSpacings,n),this.horizontal(e,t);else{for(var i=e.string_.getValue(),r=0,o=0,s=i.length;o<s;++o)r+=i[o].length;this.resizeArray(this.translations,r),this.resizeArray(this.charSpacings,r),this.vertical(e,t)}},resizeArray:function(e,t){for(var n=e.length;n<t;++n)e.push(new i(0,0));e.length=t},horizontal:function(t,n){var i=n.getFont(),r=t.string_.getValue(),o=r.length,s=Math.max(0,t.maxExtent_.getValue()),u=n.topToBottom_.getValue(),h=n.getScale(),d=n.spacing_.getValue();a.set();for(var w=u?0:o-1,v=u?o:-1,S=u?1:-1,C=w,F=0;C!==v;C+=S,++F){var T=r[C],N=this.getHorizontalLineExtents(n,T,l,c,F);g.assign(c).subtract(l);var O=u?C:o-C-1,M=0,V=t.getLength(C);switch(y.set(g.x,0==O?c.y-i.descender/i.unitsPerEm:d).multiply(h),s&&(V=V?Math.min(s,V):Math.min(s,g.x*h)),V&&(M=(V-y.x)/(N.length-1),y.x=V,g.x=V/h),this.charSpacings[F]=M,t.lineBounds_[C]=y,n.getMajorAlignment()){case e.BEGIN:case e.FIRST:this.translations[F].set(0,-F*d);break;case e.MIDDLE:this.translations[F].set(-l.x-g.x/2,-F*d);break;case e.END:this.translations[F].set(-l.x-g.x,-F*d)}this.translations[F].multiply(h),m.assign(l).add(b.assign(g).divide(2)),a.add(_.set(g.multiply(h),m.multiply(h).add(this.translations[F])))}switch(a.getExtents(l,c),g.assign(c).subtract(l),t.textBounds_=g,this.bearing.set(0,-c.y),n.getMinorAlignment()){case e.BEGIN:this.minorAlignment.assign(this.bearing);break;case e.FIRST:this.minorAlignment.set(0,0);break;case e.MIDDLE:this.minorAlignment.set(0,g.y/2-c.y);break;case e.END:this.minorAlignment.set(0,(o-1)*d*h)}l.add(this.minorAlignment),c.add(this.minorAlignment),t.origin_.setValue(x.set(l.x,c.y,0)),this.bbox.setExtents(p.set(l.x,l.y,0),f.set(c.x,c.y,0))},vertical:function(t,n){var i=n.getFont(),r=t.string_.getValue(),o=r.length,s=Math.max(0,t.maxExtent_.getValue()),d=n.leftToRight_.getValue(),S=n.topToBottom_.getValue(),C=n.getScale(),F=n.spacing_.getValue(),T=this.yPad,N=this.getBrowser().getBrowserOptions().getPrimitiveQuality();a.set();for(var O=d?0:o-1,M=d?o:-1,V=d?1:-1,D=0,I=O;I!==M;I+=V){var B=this.stringToGlyphs(i,r[I],!0,I),E=D,A=B.length;u.set();for(var P=S?0:A-1,L=S?A:-1,R=S?1:-1,k=P;k!==L;k+=R,++D){var z=B[k];this.getGlyphExtents(z,N,l,c),g.assign(c).subtract(l);var j=S?k:A-k-1;this.translations[D].set((F-g.x-l.x)/2,-j),m.assign(l).add(b.assign(g).divide(2)).add(this.translations[D]),u.add(_.set(g,m))}u.getExtents(l,c),g.assign(c).subtract(l);var X=d?I:o-I-1,U=(F-g.x)/2,G=0,q=t.getLength(I);switch(y.set(0===I?F-U:F,g.y).multiply(C),s&&(q=q?Math.min(s,q):Math.min(s,g.y*C)),q&&(G=(q-y.y)/(B.length-1)/C,y.y=q,g.y=q/C,l.y=c.y-g.y),t.lineBounds_[I]=y,n.getMajorAlignment()){case e.BEGIN:case e.FIRST:w.set(X*F,-1);break;case e.MIDDLE:w.set(X*F,g.y/2-c.y);break;case e.END:this.getGlyphExtents(B[S?A-1:0],N,h,v),w.set(X*F,g.y-c.y+h.y)}for(var H=0,W=E;W<D;++W)this.translations[W].add(w),this.translations[W].y-=H,this.translations[W].multiply(C),H+=G;switch(n.getMajorAlignment()){case e.BEGIN:case e.FIRST:T[I]=c.y+w.y;break;case e.MIDDLE:T[I]=0;break;case e.END:T[I]=l.y+w.y}m.assign(l).add(b.assign(g).divide(2)),a.add(_.set(g.multiply(C),m.add(w).multiply(C)))}switch(a.getExtents(l,c),g.assign(c).subtract(l),n.getMajorAlignment()){case e.BEGIN:case e.FIRST:for(var Y=0,q=($=t.lineBounds_.getValue()).length;Y<q;++Y)$[Y].y+=c.y-T[Y]*C;break;case e.MIDDLE:break;case e.END:for(var $=t.lineBounds_.getValue(),Y=0,q=$.length;Y<q;++Y)$[Y].y+=T[Y]*C-l.y}switch(t.textBounds_=g,n.getMajorAlignment()){case e.BEGIN:case e.FIRST:this.bearing.set(-l.x,c.y);break;case e.MIDDLE:this.bearing.set(-l.x,0);break;case e.END:this.bearing.set(-l.x,l.y)}switch(n.getMinorAlignment()){case e.BEGIN:case e.FIRST:this.minorAlignment.set(-l.x,0);break;case e.MIDDLE:this.minorAlignment.set(-l.x-g.x/2,0);break;case e.END:this.minorAlignment.set(-l.x-g.x,0)}l.add(this.minorAlignment),c.add(this.minorAlignment),t.origin_.setValue(x.set(l.x,c.y,0)),this.bbox.set(p.set(l.x,l.y,0),f.set(c.x,c.y,0),!0)},stringToGlyphs:function(e,t,n,i){t=t.getValue();var r=s[e.fontName],o=this.glyphs[i];r||(r=s[e.fontName]=[]),o||(o=this.glyphs[i]=[]),o.length=t.length;for(var a=n?0:t.length-1,u=n?t.length:-1,l=n?1:-1,c=a,h=0;c!==u;c+=l,++h){var d=t.charCodeAt(c),p=null;(p=r[d])||(p=e.stringToGlyphs(t[c])[0],r[d]=p,p.extents={}),o[h]=p}return o},getHorizontalLineExtents:function(t,n,i,r,o){for(var s=t.getFont(),a=t.horizontal_.getValue()?t.leftToRight_.getValue():t.topToBottom_.getValue(),u=this.stringToGlyphs(s,n,a,o),l=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),c=0,p=0,f=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=0,b=u.length;m<b;++m){var w=u[m],y=m+1<b?s.getKerningValue(w,u[m+1]):0;this.getGlyphExtents(w,l,h,d),p+=(m+1<b?w.advanceWidth:d.x*s.unitsPerEm)+y,f=Math.min(f,h.y),g=Math.max(g,d.y)}switch(u.length?(this.getGlyphExtents(u[0],l,h,d),c=h.x):(f=0,g=0),i.set(c,f),r.set(p/s.unitsPerEm,g),t.getMajorAlignment()){case e.BEGIN:case e.FIRST:i.x=0}return u},traverse:function(e,t){}},o}),define("standard/Math/Geometry/Triangle2",[],function(){return{isPointInTriangle:function(e,t,n,i){var r=(t.y-n.y)*(e.x-n.x)+(n.x-t.x)*(e.y-n.y),o=((t.y-n.y)*(i.x-n.x)+(n.x-t.x)*(i.y-n.y))/r;if(o<0||o>1)return!1;var s=((n.y-e.y)*(i.x-n.x)+(e.x-n.x)*(i.y-n.y))/r;if(s<0||s>1)return!1;var a=1-o-s;return!(a<0||a>1)}}}),define("lib/bezierjs/bezier.js",[],function(){var e=Math.abs,n=Math.min,i=Math.max,r=Math.cos,o=Math.sin,s=Math.acos,a=(Math.asin,Math.atan2),u=Math.sqrt,l=function(e){return e<0?-Math.pow(-e,1/3):Math.pow(e,1/3)},c=Math.PI,h=2*c,d=c/2,p={x:0,y:0,z:0},f={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,t){var n=t(e),i=n.x*n.x+n.y*n.y;return void 0!==n.z&&(i+=n.z*n.z),u(i)},length:function(e){var t,n,i=0,r=this.Tvalues.length;for(t=0;t<r;t++)n=.5*this.Tvalues[t]+.5,i+=this.Cvalues[t]*this.arcfn(n,e);return.5*i},map:function(e,t,n,i,r){return i+(r-i)*((e-t)/(n-t))},lerp:function(e,t,n){var i={x:t.x+e*(n.x-t.x),y:t.y+e*(n.y-t.y)};return t.z&&n.z&&(i.z=t.z+e*(n.z-t.z)),i},pointToString:function(e){var t=e.x+"/"+e.y;return void 0!==e.z&&(t+="/"+e.z),t},pointsToString:function(e){return"["+e.map(this.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,t,n){var i,r=t.x-e.x,o=t.y-e.y,s=n.x-e.x,l=n.y-e.y,c=r*l-o*s,h=u(r*r+o*o),d=u(s*s+l*l);return r/=h,o/=h,s/=d,l/=d,i=r*s+o*l,a(c,i)},dist:function(e,t){var n=e.x-t.x,i=e.y-t.y;return u(n*n+i*i)},lli8:function(e,t,n,i,r,o,s,a){var u=(e*i-t*n)*(r-s)-(e-n)*(r*a-o*s),l=(e*i-t*n)*(o-a)-(t-i)*(r*a-o*s),c=(e-n)*(o-a)-(t-i)*(r-s);return 0!=c&&{x:u/c,y:l/c}},lli4:function(e,t,n,i){var r=e.x,o=e.y,s=t.x,a=t.y,u=n.x,l=n.y,c=i.x,h=i.y;return this.lli8(r,o,s,a,u,l,c,h)},lli:function(e,t){return this.lli4(e,e.c,t,t.c)},makeline:function(e,t){var n=e.x,i=e.y,r=t.x,o=t.y,s=(r-n)/3,a=(o-i)/3;return new m(n,i,n+s,i+a,n+2*s,i+2*a,r,o)},findbbox:function(e){var t=99999999,n=t,i=-t,r=i;return e.forEach(function(e){var o=e.bbox();t>o.x.min&&(t=o.x.min),n>o.y.min&&(n=o.y.min),i<o.x.max&&(i=o.x.max),r<o.y.max&&(r=o.y.max)}),{x:{min:t,mid:(t+i)/2,max:i,size:i-t},y:{min:n,mid:(n+r)/2,max:r,size:r-n}}},shapeintersections:function(e,t,n,i){if(!this.bboxoverlap(t,i))return[];var r=[],o=[e.startcap,e.forward,e.back,e.endcap],s=[n.startcap,n.forward,n.back,n.endcap];return o.forEach(function(t){t.virtual||s.forEach(function(i){if(!i.virtual){var o=t.intersects(i);o.length>0&&(o.c1=t,o.c2=i,o.s1=e,o.s2=n,r.push(o))}})}),r},makeshape:function(e,t){var n=t.points.length,i=e.points.length,r=this.makeline(t.points[n-1],e.points[0]),o=this.makeline(e.points[i-1],t.points[0]),s={startcap:r,forward:e,back:t,endcap:o,bbox:this.findbbox([r,e,t,o])},a=this;return s.intersections=function(e){return a.shapeintersections(s,s.bbox,e,e.bbox)},s},getminmax:function(e,t,n){if(!n)return{min:0,max:0};var i,r,o=0x10000000000000000,s=-o;-1===n.indexOf(0)&&(n=[0].concat(n)),-1===n.indexOf(1)&&n.push(1);for(var a=0,u=n.length;a<u;a++)i=n[a],(r=e.get(i))[t]<o&&(o=r[t]),r[t]>s&&(s=r[t]);return{min:o,mid:(o+s)/2,max:s,size:s-o}},align:function(e,t){var n=t.p1.x,i=t.p1.y,s=-a(t.p2.y-i,t.p2.x-n),u=function(e){return{x:(e.x-n)*r(s)-(e.y-i)*o(s),y:(e.x-n)*o(s)+(e.y-i)*r(s)}};return e.map(u)},roots:function(e,t){t=t||{p1:{x:0,y:0},p2:{x:1,y:0}};var n=e.length-1,i=this.align(e,t),o=function(e){return 0<=e&&e<=1};if(2===n){if(0!==(x=(v=i[0].y)-2*(_=i[1].y)+(S=i[2].y))){var a=-u(_*_-v*S),c=-v+_;return[p=-(a+c)/x,-(-a+c)/x].filter(o)}return _!==S&&0===x?[(2*_-S)/2*(_-S)].filter(o):[]}var d,p,f,g,m,b=i[0].y,w=i[1].y,y=i[2].y,x=3*w-b-3*y+i[3].y,v=(3*b-6*w+3*y)/x,_=(-3*b+3*w)/x,S=b/x,C=(i=(3*_-v*v)/3)/3,F=(2*v*v*v-9*v*_+27*S)/27,T=F/2,N=T*T+C*C*C;if(N<0){var O=-i/3,M=u(O*O*O),V=-F/(2*M),D=s(V<-1?-1:V>1?1:V),I=2*l(M);return f=I*r(D/3)-v/3,g=I*r((D+h)/3)-v/3,m=I*r((D+2*h)/3)-v/3,[f,g,m].filter(o)}if(0===N)return d=T<0?l(-T):-l(T),f=2*d-v/3,g=-d-v/3,[f,g].filter(o);var B=u(N);return d=l(-T+B),p=l(T+B),[d-p-v/3].filter(o)},droots:function(e){if(3===e.length){var t=e[0],n=e[1],i=e[2],r=t-2*n+i;if(0!==r){var o=-u(n*n-t*i),s=-t+n;return[-(o+s)/r,-(-o+s)/r]}return n!==i&&0===r?[(2*n-i)/(2*(n-i))]:[]}if(2===e.length)return(t=e[0])!==(n=e[1])?[t/(t-n)]:[]},bboxoverlap:function(t,n){var i,r,o,s,a,u=["x","y"],l=u.length;for(i=0;i<l;i++)if(r=u[i],o=t[r].mid,s=n[r].mid,a=(t[r].size+n[r].size)/2,e(o-s)>=a)return!1;return!0},expandbox:function(e,t){t.x.min<e.x.min&&(e.x.min=t.x.min),t.y.min<e.y.min&&(e.y.min=t.y.min),t.z&&t.z.min<e.z.min&&(e.z.min=t.z.min),t.x.max>e.x.max&&(e.x.max=t.x.max),t.y.max>e.y.max&&(e.y.max=t.y.max),t.z&&t.z.max>e.z.max&&(e.z.max=t.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,t){var n=e.bbox(),i=t.bbox(),r=1e5;if(n.x.size+n.y.size<.5&&i.x.size+i.y.size<.5)return[(r*(e._t1+e._t2)/2|0)/r+"/"+(r*(t._t1+t._t2)/2|0)/r];var o=e.split(.5),s=t.split(.5),a=[{left:o.left,right:s.left},{left:o.left,right:s.right},{left:o.right,right:s.right},{left:o.right,right:s.left}],u=[];return 0===(a=a.filter(function(e){return f.bboxoverlap(e.left.bbox(),e.right.bbox())})).length?u:(a.forEach(function(e){u=u.concat(f.pairiteration(e.left,e.right))}),u=u.filter(function(e,t){return u.indexOf(e)===t}))},getccenter:function(e,t,n){var i,s=t.x-e.x,u=t.y-e.y,l=n.x-t.x,c=n.y-t.y,p=s*r(d)-u*o(d),g=s*o(d)+u*r(d),m=l*r(d)-c*o(d),b=l*o(d)+c*r(d),w=(e.x+t.x)/2,y=(e.y+t.y)/2,x=(t.x+n.x)/2,v=(t.y+n.y)/2,_=w+p,S=y+g,C=x+m,F=v+b,T=f.lli8(w,y,_,S,x,v,C,F),N=f.dist(T,e),O=a(e.y-T.y,e.x-T.x),M=a(t.y-T.y,t.x-T.x),V=a(n.y-T.y,n.x-T.x);return O<V?((O>M||M>V)&&(O+=h),O>V&&(i=V,V=O,O=i)):V<M&&M<O?(i=V,V=O,O=i):V+=h,T.s=O,T.e=V,T.r=N,T}},g=function(e){this.curves=[],this._3d=!1,e&&(this.curves=e,this._3d=this.curves[0]._3d)};g.prototype={valueOf:function(){return this.toString()},toString:function(){return f.pointsToString(this.points)},addCurve:function(e){this.curves.push(e),this._3d=this._3d||e._3d},length:function(){return this.curves.map(function(e){return e.length()}).reduce(function(e,t){return e+t})},curve:function(e){return this.curves[e]},bbox:function(){for(var e=this.curves,t=e[0].bbox(),n=1;n<e.length;n++)f.expandbox(t,e[n].bbox());return t},offset:function(e){var t=[];return this.curves.forEach(function(n){t=t.concat(n.offset(e))}),new g(t)}};var m=function(t){var n=t&&t.forEach?t:arguments;if("object"==typeof n[0]){n=[];for(var i=0;i<t.length;i++)["x","y","z"].forEach(function(e){void 0!==t[i][e]&&n.push(t[i][e])})}var r=n.length;if(6!==r&&8!==r&&9!==r&&12!==r)throw console.log(t),new Error("This Bezier curve library only supports quadratic and cubic curves (in 2d and 3d)");var o=9===r||12===r;this._3d=o;for(var s=[],a=0,u=o?3:2;a<r;a+=u){var l={x:n[a],y:n[a+1]};o&&(l.z=n[a+2]),s.push(l)}this.order=s.length-1,this.points=s;var c=["x","y"];o&&c.push("z"),this.dims=c,this.dimlen=c.length,function(t){for(var n=f.align(s,{p1:s[0],p2:s[t.order]}),i=0;i<n.length;i++)if(e(n[i].y)>1e-4)return void(t._linear=!1);t._linear=!0}(this),this._t1=0,this._t2=1,this.update()};return m.fromSVG=function(e){var t=e.match(/[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?/g).map(parseFloat);return/[cq]/.test(e)?(t=t.map(function(e,n){return n<2?e:e+t[n%2]}),new m(t)):new m(t)},m.utils=f,m.prototype={valueOf:function(){return this.toString()},toString:function(){return f.pointsToString(this.points)},toSVG:function(e){if(this._3d)return!1;for(var t=this.points,n=["M",t[0].x,t[0].y,2===this.order?"Q":"C"],i=1,r=t.length;i<r;i++)n.push(t[i].x),n.push(t[i].y);return n.join(" ")},update:function(){this.dpoints=[];for(var e=this.points,t=e.length,n=t-1;t>1;t--,n--){for(var i,r=[],o=0;o<n;o++)i={x:n*(e[o+1].x-e[o].x),y:n*(e[o+1].y-e[o].y)},this._3d&&(i.z=n*(e[o+1].z-e[o].z)),r.push(i);this.dpoints.push(r),e=r}this.computedirection()},computedirection:function(){var e=this.points,t=f.angle(e[0],e[this.order],e[1]);this.clockwise=t>0},length:function(){return f.length(this.derivative.bind(this))},getLUT:function(e){e=e||100;for(var t=[],n=0;n<=e;n++)t.push(this.compute(n/e));return t},get:function(e){return this.compute(e)},point:function(e){return this.points[e]},compute:function(e){if(0===e)return this.points[0];if(1===e)return this.points[this.order];var t,n,i,r=1-e,o=r*r,s=e*e,a=0,u=this.points;2===this.order&&(u=[u[0],u[1],u[2],p],t=o,n=r*e*2,i=s),3===this.order&&(t=o*r,n=o*e*3,i=r*s*3,a=e*s);var l={x:t*u[0].x+n*u[1].x+i*u[2].x+a*u[3].x,y:t*u[0].y+n*u[1].y+i*u[2].y+a*u[3].y};return this._3d&&(l.z=t*u[0].z+n*u[1].z+i*u[2].z+a*u[3].z),l},raise:function(){for(var e,t,n=this.points,i=[n[0]],r=n.length,o=1;o<r;o++)e=n[o],t=n[o-1],i[o]={x:(r-o)/r*e.x+o/r*t.x,y:(r-o)/r*e.y+o/r*t.y};return i[r]=n[r-1],new m(i)},derivative:function(e){var t,n,i=1-e,r=0,o=this.dpoints[0];2===this.order&&(o=[o[0],o[1],p],t=i,n=e),3===this.order&&(t=i*i,n=i*e*2,r=e*e);var s={x:t*o[0].x+n*o[1].x+r*o[2].x,y:t*o[0].y+n*o[1].y+r*o[2].y};return this._3d&&(s.z=t*o[0].z+n*o[1].z+r*o[2].z),s},normal:function(e){return this._3d?this.__normal3(e):this.__normal2(e)},__normal2:function(e){var t=this.derivative(e),n=u(t.x*t.x+t.y*t.y);return{x:-t.y/n,y:t.x/n}},__normal3:function(){var e=this.derivative(t),n=this.derivative(t+.01),i=u(e.x*e.x+e.y*e.y+e.z*e.z),r=u(n.x*n.x+n.y*n.y+n.z*n.z);e.x/=i,e.y/=i,e.z/=i,n.x/=r,n.y/=r,n.z/=r;var o={x:n.y*e.z-n.z*e.y,y:n.z*e.x-n.x*e.z,z:n.x*e.y-n.y*e.x},s=u(o.x*o.x+o.y*o.y+o.z*o.z);o.x/=s,o.y/=s,o.z/=s;var a=[o.x*o.x,o.x*o.y-o.z,o.x*o.z+o.y,o.x*o.y+o.z,o.y*o.y,o.y*o.z-o.x,o.x*o.z-o.y,o.y*o.z+o.x,o.z*o.z];return{x:a[0]*e.x+a[1]*e.y+a[2]*e.z,y:a[3]*e.x+a[4]*e.y+a[5]*e.z,z:a[6]*e.x+a[7]*e.y+a[8]*e.z}},split:function(e,t){if(0===e&&t)return this.split(t).left;if(1===t)return this.split(e).right;var n,i=this.points,r=[],o=[],s=0,a=0,u=0;for(o[s++]=i[0],o[s++]=i[1],o[s++]=i[2],3===this.order&&(o[s++]=i[3]);i.length>1;){for(r=[],a=0,u=i.length-1;a<u;a++)n=f.lerp(e,i[a],i[a+1]),o[s++]=n,r.push(n);i=r}var l={left:new m(2===this.order?[o[0],o[3],o[5]]:[o[0],o[4],o[7],o[9]]),right:new m(2===this.order?[o[5],o[4],o[2]]:[o[9],o[8],o[6],o[3]]),span:o};return l.left._t1=f.map(0,0,1,this._t1,this._t2),l.left._t2=f.map(e,0,1,this._t1,this._t2),l.right._t1=f.map(e,0,1,this._t1,this._t2),l.right._t2=f.map(1,0,1,this._t1,this._t2),t?(t=f.map(t,e,1,0,1),l.right.split(t).left):l},inflections:function(){var e,t,n=this.dims,i=(this.dimlen,{}),r=[];return n.forEach(function(n){t=function(e){return e[n]},e=this.dpoints[0].map(t),i[n]=f.droots(e),3===this.order&&(e=this.dpoints[1].map(t),i[n]=i[n].concat(f.droots(e))),i[n]=i[n].filter(function(e){return e>=0&&e<=1}),r=r.concat(i[n].sort())}.bind(this)),r.sort(),i.values=r,i},bbox:function(){var e=this.inflections(),t={};return this.dims.forEach(function(n){t[n]=f.getminmax(this,n,e[n])}.bind(this)),t},overlaps:function(e){var t=this.bbox(),n=e.bbox();return f.bboxoverlap(t,n)},offset:function(e,t){if(void 0!==t){var n=this.get(e),i=this.normal(e),r={c:n,n:i,x:n.x+i.x*t,y:n.y+i.y*t};return this._3d&&(r.z=n.z+i.z*t),r}if(this._linear){var o=this.normal(0),s=this.points.map(function(t){var n={x:t.x+e*o.x,y:t.y+e*o.y};return t.z&&i.z&&(n.z=t.z+e*o.z),n});return[new m(s)]}return this.reduce().map(function(t){return t.scale(e)})},simple:function(){if(3===this.order){var t=f.angle(this.points[0],this.points[3],this.points[1]),n=f.angle(this.points[0],this.points[3],this.points[2]);if(t>0&&n<0||t<0&&n>0)return!1}var i=this.normal(0),r=this.normal(1),o=i.x*r.x+i.y*r.y;return this._3d&&(o+=i.z*r.z),e(s(o))<c/3},reduce:function(){var t,n,i=0,r=0,o=[],s=[],a=this.inflections().values;for(-1===a.indexOf(0)&&(a=[0].concat(a)),-1===a.indexOf(1)&&a.push(1),i=a[0],t=1;t<a.length;t++)r=a[t],(n=this.split(i,r))._t1=i,n._t2=r,o.push(n),i=r;return o.forEach(function(t){for(i=0,r=0;r<=1;)for(r=i+.01;r<=1.01;r+=.01)if(!(n=t.split(i,r)).simple()){if(r-=.01,e(i-r)<.01)return[];(n=t.split(i,r))._t1=f.map(i,0,1,t._t1,t._t2),n._t2=f.map(r,0,1,t._t1,t._t2),s.push(n),i=r;break}i<1&&((n=t.split(i,1))._t1=f.map(i,0,1,t._t1,t._t2),n._t2=t._t2,s.push(n))}),s},scale:function(e){var t=this.order,n=!1;if("function"==typeof e&&(n=e),n&&2===t)return this.raise().scale(n);var i=this.clockwise,r=n?n(0):e,o=n?n(1):e,s=[this.offset(0,10),this.offset(1,10)],a=f.lli4(s[0],s[0].c,s[1],s[1].c);if(!a)throw"cannot scale this curve. Try reducing it first.";var l=this.points,c=[];return[0,1].forEach(function(e){var n=c[e*t]=f.copy(l[e*t]);n.x+=(e?o:r)*s[e].n.x,n.y+=(e?o:r)*s[e].n.y}.bind(this)),n?([0,1].forEach(function(r){if(2!==this.order||!r){var o=l[r+1],s={x:o.x-a.x,y:o.y-a.y},h=n?n((r+1)/t):e;n&&!i&&(h=-h);var d=u(s.x*s.x+s.y*s.y);s.x/=d,s.y/=d,c[r+1]={x:o.x+h*s.x,y:o.y+h*s.y}}}.bind(this)),new m(c)):([0,1].forEach(function(e){if(2!==this.order||!e){var n=c[e*t],i=this.derivative(e),r={x:n.x+i.x,y:n.y+i.y};c[e+1]=f.lli4(n,r,a,l[e+1])}}.bind(this)),new m(c))},outline:function(e,t,n,i){function r(e,t,n,i,r){return function(o){var s=i/n,a=(i+r)/n,u=t-e;return f.map(o,0,1,e+s*u,e+a*u)}}t=void 0===t?e:t;var o,s=this.reduce(),a=s.length,u=(this.order,[]),l=[],c=0,h=this.length(),d=void 0!==n&&void 0!==i;s.forEach(function(o){_=o.length(),d?(u.push(o.scale(r(e,n,h,c,_))),l.push(o.scale(r(-t,-i,h,c,_)))):(u.push(o.scale(e)),l.push(o.scale(-t))),c+=_}),l=l.map(function(e){return o=e.points,o[3]?e.points=[o[3],o[2],o[1],o[0]]:e.points=[o[2],o[1],o[0]],e}).reverse();var p=u[0].points[0],m=u[a-1].points[u[a-1].points.length-1],b=l[a-1].points[l[a-1].points.length-1],w=l[0].points[0],y=f.makeline(b,p),x=f.makeline(m,w),v=[y].concat(u).concat([x]).concat(l),_=v.length;return new g(v)},outlineshapes:function(e,t){t=t||e;for(var n=this.outline(e,t).curves,i=[],r=1,o=n.length;r<o/2;r++){var s=f.makeshape(n[r],n[o-r]);s.startcap.virtual=r>1,s.endcap.virtual=r<o/2-1,i.push(s)}return i},intersects:function(e){return e?e.p1&&e.p2?this.lineIntersects(e):(e instanceof m&&(e=e.reduce()),this.curveintersects(this.reduce(),e)):this.selfintersects()},lineIntersects:function(e){var t=n(e.p1.x,e.p2.x),r=n(e.p1.y,e.p2.y),o=i(e.p1.x,e.p2.x),s=i(e.p1.y,e.p2.y),a=this;return f.roots(this.points,e).filter(function(e){var n=a.get(e);return t<=n.x&&n.x<=o&&r<=n.y&&n.y<=s})},selfintersects:function(){var e,t,n,i,r=this.reduce(),o=r.length-2,s=[];for(e=0;e<o;e++)n=r.slice(e,e+1),i=r.slice(e+2),t=this.curveintersects(n,i),s=s.concat(t);return s},curveintersects:function(e,t){var n=[];e.forEach(function(e){t.forEach(function(t){e.overlaps(t)&&n.push({left:e,right:t})})});var i=[];return n.forEach(function(e){var t=f.pairiteration(e.left,e.right);t.length>0&&(i=i.concat(t))}),i},arcs:function(e){e=e||.5;var t=[];return this._iterate(e,t)},_error:function(t,n,i,r){var o=(r-i)/4,s=this.get(i+o),a=this.get(r-o),u=f.dist(t,n),l=f.dist(t,s),c=f.dist(t,a);return e(l-u)+e(c-u)},_iterate:function(e,t){var n,i=0,r=1;do{n=0,r=1;var o,s,a,u,l,c=this.get(i),h=!1,d=!1,p=r,g=1,m=0;do{if(d=h,u=a,p=(i+r)/2,m++,o=this.get(p),s=this.get(r),a=f.getccenter(c,o,s),h=this._error(a,c,i,r)<=e,(l=d&&!h)||(g=r),h){if(r>=1){g=1,u=a;break}r+=(r-i)/2}else r=p}while(!l&&n++<100);if(n>=100){console.error("arc abstraction somehow failed...");break}u=u||a,t.push(u),i=g}while(r<1);return t}},m}),define("lib/earcut/src/earcut.js",[],function(){function e(e,r,o){o=o||2;var s=r&&r.length,u=s?r[0]*o:e.length,l=n(e,t(e,0,u,o,!0)),c=[];if(!l)return c;var h,d,p,f,g,m,b;if(s&&(l=a(e,r,l,o)),e.length>80*o){h=p=e[0],d=f=e[1];for(var w=o;w<u;w+=o)g=e[w],m=e[w+1],g<h&&(h=g),m<d&&(d=m),g>p&&(p=g),m>f&&(f=m);b=Math.max(p-h,f-d)}return i(e,l,c,o,h,d,b),c}function t(e,t,n,i,r){var o,s,a,u=0;for(o=t,s=n-i;o<n;o+=i)u+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;if(r===u>0)for(o=t;o<n;o+=i)a=_(o,a);else for(o=n-i;o>=t;o-=i)a=_(o,a);return a}function n(e,t,n){n||(n=t);var i,r=t;do{if(i=!1,r.steiner||!m(e,r.i,r.next.i)&&0!==g(e,r.prev.i,r.i,r.next.i))r=r.next;else{if(r.prev.next=r.next,r.next.prev=r.prev,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ),(r=n=r.prev)===r.next)return null;i=!0}}while(i||r!==n);return n}function i(e,t,a,u,l,h,d,p){if(t){p||void 0===l||c(e,t,l,h,d);for(var f,g,m=t;t.prev!==t.next;)if(f=t.prev,g=t.next,r(e,t,l,h,d))a.push(f.i/u),a.push(t.i/u),a.push(g.i/u),g.prev=f,f.next=g,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),t=g.next,m=g.next;else if((t=g)===m){p?1===p?i(e,t=o(e,t,a,u),a,u,l,h,d,2):2===p&&s(e,t,a,u,l,h,d):i(e,n(e,t),a,u,l,h,d,1);break}}}function r(e,t,n,i,r){var o=t.prev.i,s=t.i,a=t.next.i,u=e[o],l=e[o+1],c=e[s],h=e[s+1],p=e[a],f=e[a+1],g=u*h-l*c,m=u*f-l*p,b=g-m-(p*h-f*c);if(b<=0)return!1;var w,y,x,v,_,S,C,F=f-l,T=u-p,N=l-h,O=c-u;if(void 0!==n){var M=u<c?u<p?u:p:c<p?c:p,V=l<h?l<f?l:f:h<f?h:f,D=u>c?u>p?u:p:c>p?c:p,I=l>h?l>f?l:f:h>f?h:f,B=d(M,V,n,i,r),E=d(D,I,n,i,r);for(C=t.nextZ;C&&C.z<=E;)if(w=C.i,C=C.nextZ,w!==o&&w!==a&&(y=e[w],x=e[w+1],(v=F*y+T*x-m)>=0&&(_=N*y+O*x+g)>=0&&(S=b-v-_)>=0&&(v&&_||v&&S||_&&S)))return!1;for(C=t.prevZ;C&&C.z>=B;)if(w=C.i,C=C.prevZ,w!==o&&w!==a&&(y=e[w],x=e[w+1],(v=F*y+T*x-m)>=0&&(_=N*y+O*x+g)>=0&&(S=b-v-_)>=0&&(v&&_||v&&S||_&&S)))return!1}else for(C=t.next.next;C!==t.prev;)if(w=C.i,C=C.next,y=e[w],x=e[w+1],(v=F*y+T*x-m)>=0&&(_=N*y+O*x+g)>=0&&(S=b-v-_)>=0&&(v&&_||v&&S||_&&S))return!1;return!0}function o(e,t,n,i){var r=t;do{var o=r.prev,s=r.next.next;if(o.i!==s.i&&b(e,o.i,r.i,r.next.i,s.i)&&y(e,o,s)&&y(e,s,o)){n.push(o.i/i),n.push(r.i/i),n.push(s.i/i),o.next=s,s.prev=o;var a=r.prevZ,u=r.nextZ&&r.nextZ.nextZ;a&&(a.nextZ=u),u&&(u.prevZ=a),r=t=s}r=r.next}while(r!==t);return r}function s(e,t,r,o,s,a,u){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&f(e,l,c)){var h=v(l,c);return l=n(e,l,l.next),h=n(e,h,h.next),i(e,l,r,o,s,a,u),void i(e,h,r,o,s,a,u)}c=c.next}l=l.next}while(l!==t)}function a(e,i,r,o){var s,a,l,c,h,d=[];for(s=0,a=i.length;s<a;s++)l=i[s]*o,c=s<a-1?i[s+1]*o:e.length,(h=t(e,l,c,o,!1))===h.next&&(h.steiner=!0),(h=n(e,h))&&d.push(p(e,h));for(d.sort(function(t,n){return e[t.i]-e[n.i]}),s=0;s<d.length;s++)u(e,d[s],r),r=n(e,r,r.next);return r}function u(e,t,i){if(i=l(e,t,i)){var r=v(i,t);n(e,r,r.next)}}function l(e,t,n){var i,r,o,s=n,a=t.i,u=e[a],l=e[a+1],c=-1/0;do{if(r=s.i,o=s.next.i,l<=e[r+1]&&l>=e[o+1]){var h=e[r]+(l-e[r+1])*(e[o]-e[r])/(e[o+1]-e[r+1]);h<=u&&h>c&&(c=h,i=e[r]<e[o]?s:s.next)}s=s.next}while(s!==n);if(!i)return null;var d,p,f,g,m,b,w=e[i.i],x=e[i.i+1],v=u*x-l*w,_=u*l-l*c,S=l-l,C=u-c,F=l-x,T=w-u,N=v-_-(c*x-l*w),O=N<=0?-1:1,M=i,V=1/0;for(s=i.next;s!==M;)d=e[s.i],p=e[s.i+1],(f=u-d)>=0&&d>=w&&(g=(S*d+C*p-_)*O)>=0&&(m=(F*d+T*p+v)*O)>=0&&N*O-g-m>=0&&(b=Math.abs(l-p)/f)<V&&y(e,s,t)&&(i=s,V=b),s=s.next;return i}function c(e,t,n,i,r){var o=t;do{null===o.z&&(o.z=d(e[o.i],e[o.i+1],n,i,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,h(o)}function h(e){var t,n,i,r,o,s,a,u,l=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,i=n,a=0,t=0;t<l&&(a++,i=i.nextZ);t++);for(u=l;a>0||u>0&&i;)0===a?(r=i,i=i.nextZ,u--):0!==u&&i?n.z<=i.z?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,u--):(r=n,n=n.nextZ,a--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(s>1);return e}function d(e,t,n,i,r){return e=1e3*(e-n)/r,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=1e3*(t-i)/r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e,t){var n=t,i=t;do{e[n.i]<e[i.i]&&(i=n),n=n.next}while(n!==t);return i}function f(e,t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!w(e,t,t.i,n.i)&&y(e,t,n)&&y(e,n,t)&&x(e,t,t.i,n.i)}function g(e,t,n,i){var r=(e[n+1]-e[t+1])*(e[i]-e[n])-(e[n]-e[t])*(e[i+1]-e[n+1]);return r>0?1:r<0?-1:0}function m(e,t,n){return e[t]===e[n]&&e[t+1]===e[n+1]}function b(e,t,n,i,r){return g(e,t,n,i)!==g(e,t,n,r)&&g(e,i,r,t)!==g(e,i,r,n)}function w(e,t,n,i){var r=t;do{var o=r.i,s=r.next.i;if(o!==n&&s!==n&&o!==i&&s!==i&&b(e,o,s,n,i))return!0;r=r.next}while(r!==t);return!1}function y(e,t,n){return-1===g(e,t.prev.i,t.i,t.next.i)?-1!==g(e,t.i,n.i,t.next.i)&&-1!==g(e,t.i,t.prev.i,n.i):-1===g(e,t.i,n.i,t.prev.i)||-1===g(e,t.i,t.next.i,n.i)}function x(e,t,n,i){var r=t,o=!1,s=(e[n]+e[i])/2,a=(e[n+1]+e[i+1])/2;do{var u=r.i,l=r.next.i;e[u+1]>a!=e[l+1]>a&&s<(e[l]-e[u])*(a-e[u+1])/(e[l+1]-e[u+1])+e[u]&&(o=!o),r=r.next}while(r!==t);return o}function v(e,t){var n=new S(e.i),i=new S(t.i),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function _(e,t){var n=new S(e);return t?(n.next=t.next,n.prev=t,t.next.prev=n,t.next=n):(n.prev=n,n.next=n),n}function S(e){this.i=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}return e}),define("cobweb/Browser/Text/PolygonText",["jquery","cobweb/Browser/Core/PrimitiveQuality","cobweb/Browser/Text/X3DTextGeometry","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Triangle2","lib/bezierjs/bezier.js","lib/poly2tri.js/dist/poly2tri.js","lib/earcut/src/earcut.js"],function(e,t,n,i,r,o,s,a,u){function l(e,t){n.call(this,e,t),e.transparent_=!1,this.texCoords=[]}var c=new i(0,0,0),h=new i(0,0,0),d=[],p=[],f=[];return l.prototype=e.extend(Object.create(n.prototype),{constructor:l,getMatrix:function(){return r.Identity},build:function(){var e=this.getFontStyle(),t=e.getFont();if(t){var n=this.getText(),i=this.getGlyphs(),r=this.getMinorAlignment(),o=this.getTranslations(),s=this.getCharSpacings(),a=e.getScale(),u=e.spacing_.getValue(),l=n.origin_.getValue(),d=a/t.unitsPerEm,p=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),f=this.texCoords,g=n.getNormals(),m=n.getVertices();if(f.length=0,n.getTexCoords().push(f),this.getBBox().getExtents(c,h),n.getMin().assign(c),n.getMax().assign(h),e.horizontal_.getValue())for(var b=0,w=i.length;b<w;++b)for(var y=i[b],x=s[b],v=o[b],_=0,S=0,C=y.length;S<C;++S){for(var F=y[S],T=0,N=(j=this.getGlyphGeometry(F,p)).length;T<N;++T){var O=j[T].x*a+r.x+v.x+_+S*x,M=j[T].y*a+r.y+v.y;f.push((O-l.x)/u,(M-l.y)/u,0,1),g.push(0,0,1),m.push(O,M,0,1)}var V=0;S+1<y.length&&(V=t.getKerningValue(F,y[S+1])),_+=(F.advanceWidth+V)*d}else for(var D=e.leftToRight_.getValue(),I=e.topToBottom_.getValue(),B=D?0:n.string_.length-1,E=D?n.string_.length:-1,A=D?1:-1,b=B,P=0;b!==E;b+=A)for(var L=(y=i[b]).length,R=I?0:L-1,k=I?L:-1,z=I?1:-1,S=R;S!==k;S+=z,++P)for(var v=o[P],j=this.getGlyphGeometry(y[S],p),T=0,N=j.length;T<N;++T){var O=j[T].x*a+r.x+v.x,M=j[T].y*a+r.y+v.y;f.push((O-l.x)/u,(M-l.y)/u,0,1),g.push(0,0,1),m.push(O,M,0,1)}}},getGlyphExtents:function(e,t,n,i){var r=e.extents[t];if(r)return n.assign(r.min),void i.assign(r.max);var o=this.getGlyphGeometry(e,t);if(o.length){u=o[0];n.assign(u),i.assign(u);for(var s=1,a=o.length;s<a;++s){var u=o[s];n.min(u),i.max(u)}}else n.set(0,0,0),i.set(0,0,0);(r=e.extents[t]={}).min=n.copy(),r.max=i.copy()},getGlyphGeometry:function(e,t){var n=this.getFontStyle().getFont(),i=this.getBrowser().getFontGeometryCache(),r=i[n.fontName];r||(i[n.fontName]=r=[[],[],[]]);var o=r[t][e.index];return o||(o=r[t][e.index]=[],this.createGlyphGeometry(e,o,t),o)},createGlyphGeometry:function(e,t,n){var i=this.getFontStyle().getFont(),r=e.components,o=this.getBezierDimension(n),a="cff"===i.outlinesFormat;if(d.length=0,p.length=0,f.length=0,e.isComposite)for(var u=0,l=r.length;u<l;++u){var c=r[u];d.push(i.glyphs.get(c.glyphIndex).getPath(c.dx/i.unitsPerEm,c.dy/-i.unitsPerEm,1))}else d.push(e.getPath(0,0,1));for(var h=0,g=0,m=0,b=d.length;m<b;++m)for(var w=d[m].commands,y=0,l=w.length;y<l;++y){var x=w[y];switch(x.type){case"M":case"Z":p.length>2&&(p[0].x===p[p.length-1].x&&p[0].y===p[p.length-1].y&&p.pop(),f.push(a?p.reverse():p)),p=[],"M"===x.type&&p.push({x:x.x,y:-x.y});break;case"L":p.push({x:x.x,y:-x.y});break;case"C":for(var v=1,_=(S=(T=new s(h,-g,x.x1,-x.y1,x.x2,-x.y2,x.x,-x.y)).getLUT(o)).length;v<_;++v)p.push(S[v]);break;case"Q":for(var S=(T=new s(h,-g,x.x1,-x.y1,x.x,-x.y)).getLUT(o),v=1,_=S.length;v<_;++v)p.push(S[v]);break;default:continue}h=x.x,g=x.y}var C=[],F=[];switch(f.length){case 0:break;case 1:C=f;break;default:for(var y=0,l=f.length;y<l;++y){var T=f[y];this.getCurveOrientation(T)<0?C.push(T):F.push(T)}}switch(C.map(this.removeCollinearPoints),F.map(this.removeCollinearPoints),C.length){case 0:break;case 1:C[0].holes=F;break;default:for(var u=0,l=C.length;u<l;++u)C[u].holes=[];for(var N=0,O=F.length;N<O;++N)for(var M=F[N],u=0,l=C.length;u<l;++u){var V=C[u];if(this.isPointInPolygon(V.slice(),M[0])){V.holes.push(M);break}}}for(var y=0,D=C.length;y<D;++y)this.triangulate(C[y],C[y].holes,t)},getBezierDimension:function(e){switch(e){case t.LOW:return 3;case t.HIGH:return 7;default:return 5}},getCurveOrientation:function(e){for(var t=Number.POSITIVE_INFINITY,n=0,i=0,r=e.length;i<r;++i)e[i].x<t&&(t=e[i].x,n=i);var o=e[(n+r-1)%r],s=e[n],a=e[(n+2)%r];return(s.x-o.x)*(a.y-o.y)-(a.x-o.x)*(s.y-o.y)},isPointInPolygon:function(e,t){try{for(var n=new a.SweepContext(e).triangulate().getTriangles(),i=0,r=n.length;i<r;++i){var s=n[i].getPoint(0),u=n[i].getPoint(1),l=n[i].getPoint(2);if(o.isPointInTriangle(s,u,l,t))return!0}return!1}catch(e){}},removeCollinearPoints:function(e){for(var t=0,n=0,i=e.length;t<i;++t){var r=(t+1)%i;(function(e,t,n){return Math.abs((e.y-t.y)*(e.x-n.x)-(e.y-n.y)*(e.x-t.x))<1e-8})(e[(t-1+i)%i],e[t],e[r])||(e[n++]=e[t])}e.length=n},triangulate:function(e,t,n){try{for(var i=new a.SweepContext(e).addHoles(t).triangulate().getTriangles(),r=0,o=i.length;r<o;++r)n.push(i[r].getPoint(0),i[r].getPoint(1),i[r].getPoint(2))}catch(i){this.earcutTriangulate(e,t,n)}},earcutTriangulate:function(e,t,n){try{for(var i=[],r=[],o=0,s=e.length;o<s;++o)i.push(e[o].x,e[o].y);for(var a=0,l=t.length;a<l;++a)for(var c=t[a],o=0,h=c.length;o<h;++o)r.push(i.length/2),i.push(c[o].x,c[o].y),e.push(c[o]);for(var d=u(i,r),p=0,f=d.length;p<f;++p)n.push(e[d[p]])}catch(e){}},display:function(e){},transformLine:function(e){},transformMatrix:function(e){}}),l}),define("cobweb/Components/Text/FontStyle",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Text/X3DFontStyleNode","cobweb/Browser/Text/PolygonText","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.FontStyle)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"language",new t.SFString),new n(s.initializeOnly,"family",new t.MFString("SERIF")),new n(s.initializeOnly,"style",new t.SFString("PLAIN")),new n(s.initializeOnly,"size",new t.SFFloat(1)),new n(s.initializeOnly,"spacing",new t.SFFloat(1)),new n(s.initializeOnly,"horizontal",new t.SFBool(!0)),new n(s.initializeOnly,"leftToRight",new t.SFBool(!0)),new n(s.initializeOnly,"topToBottom",new t.SFBool(!0)),new n(s.initializeOnly,"justify",new t.MFString("BEGIN"))]),getTypeName:function(){return"FontStyle"},getComponentName:function(){return"Text"},getContainerField:function(){return"fontStyle"},getTextGeometry:function(e){return new o(e,this)},getScale:function(){return this.size_.getValue()}}),a}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("lib/opentype.js/dist/opentype.js",[],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).opentype=e()}}(function(){return function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return r(n||e)},c,c.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,t,n){n.argument=function(e,t){if(!e)throw new Error(t)},n.assert=n.argument},{}],2:[function(e,t,n){function i(e,t,n,i,r){e.beginPath(),e.moveTo(t,n),e.lineTo(i,r),e.stroke()}n.line=i},{}],3:[function(e,t,n){function i(e){this.font=e}function r(e){this.cmap=e}function o(e,t){this.encoding=e,this.charset=t}function s(e){var t;switch(e.version){case 1:this.names=n.standardNames.slice();break;case 2:for(this.names=new Array(e.numberOfGlyphs),t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<n.standardNames.length?this.names[t]=n.standardNames[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-n.standardNames.length];break;case 2.5:for(this.names=new Array(e.numberOfGlyphs),t=0;t<e.numberOfGlyphs;t++)this.names[t]=n.standardNames[t+e.glyphNameIndex[t]];break;case 3:this.names=[]}}function a(e){for(var t,n=e.tables.cmap.glyphIndexMap,i=Object.keys(n),r=0;r<i.length;r+=1){var o=i[r],s=n[o];(t=e.glyphs.get(s)).addUnicode(parseInt(o))}for(r=0;r<e.glyphs.length;r+=1)t=e.glyphs.get(r),e.cffEncoding?t.name=e.cffEncoding.charset[r]:t.name=e.glyphNames.glyphIndexToName(r)}var u=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],l=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],c=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],h=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];i.prototype.charToGlyphIndex=function(e){var t=e.charCodeAt(0),n=this.font.glyphs;if(!n)return null;for(var i=0;i<n.length;i+=1)for(var r=n.get(i),o=0;o<r.unicodes.length;o+=1)if(r.unicodes[o]===t)return i},r.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.charCodeAt(0)]||0},o.prototype.charToGlyphIndex=function(e){var t=e.charCodeAt(0),n=this.encoding[t];return this.charset.indexOf(n)},s.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},s.prototype.glyphIndexToName=function(e){return this.names[e]},n.cffStandardStrings=u,n.cffStandardEncoding=l,n.cffExpertEncoding=c,n.standardNames=h,n.DefaultEncoding=i,n.CmapEncoding=r,n.CffEncoding=o,n.GlyphNames=s,n.addGlyphNames=a},{}],4:[function(e,t,n){function i(e){e=e||{},this.familyName=e.familyName||" ",this.styleName=e.styleName||" ",this.designer=e.designer||" ",this.designerURL=e.designerURL||" ",this.manufacturer=e.manufacturer||" ",this.manufacturerURL=e.manufacturerURL||" ",this.license=e.license||" ",this.licenseURL=e.licenseURL||" ",this.version=e.version||"Version 0.1",this.description=e.description||" ",this.copyright=e.copyright||" ",this.trademark=e.trademark||" ",this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.supported=!0,this.glyphs=new a.GlyphSet(this,e.glyphs||[]),this.encoding=new s.DefaultEncoding(this),this.tables={}}var r=e("./path"),o=e("./tables/sfnt"),s=e("./encoding"),a=e("./glyphset");i.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},i.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},i.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},i.prototype.stringToGlyphs=function(e){for(var t=[],n=0;n<e.length;n+=1){var i=e[n];t.push(this.charToGlyph(i))}return t},i.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},i.prototype.nameToGlyph=function(e){var t=this.nametoGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},i.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},i.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var n=this.getGposKerningValue;return n?n(e,t):this.kerningPairs[e+","+t]||0},i.prototype.forEachGlyph=function(e,t,n,i,r,o){t=void 0!==t?t:0,n=void 0!==n?n:0,i=void 0!==i?i:72;for(var s=void 0===(r=r||{}).kerning||r.kerning,a=1/this.unitsPerEm*i,u=this.stringToGlyphs(e),l=0;l<u.length;l+=1){var c=u[l];o(c,t,n,i,r),c.advanceWidth&&(t+=c.advanceWidth*a),s&&l<u.length-1&&(t+=this.getKerningValue(c,u[l+1])*a)}},i.prototype.getPath=function(e,t,n,i,o){var s=new r.Path;return this.forEachGlyph(e,t,n,i,o,function(e,t,n,i){var r=e.getPath(t,n,i);s.extend(r)}),s},i.prototype.draw=function(e,t,n,i,r,o){this.getPath(t,n,i,r,o).draw(e)},i.prototype.drawPoints=function(e,t,n,i,r,o){this.forEachGlyph(t,n,i,r,o,function(t,n,i,r){t.drawPoints(e,n,i,r)})},i.prototype.drawMetrics=function(e,t,n,i,r,o){this.forEachGlyph(t,n,i,r,o,function(t,n,i,r){t.drawMetrics(e,n,i,r)})},i.prototype.validate=function(){function e(e,t){e||n.push(t)}function t(t){e(i[t]&&i[t].trim().length>0,"No "+t+" specified.")}var n=[],i=this;t("familyName"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),e(this.unitsPerEm>0,"No unitsPerEm specified.")},i.prototype.toTables=function(){return o.fontToTable(this)},i.prototype.toBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i++)n[i]=e[i];return t},i.prototype.download=function(){var e=this.familyName.replace(/\s/g,"")+"-"+this.styleName+".otf",t=this.toBuffer();window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,t.byteLength,function(n){n.root.getFile(e,{create:!0},function(e){e.createWriter(function(n){var i=new DataView(t),r=new Blob([i],{type:"font/opentype"});n.write(r),n.addEventListener("writeend",function(){location.href=e.toURL()},!1)})})},function(e){throw e})},n.Font=i},{"./encoding":3,"./glyphset":6,"./path":9,"./tables/sfnt":24}],5:[function(e,t,n){function i(e,t){var n=t||{commands:[]};return{configurable:!0,get:function(){return"function"==typeof n&&(n=n()),n},set:function(e){n=e}}}function r(e){this.bindConstructorValues(e)}var o=e("./check"),s=e("./draw"),a=e("./path");r.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",i(this,e.path))},r.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},r.prototype.getPath=function(e,t,n){e=void 0!==e?e:0,t=void 0!==t?t:0,n=void 0!==n?n:72;for(var i=1/this.path.unitsPerEm*n,r=new a.Path,o=this.path.commands,s=0;s<o.length;s+=1){var u=o[s];"M"===u.type?r.moveTo(e+u.x*i,t+-u.y*i):"L"===u.type?r.lineTo(e+u.x*i,t+-u.y*i):"Q"===u.type?r.quadraticCurveTo(e+u.x1*i,t+-u.y1*i,e+u.x*i,t+-u.y*i):"C"===u.type?r.curveTo(e+u.x1*i,t+-u.y1*i,e+u.x2*i,t+-u.y2*i,e+u.x*i,t+-u.y*i):"Z"===u.type&&r.closePath()}return r},r.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],n=0;n<this.points.length;n+=1){var i=this.points[n];t.push(i),i.lastPointOfContour&&(e.push(t),t=[])}return o.argument(0===t.length,"There are still points left in the current contour."),e},r.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],n=[],i=0;i<e.length;i+=1){var r=e[i];"Z"!==r.type&&(t.push(r.x),n.push(r.y)),"Q"!==r.type&&"C"!==r.type||(t.push(r.x1),n.push(r.y1)),"C"===r.type&&(t.push(r.x2),n.push(r.y2))}var o={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,n),leftSideBearing:0};return o.rightSideBearing=this.advanceWidth-o.leftSideBearing-(o.xMax-o.xMin),o},r.prototype.draw=function(e,t,n,i){this.getPath(t,n,i).draw(e)},r.prototype.drawPoints=function(e,t,n,i){function r(t,n,i,r){var o=2*Math.PI;e.beginPath();for(var s=0;s<t.length;s+=1)e.moveTo(n+t[s].x*r,i+t[s].y*r),e.arc(n+t[s].x*r,i+t[s].y*r,2,0,o,!1);e.closePath(),e.fill()}t=void 0!==t?t:0,n=void 0!==n?n:0,i=void 0!==i?i:24;for(var o=1/this.path.unitsPerEm*i,s=[],a=[],u=this.path,l=0;l<u.commands.length;l+=1){var c=u.commands[l];void 0!==c.x&&s.push({x:c.x,y:-c.y}),void 0!==c.x1&&a.push({x:c.x1,y:-c.y1}),void 0!==c.x2&&a.push({x:c.x2,y:-c.y2})}e.fillStyle="blue",r(s,t,n,o),e.fillStyle="red",r(a,t,n,o)},r.prototype.drawMetrics=function(e,t,n,i){var r;t=void 0!==t?t:0,n=void 0!==n?n:0,i=void 0!==i?i:24,r=1/this.path.unitsPerEm*i,e.lineWidth=1,e.strokeStyle="black",s.line(e,t,-1e4,t,1e4),s.line(e,-1e4,n,1e4,n);var o=this.xMin||0,a=this.yMin||0,u=this.xMax||0,l=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",s.line(e,t+o*r,-1e4,t+o*r,1e4),s.line(e,t+u*r,-1e4,t+u*r,1e4),s.line(e,-1e4,n+-a*r,1e4,n+-a*r),s.line(e,-1e4,n+-l*r,1e4,n+-l*r),e.strokeStyle="green",s.line(e,t+c*r,-1e4,t+c*r,1e4)},n.Glyph=r},{"./check":1,"./draw":2,"./path":9}],6:[function(e,t,n){function i(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var n=0;n<t.length;n++)this.glyphs[n]=t[n];this.length=t&&t.length||0}function r(e,t){return new a.Glyph({index:t,font:e})}function o(e,t,n,i,r,o){return function(){var s=new a.Glyph({index:t,font:e});return s.path=function(){n(s,i,r);var t=o(e.glyphs,s);return t.unitsPerEm=e.unitsPerEm,t},s}}function s(e,t,n,i){return function(){var r=new a.Glyph({index:t,font:e});return r.path=function(){var t=n(e,r,i);return t.unitsPerEm=e.unitsPerEm,t},r}}var a=e("./glyph");i.prototype.get=function(e){return"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},i.prototype.push=function(e,t){this.glyphs[e]=t,this.length++},n.GlyphSet=i,n.glyphLoader=r,n.ttfGlyphLoader=o,n.cffGlyphLoader=s},{"./glyph":5}],7:[function(e,t,n){function i(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i+=1)n[i]=e[i];return t}function r(t,n){e("fs").readFile(t,function(e,t){if(e)return n(e.message);n(null,i(t))})}function o(e,t){var n=new XMLHttpRequest;n.open("get",e,!0),n.responseType="arraybuffer",n.onload=function(){return 200!==n.status?t("Font could not be loaded: "+n.statusText):t(null,n.response)},n.onerror=function(){return t("Font could not be loaded: error")},n.send()}function s(e){var t,n,i,r,o,s,a,u=new c.Font,h=new DataView(e,0),p=d.getFixed(h,0);if(1===p)u.outlinesFormat="truetype";else{if("OTTO"!==(p=d.getTag(h,0)))throw new Error("Unsupported OpenType version "+p);u.outlinesFormat="cff"}for(var N=d.getUShort(h,4),O=12,M=0;M<N;M+=1){var V=d.getTag(h,O),D=d.getULong(h,O+8);switch(V){case"cmap":u.tables.cmap=f.parse(h,D),u.encoding=new l.CmapEncoding(u.tables.cmap);break;case"head":u.tables.head=w.parse(h,D),u.unitsPerEm=u.tables.head.unitsPerEm,t=u.tables.head.indexToLocFormat;break;case"hhea":u.tables.hhea=y.parse(h,D),u.ascender=u.tables.hhea.ascender,u.descender=u.tables.hhea.descender,u.numberOfHMetrics=u.tables.hhea.numberOfHMetrics;break;case"hmtx":n=D;break;case"maxp":u.tables.maxp=S.parse(h,D),u.numGlyphs=u.tables.maxp.numGlyphs;break;case"name":u.tables.name=C.parse(h,D),u.familyName=u.tables.name.fontFamily,u.styleName=u.tables.name.fontSubfamily;break;case"OS/2":u.tables.os2=F.parse(h,D);break;case"post":u.tables.post=T.parse(h,D),u.glyphNames=new l.GlyphNames(u.tables.post);break;case"glyf":i=D;break;case"loca":r=D;break;case"CFF ":o=D;break;case"kern":s=D;break;case"GPOS":a=D}O+=16}if(i&&r){var I=0===t,B=_.parse(h,r,u.numGlyphs,I);u.glyphs=m.parse(h,i,B,u),x.parse(h,n,u.numberOfHMetrics,u.numGlyphs,u.glyphs),l.addGlyphNames(u)}else{if(!o)throw new Error("Font doesn't contain TrueType or CFF outlines.");g.parse(h,o,u),l.addGlyphNames(u)}return u.kerningPairs=s?v.parse(h,s):{},a&&b.parse(h,a,u),u}function a(e,t){("undefined"==typeof window?r:o)(e,function(e,n){if(e)return t(e);var i=s(n);return t(null,i)})}function u(t){return s(i(e("fs").readFileSync(t)))}var l=e("./encoding"),c=e("./font"),h=e("./glyph"),d=e("./parse"),p=e("./path"),f=e("./tables/cmap"),g=e("./tables/cff"),m=e("./tables/glyf"),b=e("./tables/gpos"),w=e("./tables/head"),y=e("./tables/hhea"),x=e("./tables/hmtx"),v=e("./tables/kern"),_=e("./tables/loca"),S=e("./tables/maxp"),C=e("./tables/name"),F=e("./tables/os2"),T=e("./tables/post");n._parse=d,n.Font=c.Font,n.Glyph=h.Glyph,n.Path=p.Path,n.parse=s,n.load=a,n.loadSync=u},{"./encoding":3,"./font":4,"./glyph":5,"./parse":8,"./path":9,"./tables/cff":11,"./tables/cmap":12,"./tables/glyf":13,"./tables/gpos":14,"./tables/head":15,"./tables/hhea":16,"./tables/hmtx":17,"./tables/kern":18,"./tables/loca":19,"./tables/maxp":20,"./tables/name":21,"./tables/os2":22,"./tables/post":23,fs:void 0}],8:[function(e,t,n){function i(e,t){this.data=e,this.offset=t,this.relativeOffset=0}n.getByte=function(e,t){return e.getUint8(t)},n.getCard8=n.getByte,n.getUShort=function(e,t){return e.getUint16(t,!1)},n.getCard16=n.getUShort,n.getShort=function(e,t){return e.getInt16(t,!1)},n.getULong=function(e,t){return e.getUint32(t,!1)},n.getFixed=function(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535},n.getTag=function(e,t){for(var n="",i=t;i<t+4;i+=1)n+=String.fromCharCode(e.getInt8(i));return n},n.getOffset=function(e,t,n){for(var i=0,r=0;r<n;r+=1)i<<=8,i+=e.getUint8(t+r);return i},n.getBytes=function(e,t,n){for(var i=[],r=t;r<n;r+=1)i.push(e.getUint8(r));return i},n.bytesToString=function(e){for(var t="",n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t};var r={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};i.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},i.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},i.prototype.parseCard8=i.prototype.parseByte,i.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},i.prototype.parseCard16=i.prototype.parseUShort,i.prototype.parseSID=i.prototype.parseUShort,i.prototype.parseOffset16=i.prototype.parseUShort,i.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},i.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},i.prototype.parseULong=function(){var e=n.getULong(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},i.prototype.parseFixed=function(){var e=n.getFixed(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},i.prototype.parseOffset16List=i.prototype.parseUShortList=function(e){for(var t=new Array(e),i=this.data,r=this.offset+this.relativeOffset,o=0;o<e;o++)t[o]=n.getUShort(i,r),r+=2;return this.relativeOffset+=2*e,t},i.prototype.parseString=function(e){var t=this.data,n=this.offset+this.relativeOffset,i="";this.relativeOffset+=e;for(var r=0;r<e;r++)i+=String.fromCharCode(t.getUint8(n+r));return i},i.prototype.parseTag=function(){return this.parseString(4)},i.prototype.parseLongDateTime=function(){var e=n.getULong(this.data,this.offset+this.relativeOffset+4);return this.relativeOffset+=8,e},i.prototype.parseFixed=function(){var e=n.getULong(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e/65536},i.prototype.parseVersion=function(){var e=n.getUShort(this.data,this.offset+this.relativeOffset),t=n.getUShort(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e+t/4096/10},i.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=r[e]*t},n.Parser=i},{}],9:[function(e,t,n){function i(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}i.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},i.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},i.prototype.curveTo=i.prototype.bezierCurveTo=function(e,t,n,i,r,o){this.commands.push({type:"C",x1:e,y1:t,x2:n,y2:i,x:r,y:o})},i.prototype.quadTo=i.prototype.quadraticCurveTo=function(e,t,n,i){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:i})},i.prototype.close=i.prototype.closePath=function(){this.commands.push({type:"Z"})},i.prototype.extend=function(e){e.commands&&(e=e.commands),Array.prototype.push.apply(this.commands,e)},i.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var n=this.commands[t];"M"===n.type?e.moveTo(n.x,n.y):"L"===n.type?e.lineTo(n.x,n.y):"C"===n.type?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):"Q"===n.type?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):"Z"===n.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},i.prototype.toPathData=function(e){function t(t){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function n(){for(var e="",n=0;n<arguments.length;n+=1){var i=arguments[n];i>=0&&n>0&&(e+=" "),e+=t(i)}return e}e=void 0!==e?e:2;for(var i="",r=0;r<this.commands.length;r+=1){var o=this.commands[r];"M"===o.type?i+="M"+n(o.x,o.y):"L"===o.type?i+="L"+n(o.x,o.y):"C"===o.type?i+="C"+n(o.x1,o.y1,o.x2,o.y2,o.x,o.y):"Q"===o.type?i+="Q"+n(o.x1,o.y1,o.x,o.y):"Z"===o.type&&(i+="Z")}return i},i.prototype.toSVG=function(e){var t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>"},n.Path=i},{}],10:[function(e,t,n){function i(e,t,n){var i;for(i=0;i<t.length;i+=1){var r=t[i];this[r.name]=r.value}if(this.tableName=e,this.fields=t,n){var o=Object.keys(n);for(i=0;i<o.length;i+=1){var s=o[i],a=n[s];void 0!==this[s]&&(this[s]=a)}}}var r=e("./check"),o=e("./types").encode,s=e("./types").sizeOf;i.prototype.sizeOf=function(){for(var e=0,t=0;t<this.fields.length;t+=1){var n=this.fields[t],i=this[n.name];if(void 0===i&&(i=n.value),"function"==typeof i.sizeOf)e+=i.sizeOf();else{var o=s[n.type];r.assert("function"==typeof o,"Could not find sizeOf function for field"+n.name),e+=o(i)}}return e},i.prototype.encode=function(){return o.TABLE(this)},n.Table=i},{"./check":1,"./types":25}],11:[function(e,t,n){function i(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n+=1)if(!i(e[n],t[n]))return!1;return!0}return!1}function r(e,t,n){var i,r,o,s=[],a=[],u=A.getCard16(e,t);if(0!==u){var l=A.getByte(e,t+2);r=t+(u+1)*l+2;var c=t+3;for(i=0;i<u+1;i+=1)s.push(A.getOffset(e,c,l)),c+=l;o=r+s[u]}else o=t+2;for(i=0;i<s.length-1;i+=1){var h=A.getBytes(e,r+s[i],r+s[i+1]);n&&(h=n(h)),a.push(h)}return{objects:a,startOffset:t,endOffset:o}}function o(e){for(var t="",n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var i=e.parseByte(),r=i>>4,o=15&i;if(15===r)break;if(t+=n[r],15===o)break;t+=n[o]}return parseFloat(t)}function s(e,t){var n,i,r,s;if(28===t)return n=e.parseByte(),i=e.parseByte(),n<<8|i;if(29===t)return n=e.parseByte(),i=e.parseByte(),r=e.parseByte(),s=e.parseByte(),n<<24|i<<16|r<<8|s;if(30===t)return o(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),256*(t-247)+n+108;if(t>=251&&t<=254)return n=e.parseByte(),256*-(t-251)-n-108;throw new Error("Invalid b0 "+t)}function a(e){for(var t={},n=0;n<e.length;n+=1){var i,r=e[n][0],o=e[n][1];if(i=1===o.length?o[0]:o,t.hasOwnProperty(r))throw new Error("Object "+t+" already has key "+r);t[r]=i}return t}function u(e,t,n){t=void 0!==t?t:0;var i=new A.Parser(e,t),r=[],o=[];for(n=void 0!==n?n:e.length;i.relativeOffset<n;){var u=i.parseByte();u<=21?(12===u&&(u=1200+i.parseByte()),r.push([u,o]),o=[]):o.push(s(i,u))}return a(r)}function l(e,t){return t=t<=390?B.cffStandardStrings[t]:e[t-391]}function c(e,t,n){for(var i={},r=0;r<t.length;r+=1){var o=t[r],s=e[o.op];void 0===s&&(s=void 0!==o.value?o.value:null),"SID"===o.type&&(s=l(n,s)),i[o.name]=s}return i}function h(e,t){var n={};return n.formatMajor=A.getCard8(e,t),n.formatMinor=A.getCard8(e,t+1),n.size=A.getCard8(e,t+2),n.offsetSize=A.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4,n}function d(e,t){return c(u(e,0,e.byteLength),R,t)}function p(e,t,n,i){return c(u(e,t,n),k,i)}function f(e,t,n,i){var r,o,s,a=new A.Parser(e,t);n-=1;var u=[".notdef"],c=a.parseCard8();if(0===c)for(r=0;r<n;r+=1)o=a.parseSID(),u.push(l(i,o));else if(1===c)for(;u.length<=n;)for(o=a.parseSID(),s=a.parseCard8(),r=0;r<=s;r+=1)u.push(l(i,o)),o+=1;else{if(2!==c)throw new Error("Unknown charset format "+c);for(;u.length<=n;)for(o=a.parseSID(),s=a.parseCard16(),r=0;r<=s;r+=1)u.push(l(i,o)),o+=1}return u}function g(e,t,n){var i,r,o={},s=new A.Parser(e,t),a=s.parseCard8();if(0===a){var u=s.parseCard8();for(i=0;i<u;i+=1)o[r=s.parseCard8()]=i}else{if(1!==a)throw new Error("Unknown encoding format "+a);var l=s.parseCard8();for(r=1,i=0;i<l;i+=1)for(var c=s.parseCard8(),h=s.parseCard8(),d=c;d<=c+h;d+=1)o[d]=r,r+=1}return new B.CffEncoding(o,n)}function m(e,t,n){function i(e,t){g&&c.closePath(),c.moveTo(e,t),g=!0}function r(){h.length%2!=0&&!p&&(f=h.shift()+e.nominalWidthX),d+=h.length>>1,h.length=0,p=!0}function o(n){for(var w,y,x,v,_,S,C,F,T,N,O,M,V=0;V<n.length;){var D=n[V];switch(V+=1,D){case 1:case 3:r();break;case 4:h.length>1&&!p&&(f=h.shift()+e.nominalWidthX,p=!0),b+=h.pop(),i(m,b);break;case 5:for(;h.length>0;)m+=h.shift(),b+=h.shift(),c.lineTo(m,b);break;case 6:for(;h.length>0&&(m+=h.shift(),c.lineTo(m,b),0!==h.length);)b+=h.shift(),c.lineTo(m,b);break;case 7:for(;h.length>0&&(b+=h.shift(),c.lineTo(m,b),0!==h.length);)m+=h.shift(),c.lineTo(m,b);break;case 8:for(;h.length>0;)s=m+h.shift(),a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),m=u+h.shift(),b=l+h.shift(),c.curveTo(s,a,u,l,m,b);break;case 10:_=h.pop()+e.subrsBias,(S=e.subrs[_])&&o(S);break;case 11:return;case 12:switch(D=n[V],V+=1,D){case 35:s=m+h.shift(),a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),C=u+h.shift(),F=l+h.shift(),T=C+h.shift(),N=F+h.shift(),O=T+h.shift(),M=N+h.shift(),m=O+h.shift(),b=M+h.shift(),h.shift(),c.curveTo(s,a,u,l,C,F),c.curveTo(T,N,O,M,m,b);break;case 34:s=m+h.shift(),a=b,u=s+h.shift(),l=a+h.shift(),C=u+h.shift(),F=l,T=C+h.shift(),N=l,O=T+h.shift(),M=b,m=O+h.shift(),c.curveTo(s,a,u,l,C,F),c.curveTo(T,N,O,M,m,b);break;case 36:s=m+h.shift(),a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),C=u+h.shift(),F=l,T=C+h.shift(),N=l,O=T+h.shift(),M=N+h.shift(),m=O+h.shift(),c.curveTo(s,a,u,l,C,F),c.curveTo(T,N,O,M,m,b);break;case 37:s=m+h.shift(),a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),C=u+h.shift(),F=l+h.shift(),T=C+h.shift(),N=F+h.shift(),O=T+h.shift(),M=N+h.shift(),Math.abs(O-m)>Math.abs(M-b)?m=O+h.shift():b=M+h.shift(),c.curveTo(s,a,u,l,C,F),c.curveTo(T,N,O,M,m,b);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+D),h.length=0}break;case 14:h.length>0&&!p&&(f=h.shift()+e.nominalWidthX,p=!0),g&&(c.closePath(),g=!1);break;case 18:r();break;case 19:case 20:r(),V+=d+7>>3;break;case 21:h.length>2&&!p&&(f=h.shift()+e.nominalWidthX,p=!0),b+=h.pop(),i(m+=h.pop(),b);break;case 22:h.length>1&&!p&&(f=h.shift()+e.nominalWidthX,p=!0),i(m+=h.pop(),b);break;case 23:r();break;case 24:for(;h.length>2;)s=m+h.shift(),a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),m=u+h.shift(),b=l+h.shift(),c.curveTo(s,a,u,l,m,b);m+=h.shift(),b+=h.shift(),c.lineTo(m,b);break;case 25:for(;h.length>6;)m+=h.shift(),b+=h.shift(),c.lineTo(m,b);s=m+h.shift(),a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),m=u+h.shift(),b=l+h.shift(),c.curveTo(s,a,u,l,m,b);break;case 26:for(h.length%2&&(m+=h.shift());h.length>0;)s=m,a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),m=u,b=l+h.shift(),c.curveTo(s,a,u,l,m,b);break;case 27:for(h.length%2&&(b+=h.shift());h.length>0;)s=m+h.shift(),a=b,u=s+h.shift(),l=a+h.shift(),m=u+h.shift(),b=l,c.curveTo(s,a,u,l,m,b);break;case 28:w=n[V],y=n[V+1],h.push((w<<24|y<<16)>>16),V+=2;break;case 29:_=h.pop()+e.gsubrsBias,(S=e.gsubrs[_])&&o(S);break;case 30:for(;h.length>0&&(s=m,a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),m=u+h.shift(),b=l+(1===h.length?h.shift():0),c.curveTo(s,a,u,l,m,b),0!==h.length);)s=m+h.shift(),a=b,u=s+h.shift(),l=a+h.shift(),b=l+h.shift(),m=u+(1===h.length?h.shift():0),c.curveTo(s,a,u,l,m,b);break;case 31:for(;h.length>0&&(s=m+h.shift(),a=b,u=s+h.shift(),l=a+h.shift(),b=l+h.shift(),m=u+(1===h.length?h.shift():0),c.curveTo(s,a,u,l,m,b),0!==h.length);)s=m,a=b+h.shift(),u=s+h.shift(),l=a+h.shift(),m=u+h.shift(),b=l+(1===h.length?h.shift():0),c.curveTo(s,a,u,l,m,b);break;default:D<32?console.log("Glyph "+t.index+": unknown operator "+D):D<247?h.push(D-139):D<251?(w=n[V],V+=1,h.push(256*(D-247)+w+108)):D<255?(w=n[V],V+=1,h.push(256*-(D-251)-w-108)):(w=n[V],y=n[V+1],x=n[V+2],v=n[V+3],V+=4,h.push((w<<24|y<<16|x<<8|v)/65536))}}}var s,a,u,l,c=new P.Path,h=[],d=0,p=!1,f=e.defaultWidthX,g=!1,m=0,b=0;return o(n),t.advanceWidth=f,c}function b(e){return e.length<1240?107:e.length<33900?1131:32768}function w(e,t,n){n.tables.cff={};var i=r(e,r(e,h(e,t).endOffset,A.bytesToString).endOffset),o=r(e,i.endOffset,A.bytesToString),s=r(e,o.endOffset);n.gsubrs=s.objects,n.gsubrsBias=b(n.gsubrs);var a=d(new DataView(new Uint8Array(i.objects[0]).buffer),o.objects);n.tables.cff.topDict=a;var u=t+a.private[1],l=p(e,u,a.private[0],o.objects);if(n.defaultWidthX=l.defaultWidthX,n.nominalWidthX=l.nominalWidthX,0!==l.subrs){var c=r(e,u+l.subrs);n.subrs=c.objects,n.subrsBias=b(n.subrs)}else n.subrs=[],n.subrsBias=0;var w=r(e,t+a.charStrings);n.nGlyphs=w.objects.length;var y=f(e,t+a.charset,n.nGlyphs,o.objects);0===a.encoding?n.cffEncoding=new B.CffEncoding(B.cffStandardEncoding,y):1===a.encoding?n.cffEncoding=new B.CffEncoding(B.cffExpertEncoding,y):n.cffEncoding=g(e,t+a.encoding,y),n.encoding=n.encoding||n.cffEncoding,n.glyphs=new E.GlyphSet(n);for(var x=0;x<n.nGlyphs;x+=1){var v=w.objects[x];n.glyphs.push(x,E.cffGlyphLoader(n,x,m,v))}}function y(e,t){var n,i=B.cffStandardStrings.indexOf(e);return i>=0&&(n=i),i=t.indexOf(e),i>=0?n=i+B.cffStandardStrings.length:(n=B.cffStandardStrings.length+t.length,t.push(e)),n}function x(){return new L.Table("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function v(e){var t=new L.Table("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var n=0;n<e.length;n+=1)t.names.push({name:"name_"+n,type:"NAME",value:e[n]});return t}function _(e,t,n){for(var r={},o=0;o<e.length;o+=1){var s=e[o],a=t[s.name];void 0===a||i(a,s.value)||("SID"===s.type&&(a=y(a,n)),r[s.op]={name:s.name,type:s.type,value:a})}return r}function S(e,t){var n=new L.Table("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return n.dict=_(R,e,t),n}function C(e){var t=new L.Table("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function F(e){var t=new L.Table("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var n=0;n<e.length;n+=1)t.strings.push({name:"string_"+n,type:"STRING",value:e[n]});return t}function T(){return new L.Table("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function N(e,t){for(var n=new L.Table("Charsets",[{name:"format",type:"Card8",value:0}]),i=0;i<e.length;i+=1){var r=y(e[i],t);n.fields.push({name:"glyph_"+i,type:"SID",value:r})}return n}function O(e){var t=[],n=e.path;t.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var i=0,r=0,o=0;o<n.commands.length;o+=1){var s,a,u=n.commands[o];if("Q"===u.type){u={type:"C",x:u.x,y:u.y,x1:1/3*i+2/3*u.x1,y1:1/3*r+2/3*u.y1,x2:1/3*u.x+2/3*u.x1,y2:1/3*u.y+2/3*u.y1}}if("M"===u.type)s=Math.round(u.x-i),a=Math.round(u.y-r),t.push({name:"dx",type:"NUMBER",value:s}),t.push({name:"dy",type:"NUMBER",value:a}),t.push({name:"rmoveto",type:"OP",value:21}),i=Math.round(u.x),r=Math.round(u.y);else if("L"===u.type)s=Math.round(u.x-i),a=Math.round(u.y-r),t.push({name:"dx",type:"NUMBER",value:s}),t.push({name:"dy",type:"NUMBER",value:a}),t.push({name:"rlineto",type:"OP",value:5}),i=Math.round(u.x),r=Math.round(u.y);else if("C"===u.type){var l=Math.round(u.x1-i),c=Math.round(u.y1-r),h=Math.round(u.x2-u.x1),d=Math.round(u.y2-u.y1);s=Math.round(u.x-u.x2),a=Math.round(u.y-u.y2),t.push({name:"dx1",type:"NUMBER",value:l}),t.push({name:"dy1",type:"NUMBER",value:c}),t.push({name:"dx2",type:"NUMBER",value:h}),t.push({name:"dy2",type:"NUMBER",value:d}),t.push({name:"dx",type:"NUMBER",value:s}),t.push({name:"dy",type:"NUMBER",value:a}),t.push({name:"rrcurveto",type:"OP",value:8}),i=Math.round(u.x),r=Math.round(u.y)}}return t.push({name:"endchar",type:"OP",value:14}),t}function M(e){for(var t=new L.Table("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),n=0;n<e.length;n+=1){var i=e.get(n),r=O(i);t.charStrings.push({name:i.name,type:"CHARSTRING",value:r})}return t}function V(e,t){var n=new L.Table("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return n.dict=_(k,e,t),n}function D(e){var t=new L.Table("Private DICT INDEX",[{name:"privateDicts",type:"INDEX",value:[]}]);return t.privateDicts=[{name:"privateDict_0",type:"TABLE",value:e}],t}function I(e,t){for(var n,i=new L.Table("CFF ",[{name:"header",type:"TABLE"},{name:"nameIndex",type:"TABLE"},{name:"topDictIndex",type:"TABLE"},{name:"stringIndex",type:"TABLE"},{name:"globalSubrIndex",type:"TABLE"},{name:"charsets",type:"TABLE"},{name:"charStringsIndex",type:"TABLE"},{name:"privateDictIndex",type:"TABLE"}]),r=1/t.unitsPerEm,o={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},s={},a=[],u=1;u<e.length;u+=1)n=e.get(u),a.push(n.name);var l=[];i.header=x(),i.nameIndex=v([t.postScriptName]);var c=S(o,l);i.topDictIndex=C(c),i.globalSubrIndex=T(),i.charsets=N(a,l),i.charStringsIndex=M(e);var h=V(s,l);i.privateDictIndex=D(h),i.stringIndex=F(l);var d=i.header.sizeOf()+i.nameIndex.sizeOf()+i.topDictIndex.sizeOf()+i.stringIndex.sizeOf()+i.globalSubrIndex.sizeOf();return o.charset=d,o.encoding=0,o.charStrings=o.charset+i.charsets.sizeOf(),o.private[1]=o.charStrings+i.charStringsIndex.sizeOf(),c=S(o,l),i.topDictIndex=C(c),i}var B=e("../encoding"),E=e("../glyphset"),A=e("../parse"),P=e("../path"),L=e("../table"),R=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]}],k=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];n.parse=w,n.make=I},{"../encoding":3,"../glyphset":6,"../parse":8,"../path":9,"../table":10}],12:[function(e,t,n){function i(e,t){var n,i={};i.version=u.getUShort(e,t),a.argument(0===i.version,"cmap table version should be 0."),i.numTables=u.getUShort(e,t+2);var r=-1;for(n=0;n<i.numTables;n+=1){var o=u.getUShort(e,t+4+8*n),s=u.getUShort(e,t+4+8*n+2);if(3===o&&(1===s||0===s)){r=u.getULong(e,t+4+8*n+4);break}}if(-1===r)return null;var l=new u.Parser(e,t+r);i.format=l.parseUShort(),a.argument(4===i.format,"Only format 4 cmap tables are supported."),i.length=l.parseUShort(),i.language=l.parseUShort();var c;i.segCount=c=l.parseUShort()>>1,l.skip("uShort",3),i.glyphIndexMap={};var h=new u.Parser(e,t+r+14),d=new u.Parser(e,t+r+16+2*c),p=new u.Parser(e,t+r+16+4*c),f=new u.Parser(e,t+r+16+6*c),g=t+r+16+8*c;for(n=0;n<c-1;n+=1)for(var m,b=h.parseUShort(),w=d.parseUShort(),y=p.parseShort(),x=f.parseUShort(),v=w;v<=b;v+=1)0!==x?(g=f.offset+f.relativeOffset-2,g+=x,g+=2*(v-w),0!==(m=u.getUShort(e,g))&&(m=m+y&65535)):m=v+y&65535,i.glyphIndexMap[v]=m;return i}function r(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0})}function o(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function s(e){var t,n=new l.Table("cmap",[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:1},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:12},{name:"format",type:"USHORT",value:4},{name:"length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);for(n.segments=[],t=0;t<e.length;t+=1){for(var i=e.get(t),s=0;s<i.unicodes.length;s+=1)r(n,i.unicodes[s],t);n.segments=n.segments.sort(function(e,t){return e.start-t.start})}o(n);var a;a=n.segments.length,n.segCountX2=2*a,n.searchRange=2*Math.pow(2,Math.floor(Math.log(a)/Math.log(2))),n.entrySelector=Math.log(n.searchRange/2)/Math.log(2),n.rangeShift=n.segCountX2-n.searchRange;var u=[],c=[],h=[],d=[],p=[];for(t=0;t<a;t+=1){var f=n.segments[t];u=u.concat({name:"end_"+t,type:"USHORT",value:f.end}),c=c.concat({name:"start_"+t,type:"USHORT",value:f.start}),h=h.concat({name:"idDelta_"+t,type:"SHORT",value:f.delta}),d=d.concat({name:"idRangeOffset_"+t,type:"USHORT",value:f.offset}),void 0!==f.glyphId&&(p=p.concat({name:"glyph_"+t,type:"USHORT",value:f.glyphId}))}return n.fields=n.fields.concat(u),n.fields.push({name:"reservedPad",type:"USHORT",value:0}),n.fields=n.fields.concat(c),n.fields=n.fields.concat(h),n.fields=n.fields.concat(d),n.fields=n.fields.concat(p),n.length=14+2*u.length+2+2*c.length+2*h.length+2*d.length+2*p.length,n}var a=e("../check"),u=e("../parse"),l=e("../table");n.parse=i,n.make=s},{"../check":1,"../parse":8,"../table":10}],13:[function(e,t,n){function i(e,t,n,i,r){var o;return(t&i)>0?(o=e.parseByte(),0==(t&r)&&(o=-o),o=n+o):o=(t&r)>0?n:n+e.parseShort(),o}function r(e,t,n){var r=new d.Parser(t,n);e.numberOfContours=r.parseShort(),e.xMin=r.parseShort(),e.yMin=r.parseShort(),e.xMax=r.parseShort(),e.yMax=r.parseShort();var o,s;if(e.numberOfContours>0){var a,u=e.endPointIndices=[];for(a=0;a<e.numberOfContours;a+=1)u.push(r.parseUShort());for(e.instructionLength=r.parseUShort(),e.instructions=[],a=0;a<e.instructionLength;a+=1)e.instructions.push(r.parseByte());var l=u[u.length-1]+1;for(o=[],a=0;a<l;a+=1)if(s=r.parseByte(),o.push(s),(8&s)>0)for(var h=r.parseByte(),p=0;p<h;p+=1)o.push(s),a+=1;if(c.argument(o.length===l,"Bad flags."),u.length>0){var f,g=[];if(l>0){for(a=0;a<l;a+=1)s=o[a],(f={}).onCurve=!!(1&s),f.lastPointOfContour=u.indexOf(a)>=0,g.push(f);var m=0;for(a=0;a<l;a+=1)s=o[a],(f=g[a]).x=i(r,s,m,2,16),m=f.x;var b=0;for(a=0;a<l;a+=1)s=o[a],(f=g[a]).y=i(r,s,b,4,32),b=f.y}e.points=g}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var w=!0;w;){o=r.parseUShort();var y={glyphIndex:r.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&o)>0?(y.dx=r.parseShort(),y.dy=r.parseShort()):(y.dx=r.parseChar(),y.dy=r.parseChar()),(8&o)>0?y.xScale=y.yScale=r.parseF2Dot14():(64&o)>0?(y.xScale=r.parseF2Dot14(),y.yScale=r.parseF2Dot14()):(128&o)>0&&(y.xScale=r.parseF2Dot14(),y.scale01=r.parseF2Dot14(),y.scale10=r.parseF2Dot14(),y.yScale=r.parseF2Dot14()),e.components.push(y),w=!!(32&o)}}}function o(e,t){for(var n=[],i=0;i<e.length;i+=1){var r=e[i],o={x:t.xScale*r.x+t.scale01*r.y+t.dx,y:t.scale10*r.x+t.yScale*r.y+t.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};n.push(o)}return n}function s(e){for(var t=[],n=[],i=0;i<e.length;i+=1){var r=e[i];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return c.argument(0===n.length,"There are still points left in the current contour."),t}function a(e){var t=new p.Path;if(!e)return t;for(var n=s(e),i=0;i<n.length;i+=1){var r,o,a=n[i],u=a[0],l=a[a.length-1];u.onCurve?(r=null,o=!0):(r=u=l.onCurve?l:{x:(u.x+l.x)/2,y:(u.y+l.y)/2},o=!1),t.moveTo(u.x,u.y);for(var c=o?1:0;c<a.length;c+=1){var h=a[c],d=0===c?u:a[c-1];if(d.onCurve&&h.onCurve)t.lineTo(h.x,h.y);else if(d.onCurve&&!h.onCurve)r=h;else if(d.onCurve||h.onCurve){if(d.onCurve||!h.onCurve)throw new Error("Invalid state.");t.quadraticCurveTo(r.x,r.y,h.x,h.y),r=null}else{var f={x:(d.x+h.x)/2,y:(d.y+h.y)/2};t.quadraticCurveTo(d.x,d.y,f.x,f.y),r=h}}u!==l&&(r?t.quadraticCurveTo(r.x,r.y,u.x,u.y):t.lineTo(u.x,u.y))}return t.closePath(),t}function u(e,t){if(t.isComposite)for(var n=0;n<t.components.length;n+=1){var i=t.components[n],r=e.get(i.glyphIndex);if(r.points){var s=o(r.points,i);t.points=t.points.concat(s)}}return a(t.points)}function l(e,t,n,i){var o,s=new h.GlyphSet(i);for(o=0;o<n.length-1;o+=1){var a=n[o];a!==n[o+1]?s.push(o,h.ttfGlyphLoader(i,o,r,e,t+a,u)):s.push(o,h.glyphLoader(i,o))}return s}var c=e("../check"),h=e("../glyphset"),d=e("../parse"),p=e("../path");n.parse=l},{"../check":1,"../glyphset":6,"../parse":8,"../path":9}],14:[function(e,t,n){function i(e,t){for(var n=new c.Parser(e,t),i=n.parseUShort(),r=[],o=0;o<i;o++)r[n.parseTag()]={offset:n.parseUShort()};return r}function r(e,t){var n=new c.Parser(e,t),i=n.parseUShort(),r=n.parseUShort();if(1===i)return n.parseUShortList(r);if(2===i){for(var o=[];r--;)for(var s=n.parseUShort(),a=n.parseUShort(),u=n.parseUShort(),l=s;l<=a;l++)o[u++]=l;return o}}function o(e,t){var n=new c.Parser(e,t),i=n.parseUShort();if(1===i){var r=n.parseUShort(),o=n.parseUShort(),s=n.parseUShortList(o);return function(e){return s[e-r]||0}}if(2===i){for(var a=n.parseUShort(),u=[],l=[],h=[],d=0;d<a;d++)u[d]=n.parseUShort(),l[d]=n.parseUShort(),h[d]=n.parseUShort();return function(e){for(var t=0,n=u.length-1;t<n;){var i=t+n+1>>1;e<u[i]?n=i-1:t=i}return u[t]<=e&&e<=l[t]?h[t]||0:0}}}function s(e,t){var n,i=new c.Parser(e,t),s=i.parseUShort(),a=r(e,t+i.parseUShort()),u=i.parseUShort(),l=i.parseUShort();if(4===u&&0===l){var h={};if(1===s){for(var d=i.parseUShort(),p=[],f=i.parseOffset16List(d),g=0;g<d;g++){var m=f[g],b=h[m];if(!b){b={},i.relativeOffset=m;for(var w=i.parseUShort();w--;){var y=i.parseUShort();u&&(n=i.parseShort()),l&&i.parseShort(),b[y]=n}}p[a[g]]=b}return function(e,t){var n=p[e];if(n)return n[t]}}if(2===s){for(var x=i.parseUShort(),v=i.parseUShort(),_=i.parseUShort(),S=i.parseUShort(),C=o(e,t+x),F=o(e,t+v),T=[],N=0;N<_;N++)for(var O=T[N]=[],M=0;M<S;M++)u&&(n=i.parseShort()),l&&i.parseShort(),O[M]=n;var V={};for(N=0;N<a.length;N++)V[a[N]]=1;return function(e,t){if(V[e]){var n=C(e),i=F(t),r=T[n];return r?r[i]:void 0}}}}}function a(e,t){var n=new c.Parser(e,t),i=n.parseUShort(),r=n.parseUShort(),o=16&r,a=n.parseUShort(),u=n.parseOffset16List(a),l={lookupType:i,lookupFlag:r,markFilteringSet:o?n.parseUShort():-1};if(2===i){for(var h=[],d=0;d<a;d++)h.push(s(e,t+u[d]));l.getKerningValue=function(e,t){for(var n=h.length;n--;){var i=h[n](e,t);if(void 0!==i)return i}return 0}}return l}function u(e,t,n){var r=new c.Parser(e,t),o=r.parseFixed();l.argument(1===o,"Unsupported GPOS table version."),i(e,t+r.parseUShort()),i(e,t+r.parseUShort());var s=r.parseUShort();r.relativeOffset=s;for(var u=r.parseUShort(),h=r.parseOffset16List(u),d=t+s,p=0;p<u;p++){var f=a(e,d+h[p]);2!==f.lookupType||n.getGposKerningValue||(n.getGposKerningValue=f.getKerningValue)}}var l=e("../check"),c=e("../parse");n.parse=u},{"../check":1,"../parse":8}],15:[function(e,t,n){function i(e,t){var n={},i=new s.Parser(e,t);return n.version=i.parseVersion(),n.fontRevision=Math.round(1e3*i.parseFixed())/1e3,n.checkSumAdjustment=i.parseULong(),n.magicNumber=i.parseULong(),o.argument(1594834165===n.magicNumber,"Font header has wrong magic number."),n.flags=i.parseUShort(),n.unitsPerEm=i.parseUShort(),n.created=i.parseLongDateTime(),n.modified=i.parseLongDateTime(),n.xMin=i.parseShort(),n.yMin=i.parseShort(),n.xMax=i.parseShort(),n.yMax=i.parseShort(),n.macStyle=i.parseUShort(),n.lowestRecPPEM=i.parseUShort(),n.fontDirectionHint=i.parseShort(),n.indexToLocFormat=i.parseShort(),n.glyphDataFormat=i.parseShort(),n}function r(e){return new a.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:0},{name:"modified",type:"LONGDATETIME",value:0},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}var o=e("../check"),s=e("../parse"),a=e("../table");n.parse=i,n.make=r},{"../check":1,"../parse":8,"../table":10}],16:[function(e,t,n){function i(e,t){var n={},i=new o.Parser(e,t);return n.version=i.parseVersion(),n.ascender=i.parseShort(),n.descender=i.parseShort(),n.lineGap=i.parseShort(),n.advanceWidthMax=i.parseUShort(),n.minLeftSideBearing=i.parseShort(),n.minRightSideBearing=i.parseShort(),n.xMaxExtent=i.parseShort(),n.caretSlopeRise=i.parseShort(),n.caretSlopeRun=i.parseShort(),n.caretOffset=i.parseShort(),i.relativeOffset+=8,n.metricDataFormat=i.parseShort(),n.numberOfHMetrics=i.parseUShort(),n}function r(e){return new s.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)}var o=e("../parse"),s=e("../table");n.parse=i,n.make=r},{"../parse":8,"../table":10}],17:[function(e,t,n){function i(e,t,n,i,r){for(var s,a,u=new o.Parser(e,t),l=0;l<i;l+=1){l<n&&(s=u.parseUShort(),a=u.parseShort());var c=r.get(l);c.advanceWidth=s,c.leftSideBearing=a}}function r(e){for(var t=new s.Table("hmtx",[]),n=0;n<e.length;n+=1){var i=e.get(n),r=i.advanceWidth||0,o=i.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+n,type:"USHORT",value:r}),t.fields.push({name:"leftSideBearing_"+n,type:"SHORT",value:o})}return t}var o=e("../parse"),s=e("../table");n.parse=i,n.make=r},{"../parse":8,"../table":10}],18:[function(e,t,n){function i(e,t){var n={},i=new o.Parser(e,t),s=i.parseUShort();r.argument(0===s,"Unsupported kern table version."),i.skip("uShort",1);var a=i.parseUShort();r.argument(0===a,"Unsupported kern sub-table version."),i.skip("uShort",2);var u=i.parseUShort();i.skip("uShort",3);for(var l=0;l<u;l+=1){var c=i.parseUShort(),h=i.parseUShort(),d=i.parseShort();n[c+","+h]=d}return n}var r=e("../check"),o=e("../parse");n.parse=i},{"../check":1,"../parse":8}],19:[function(e,t,n){function i(e,t,n,i){for(var o=new r.Parser(e,t),s=i?o.parseUShort:o.parseULong,a=[],u=0;u<n+1;u+=1){var l=s.call(o);i&&(l*=2),a.push(l)}return a}var r=e("../parse");n.parse=i},{"../parse":8}],20:[function(e,t,n){function i(e,t){var n={},i=new o.Parser(e,t);return n.version=i.parseVersion(),n.numGlyphs=i.parseUShort(),1===n.version&&(n.maxPoints=i.parseUShort(),n.maxContours=i.parseUShort(),n.maxCompositePoints=i.parseUShort(),n.maxCompositeContours=i.parseUShort(),n.maxZones=i.parseUShort(),n.maxTwilightPoints=i.parseUShort(),n.maxStorage=i.parseUShort(),n.maxFunctionDefs=i.parseUShort(),n.maxInstructionDefs=i.parseUShort(),n.maxStackElements=i.parseUShort(),n.maxSizeOfInstructions=i.parseUShort(),n.maxComponentElements=i.parseUShort(),n.maxComponentDepth=i.parseUShort()),n}function r(e){return new s.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var o=e("../parse"),s=e("../table");n.parse=i,n.make=r},{"../parse":8,"../table":10}],21:[function(e,t,n){function i(e,t){var n={},i=new l.Parser(e,t);n.format=i.parseUShort();for(var r=i.parseUShort(),o=i.offset+i.parseUShort(),s=0,a=0;a<r;a++){var u=i.parseUShort(),c=i.parseUShort(),d=i.parseUShort(),p=i.parseUShort(),f=h[p],g=i.parseUShort(),m=i.parseUShort();if(3===u&&1===c&&1033===d){for(var b=[],w=g/2,y=0;y<w;y++,m+=2)b[y]=l.getShort(e,o+m);var x=String.fromCharCode.apply(null,b);f?n[f]=x:n["unknown"+ ++s]=x}}return 1===n.format&&(n.langTagCount=i.parseUShort()),n}function r(e,t,n,i,r,o){return new c.Table("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:n},{name:"nameID",type:"USHORT",value:i},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:o}])}function o(e,t,n,i){var o=u.STRING(n);return e.records.push(r(1,0,0,t,o.length,i)),e.strings.push(o),i+=o.length}function s(e,t,n,i){var o=u.UTF16(n);return e.records.push(r(3,1,1033,t,o.length,i)),e.strings.push(o),i+=o.length}function a(e){var t=new c.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:0},{name:"stringOffset",type:"USHORT",value:0}]);t.records=[],t.strings=[];var n,i=0;for(n=0;n<h.length;n+=1)void 0!==e[h[n]]&&(i=o(t,n,e[h[n]],i));for(n=0;n<h.length;n+=1)void 0!==e[h[n]]&&(i=s(t,n,e[h[n]],i));for(t.count=t.records.length,t.stringOffset=6+12*t.count,n=0;n<t.records.length;n+=1)t.fields.push({name:"record_"+n,type:"TABLE",value:t.records[n]});for(n=0;n<t.strings.length;n+=1)t.fields.push({name:"string_"+n,type:"LITERAL",value:t.strings[n]});return t}var u=e("../types").encode,l=e("../parse"),c=e("../table"),h=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","licence","licenceURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"];n.parse=i,n.make=a},{"../parse":8,"../table":10,"../types":25}],22:[function(e,t,n){function i(e){for(var t=0;t<u.length;t+=1){var n=u[t];if(e>=n.begin&&e<n.end)return t}return-1}function r(e,t){var n={},i=new s.Parser(e,t);n.version=i.parseUShort(),n.xAvgCharWidth=i.parseShort(),n.usWeightClass=i.parseUShort(),n.usWidthClass=i.parseUShort(),n.fsType=i.parseUShort(),n.ySubscriptXSize=i.parseShort(),n.ySubscriptYSize=i.parseShort(),n.ySubscriptXOffset=i.parseShort(),n.ySubscriptYOffset=i.parseShort(),n.ySuperscriptXSize=i.parseShort(),n.ySuperscriptYSize=i.parseShort(),n.ySuperscriptXOffset=i.parseShort(),n.ySuperscriptYOffset=i.parseShort(),n.yStrikeoutSize=i.parseShort(),n.yStrikeoutPosition=i.parseShort(),n.sFamilyClass=i.parseShort(),n.panose=[];for(var r=0;r<10;r++)n.panose[r]=i.parseByte();return n.ulUnicodeRange1=i.parseULong(),n.ulUnicodeRange2=i.parseULong(),n.ulUnicodeRange3=i.parseULong(),n.ulUnicodeRange4=i.parseULong(),n.achVendID=String.fromCharCode(i.parseByte(),i.parseByte(),i.parseByte(),i.parseByte()),n.fsSelection=i.parseUShort(),n.usFirstCharIndex=i.parseUShort(),n.usLastCharIndex=i.parseUShort(),n.sTypoAscender=i.parseShort(),n.sTypoDescender=i.parseShort(),n.sTypoLineGap=i.parseShort(),n.usWinAscent=i.parseUShort(),n.usWinDescent=i.parseUShort(),n.version>=1&&(n.ulCodePageRange1=i.parseULong(),n.ulCodePageRange2=i.parseULong()),n.version>=2&&(n.sxHeight=i.parseShort(),n.sCapHeight=i.parseShort(),n.usDefaultChar=i.parseUShort(),n.usBreakChar=i.parseUShort(),n.usMaxContent=i.parseUShort()),n}function o(e){return new a.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)}var s=e("../parse"),a=e("../table"),u=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];n.unicodeRanges=u,n.getUnicodeRange=i,n.parse=r,n.make=o},{"../parse":8,"../table":10}],23:[function(e,t,n){function i(e,t){var n,i={},r=new s.Parser(e,t);switch(i.version=r.parseVersion(),i.italicAngle=r.parseFixed(),i.underlinePosition=r.parseShort(),i.underlineThickness=r.parseShort(),i.isFixedPitch=r.parseULong(),i.minMemType42=r.parseULong(),i.maxMemType42=r.parseULong(),i.minMemType1=r.parseULong(),i.maxMemType1=r.parseULong(),i.version){case 1:i.names=o.standardNames.slice();break;case 2:for(i.numberOfGlyphs=r.parseUShort(),i.glyphNameIndex=new Array(i.numberOfGlyphs),n=0;n<i.numberOfGlyphs;n++)i.glyphNameIndex[n]=r.parseUShort();for(i.names=[],n=0;n<i.numberOfGlyphs;n++)if(i.glyphNameIndex[n]>=o.standardNames.length){var a=r.parseChar();i.names.push(r.parseString(a))}break;case 2.5:for(i.numberOfGlyphs=r.parseUShort(),i.offset=new Array(i.numberOfGlyphs),n=0;n<i.numberOfGlyphs;n++)i.offset[n]=r.parseChar()}return i}function r(){return new a.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}var o=e("../encoding"),s=e("../parse"),a=e("../table");n.parse=i,n.make=r},{"../encoding":3,"../parse":8,"../table":10}],24:[function(e,t,n){function i(e){return Math.log(e)/Math.log(2)|0}function r(e){for(;e.length%4!=0;)e.push(0);for(var t=0,n=0;n<e.length;n+=4)t+=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];return t%=Math.pow(2,32)}function o(e,t,n,i){return new h.Table("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==n?n:0},{name:"length",type:"ULONG",value:void 0!==i?i:0}])}function s(e){var t=new h.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);t.tables=e,t.numTables=e.length;var n=Math.pow(2,i(t.numTables));t.searchRange=16*n,t.entrySelector=i(n),t.rangeShift=16*t.numTables-t.searchRange;for(var s=[],a=[],u=t.sizeOf()+o().sizeOf()*t.numTables;u%4!=0;)u+=1,a.push({name:"padding",type:"BYTE",value:0});for(var l=0;l<e.length;l+=1){var d=e[l];c.argument(4===d.tableName.length,"Table name"+d.tableName+" is invalid.");var p=d.sizeOf(),f=o(d.tableName,r(d.encode()),u,p);for(s.push({name:f.tag+" Table Record",type:"TABLE",value:f}),a.push({name:d.tableName+" table",type:"TABLE",value:d}),u+=p,c.argument(!isNaN(u),"Something went wrong calculating the offset.");u%4!=0;)u+=1,a.push({name:"padding",type:"BYTE",value:0})}return s.sort(function(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(s),t.fields=t.fields.concat(a),t}function a(e,t,n){for(var i=0;i<t.length;i+=1){var r=e.charToGlyphIndex(t[i]);if(r>0)return e.glyphs.get(r).getMetrics()}return n}function u(e){for(var t=0,n=0;n<e.length;n+=1)t+=e[n];return t/e.length}function l(e){for(var t,n=[],i=[],o=[],l=[],c=[],h=[],v=[],_=0,S=0,C=0,F=0,T=0,N=0;N<e.glyphs.length;N+=1){var O=e.glyphs.get(N),M=0|O.unicode;(t>M||null===t)&&(t=M),_<M&&(_=M);var V=y.getUnicodeRange(M);if(V<32)S|=1<<V;else if(V<64)C|=1<<V-32;else if(V<96)F|=1<<V-64;else{if(!(V<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");T|=1<<V-96}if(".notdef"!==O.name){var D=O.getMetrics();n.push(D.xMin),i.push(D.yMin),o.push(D.xMax),l.push(D.yMax),h.push(D.leftSideBearing),v.push(D.rightSideBearing),c.push(O.advanceWidth)}}var I={xMin:Math.min.apply(null,n),yMin:Math.min.apply(null,i),xMax:Math.max.apply(null,o),yMax:Math.max.apply(null,l),advanceWidthMax:Math.max.apply(null,c),advanceWidthAvg:u(c),minLeftSideBearing:Math.min.apply(null,h),maxLeftSideBearing:Math.max.apply(null,h),minRightSideBearing:Math.min.apply(null,v)};I.ascender=void 0!==e.ascender?e.ascender:I.yMax,I.descender=void 0!==e.descender?e.descender:I.yMin;var B=f.make({unitsPerEm:e.unitsPerEm,xMin:I.xMin,yMin:I.yMin,xMax:I.xMax,yMax:I.yMax}),E=g.make({ascender:I.ascender,descender:I.descender,advanceWidthMax:I.advanceWidthMax,minLeftSideBearing:I.minLeftSideBearing,minRightSideBearing:I.minRightSideBearing,xMaxExtent:I.maxLeftSideBearing+(I.xMax-I.xMin),numberOfHMetrics:e.glyphs.length}),A=b.make(e.glyphs.length),P=y.make({xAvgCharWidth:Math.round(I.advanceWidthAvg),usWeightClass:500,usWidthClass:5,usFirstCharIndex:t,usLastCharIndex:_,ulUnicodeRange1:S,ulUnicodeRange2:C,ulUnicodeRange3:F,ulUnicodeRange4:T,sTypoAscender:I.ascender,sTypoDescender:I.descender,sTypoLineGap:0,usWinAscent:I.ascender,usWinDescent:-I.descender,sxHeight:a(e,"xyvw",{yMax:0}).yMax,sCapHeight:a(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",I).yMax,usBreakChar:e.hasChar(" ")?32:0}),L=m.make(e.glyphs),R=d.make(e.glyphs),k=e.familyName+" "+e.styleName,z=e.familyName.replace(/\s/g,"")+"-"+e.styleName,j=s([B,E,A,P,w.make({copyright:e.copyright,fontFamily:e.familyName,fontSubfamily:e.styleName,uniqueID:e.manufacturer+":"+k,fullName:k,version:e.version,postScriptName:z,trademark:e.trademark,manufacturer:e.manufacturer,designer:e.designer,description:e.description,manufacturerURL:e.manufacturerURL,designerURL:e.designerURL,license:e.license,licenseURL:e.licenseURL,preferredFamily:e.familyName,preferredSubfamily:e.styleName}),R,x.make(),p.make(e.glyphs,{version:e.version,fullName:k,familyName:e.familyName,weightName:e.styleName,postScriptName:z,unitsPerEm:e.unitsPerEm}),L]),X=r(j.encode()),U=j.fields,G=!1;for(N=0;N<U.length;N+=1)if("head table"===U[N].name){U[N].value.checkSumAdjustment=2981146554-X,G=!0;break}if(!G)throw new Error("Could not find head table with checkSum to adjust.");return j}var c=e("../check"),h=e("../table"),d=e("./cmap"),p=e("./cff"),f=e("./head"),g=e("./hhea"),m=e("./hmtx"),b=e("./maxp"),w=e("./name"),y=e("./os2"),x=e("./post");n.computeCheckSum=r,n.make=s,n.fontToTable=l},{"../check":1,"../table":10,"./cff":11,"./cmap":12,"./head":15,"./hhea":16,"./hmtx":17,"./maxp":20,"./name":21,"./os2":22,"./post":23}],25:[function(e,t,n){function i(e){return function(){return e}}var r=e("./check"),o={},s={},a={};s.BYTE=function(e){return r.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},a.BYTE=i(1),s.CHAR=function(e){return[e.charCodeAt(0)]},a.CHAR=i(1),s.CHARARRAY=function(e){for(var t=[],n=0;n<e.length;n+=1)t.push(e.charCodeAt(n));return t},a.CHARARRAY=function(e){return e.length},s.USHORT=function(e){return[e>>8&255,255&e]},a.USHORT=i(2),s.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},a.SHORT=i(2),s.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},a.UINT24=i(3),s.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},a.ULONG=i(4),s.LONG=function(e){return e>=2147483648&&(e=-(4294967296-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},a.LONG=i(4),s.FIXED=s.ULONG,a.FIXED=a.ULONG,s.FWORD=s.SHORT,a.FWORD=a.SHORT,s.UFWORD=s.USHORT,a.UFWORD=a.USHORT,s.LONGDATETIME=function(){return[0,0,0,0,0,0,0,0]},a.LONGDATETIME=i(8),s.TAG=function(e){return r.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},a.TAG=i(4),s.Card8=s.BYTE,a.Card8=a.BYTE,s.Card16=s.USHORT,a.Card16=a.USHORT,s.OffSize=s.BYTE,a.OffSize=a.BYTE,s.SID=s.USHORT,a.SID=a.USHORT,s.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e-=108,[247+(e>>8),255&e]):e>=-1131&&e<=-108?(e=-e-108,[251+(e>>8),255&e]):e>=-32768&&e<=32767?s.NUMBER16(e):s.NUMBER32(e)},a.NUMBER=function(e){return s.NUMBER(e).length},s.NUMBER16=function(e){return[28,e>>8&255,255&e]},a.NUMBER16=i(3),s.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},a.NUMBER32=i(5),s.REAL=function(e){var t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){var i=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*i)/i).toString()}var r,o,s="";for(r=0,o=t.length;r<o;r+=1){var a=t[r];s+="e"===a?"-"===t[++r]?"c":"b":"."===a?"a":"-"===a?"e":a}var u=[30];for(r=0,o=(s+=1&s.length?"f":"ff").length;r<o;r+=2)u.push(parseInt(s.substr(r,2),16));return u},a.REAL=function(e){return s.REAL(e).length},s.NAME=s.CHARARRAY,a.NAME=a.CHARARRAY,s.STRING=s.CHARARRAY,a.STRING=a.CHARARRAY,s.UTF16=function(e){for(var t=[],n=0;n<e.length;n+=1){var i=e.charCodeAt(n);t.push(i>>8&255),t.push(255&i)}return t},a.UTF16=function(e){return 2*e.length},s.INDEX=function(e){var t,n=1,i=[n],r=[],o=0;for(t=0;t<e.length;t+=1){var a=s.OBJECT(e[t]);Array.prototype.push.apply(r,a),o+=a.length,n+=a.length,i.push(n)}if(0===r.length)return[0,0];var u=[],l=1+Math.floor(Math.log(o)/Math.log(2))/8|0,c=[void 0,s.BYTE,s.USHORT,s.UINT24,s.ULONG][l];for(t=0;t<i.length;t+=1){var h=c(i[t]);Array.prototype.push.apply(u,h)}return Array.prototype.concat(s.Card16(e.length),s.OffSize(l),u,r)},a.INDEX=function(e){return s.INDEX(e).length},s.DICT=function(e){for(var t=[],n=Object.keys(e),i=n.length,r=0;r<i;r+=1){var o=parseInt(n[r],0),a=e[o];t=(t=t.concat(s.OPERAND(a.value,a.type))).concat(s.OPERATOR(o))}return t},a.DICT=function(e){return s.DICT(e).length},s.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},s.OPERAND=function(e,t){var n=[];if(Array.isArray(t))for(var i=0;i<t.length;i+=1)r.argument(e.length===t.length,"Not enough arguments given for type"+t),n=n.concat(s.OPERAND(e[i],t[i]));else if("SID"===t)n=n.concat(s.NUMBER(e));else if("offset"===t)n=n.concat(s.NUMBER32(e));else if("number"===t)n=n.concat(s.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);n=n.concat(s.REAL(e))}return n},s.OP=s.BYTE,a.OP=a.BYTE;var u="function"==typeof WeakMap&&new WeakMap;s.CHARSTRING=function(e){if(u&&u.has(e))return u.get(e);for(var t=[],n=e.length,i=0;i<n;i+=1){var r=e[i];t=t.concat(s[r.type](r.value))}return u&&u.set(e,t),t},a.CHARSTRING=function(e){return s.CHARSTRING(e).length},s.OBJECT=function(e){var t=s[e.type];return r.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},a.OBJECT=function(e){var t=a[e.type];return r.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},s.TABLE=function(e){for(var t=[],n=e.fields.length,i=0;i<n;i+=1){var o=e.fields[i],a=s[o.type];r.argument(void 0!==a,"No encoding function for field type "+o.type);var u=e[o.name];void 0===u&&(u=o.value);var l=a(u);t=t.concat(l)}return t},a.TABLE=function(e){for(var t=0,n=e.fields.length,i=0;i<n;i+=1){var o=e.fields[i],s=a[o.type];r.argument(void 0!==s,"No sizeOf function for field type "+o.type);var u=e[o.name];void 0===u&&(u=o.value),t+=s(u)}return t},s.LITERAL=function(e){return e},a.LITERAL=function(e){return e.length},n.decode=o,n.encode=s,n.sizeOf=a},{"./check":1}]},{},[7])(7)}),define("cobweb/Browser/Text/X3DTextContext",["cobweb/Components/Text/FontStyle","lib/opentype.js/dist/opentype.js"],function(e,t){function n(){this.fontCache={},this.fontGeometryCache={}}return n.prototype={initialize:function(){},getDefaultFontStyle:function(){return this.defaultFontStyle||(this.defaultFontStyle=new e(this.getPrivateScene()),this.defaultFontStyle.setup()),this.defaultFontStyle},getFont:function(e,n,i){0!==e.query.length&&i("Font url with query not supported");var r=this.fontCache[e.filename];r||(r=this.fontCache[e.filename]=$.Deferred(),t.load(e.toString(),this.setFont.bind(this,e))),r.done(n),r.fail(i)},setFont:function(e,t,n){var i=this.fontCache[e.filename];if(t)i.reject(t);else{n.fontName=n.familyName+n.styleName;for(var r=0,o=n.numGlyphs;r<o;++r)n.glyphs.get(r).getPath(0,0,1);i.resolve(n)}},getFontGeometryCache:function(){return this.fontGeometryCache}},n}),define("cobweb/Components/Texturing/X3DTextureTransformNode",["jquery","cobweb/Components/Shape/X3DAppearanceChildNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(e,t,n,i){function r(e){t.call(this,e),this.addType(n.X3DTextureTransformNode),this.matrix=new i,this.matrixArray=new Float32Array(this.matrix)}return r.prototype=e.extend(Object.create(t.prototype),{constructor:r,setMatrix:function(e){this.matrixArray.set(e)},getMatrix:function(){return this.matrix},setShaderUniforms:function(e,t){e.uniformMatrix4fv(t.x3d_TextureMatrix,!1,this.matrixArray)}}),r}),define("cobweb/Components/Texturing/TextureTransform",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTextureTransformNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Matrix3"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.TextureTransform),this.matrix3=new a}var l=new s(0,0);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"translation",new t.SFVec2f),new n(o.inputOutput,"rotation",new t.SFFloat),new n(o.inputOutput,"scale",new t.SFVec2f(1,1)),new n(o.inputOutput,"center",new t.SFVec2f)]),getTypeName:function(){return"TextureTransform"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"textureTransform"},initialize:function(){r.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed:function(){r.prototype.eventsProcessed.call(this);var e=this.translation_.getValue(),t=this.rotation_.getValue(),n=this.scale_.getValue(),i=this.center_.getValue(),o=this.matrix3;o.identity(),i.equals(s.Zero)||o.translate(l.assign(i).negate()),n.equals(s.One)||o.scale(n),0!==t&&o.rotate(t),i.equals(s.Zero)||o.translate(i),e.equals(s.Zero)||o.translate(e);var a=this.getMatrix();a[0]=o[0],a[1]=o[1],a[4]=o[3],a[5]=o[4],a[12]=o[6],a[13]=o[7],this.setMatrix(a)}}),u}),define("cobweb/Browser/Texturing/X3DTexturingContext",["cobweb/Components/Texturing/TextureProperties","cobweb/Components/Texturing/TextureTransform","cobweb/Components/Texturing/TextureCoordinate"],function(e,t,n){function i(){this.textureUnits=[],this.combinedTextureUnits=[],this.textureStages=1,this.defaultTextureProperties=new e(this.getPrivateScene()),this.defaultTextureTransform=new t(this.getPrivateScene()),this.defaultTextureCoordinate=new n(this.getPrivateScene())}return i.prototype={initialize:function(){var e=this.getBrowser().getContext();this.defaultTextureProperties.magnificationFilter_.setValue("NICEST"),this.defaultTextureProperties.minificationFilter_.setValue("AVG_PIXEL_AVG_MIPMAP"),this.defaultTextureProperties.textureCompression_.setValue("NICEST"),this.defaultTextureProperties.generateMipMaps_.setValue(!0),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxTextureUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxCombinedTextureUnits=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.textureMemory=NaN;for(var t=this.textureUnits,n=this.combinedTextureUnits,i=this.maxTextureUnits-1;i>=0;--i)t.push(i);for(var i=this.maxTextureUnits,r=this.maxCombinedTextureUnits;i<r;++i)n.push(i);this.defaultTextureProperties.setup(),this.defaultTextureTransform.setup(),this.defaultTextureCoordinate.setup();var o=new Uint8Array([255,255,255,255]);this.defaultTexture2D=e.createTexture(),this.defaultComposedCubeMapTexture=e.createTexture(),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,this.defaultTexture2D),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,o),e.activeTexture(e.TEXTURE4),e.bindTexture(e.TEXTURE_CUBE_MAP,this.defaultComposedCubeMapTexture),e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_Z,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,o),e.texImage2D(e.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,o),e.texImage2D(e.TEXTURE_CUBE_MAP_NEGATIVE_X,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,o),e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,o),e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_Y,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,o),e.texImage2D(e.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,o),e.activeTexture(e.TEXTURE0)},getMaxTextures:function(){return 1},getMinTextureSize:function(){return 16},getMaxTextureSize:function(){return this.maxTextureSize},getMaxTextureUnits:function(){return this.maxTextureUnits},getMaxCombinedTextureUnits:function(){return this.maxCombinedTextureUnits},getTextureUnits:function(){return this.textureUnits},getCombinedTextureUnits:function(){return this.combinedTextureUnits},getTextureMemory:function(){return this.textureMemory},getDefaultTextureProperties:function(){return this.defaultTextureProperties},getDefaultTextureTransform:function(){return this.defaultTextureTransform},getDefaultTextureCoordinate:function(){return this.defaultTextureCoordinate}},i}),define("cobweb/Browser/Time/X3DTimeContext",["standard/Math/Numbers/Vector3"],function(e){function t(){this.currentPosition=new e(0,0,0)}var n=new e(0,0,0);return t.prototype={initialize:function(){this.advanceTime(performance.now())},getCurrentTime:function(){return this.currentTime},advanceTime:function(e){var t=(e=(e+performance.timing.navigationStart)/1e3)-this.currentTime;if(this.currentTime=e,this.currentFrameRate=t?1/t:0,this.getWorld()&&this.getActiveLayer()){var i=this.getActiveLayer().getViewpoint().getCameraSpaceMatrix();n.assign(this.currentPosition),this.currentPosition.set(i[12],i[13],i[14]),this.currentSpeed=n.subtract(this.currentPosition).abs()*this.currentFrameRate}else this.currentSpeed=0}},t}),define("standard/Math/Algorithms/QuickSort",[],function(){function e(e,t){this.array=e,t&&(this.compare=t)}return e.prototype={compare:function(e,t){return e<t},sort:function(e,t){t-e>1&&this.quicksort(e,t-1)},quicksort:function(e,t){for(var n=e,i=t,r=this.array,o=this.compare,s=r[e+t>>>1];;){for(;o(r[n],s);)++n;for(;o(s,r[i]);)--i;if(!(n<i)){n===i&&(++n,--i);break}var a=r[n];r[n]=r[i],r[i]=a,n++,i--}e<i&&this.quicksort(e,i),n<t&&this.quicksort(n,t)}},e}),define("cobweb/Components/ParticleSystems/X3DParticleEmitterNode",["jquery","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Algorithm","standard/Math/Algorithms/QuickSort"],function(e,t,n,i,r,o,s,a,u){function l(e,t){return g.getDistanceToPoint(e)<g.getDistanceToPoint(t)}function c(e,t){return e<g.getDistanceToPoint(t)}function h(e){t.call(this,e),this.addType(n.X3DParticleEmitterNode),this.rotations=[],this.intersections=[],this.intersectionNormals=[],this.sorter=new u(this.intersections,l)}var d=new i(0,0,0),p=new i(0,0,0),f=new o(i.Zero,i.zAxis),g=new s(i.Zero,i.zAxis);return h.prototype=e.extend(Object.create(t.prototype),{constructor:h,initialize:function(){t.prototype.initialize.call(this),this.speed_.addInterest("set_speed__",this),this.variation_.addInterest("set_variation__",this),this.mass_.addInterest("set_mass__",this),this.set_speed__(),this.set_variation__(),this.set_mass__()},set_speed__:function(){this.speed=this.speed_.getValue()},set_variation__:function(){this.variation=this.variation_.getValue()},set_mass__:function(){this.mass=this.mass_.getValue()},isExplosive:function(){return!1},getMass:function(){return this.mass},getRandomLifetime:function(e,t){var n=e*t,i=Math.max(0,e-n),r=e+n;return Math.random()*(r-i)+i},getRandomSpeed:function(){var e=this.speed,t=e*this.variation,n=Math.max(0,e-t),i=e+t;return Math.random()*(i-n)+n},getSphericalRandomVelocity:function(e){return this.getRandomNormal(e).multiply(this.getRandomSpeed())},getRandomValue:function(e,t){return Math.random()*(t-e)+e},getRandomNormal:function(e){var t=this.getRandomValue(-1,1)*Math.PI,n=this.getRandomValue(-1,1),i=Math.acos(n),r=Math.sin(i);return e.set(Math.sin(t)*r,Math.cos(t)*r,n)},getRandomNormalWithAngle:function(e,t){var n=(2*Math.random()-1)*Math.PI,i=this.getRandomValue(Math.cos(e),1),r=Math.acos(i),o=Math.sin(r);return t.set(Math.sin(n)*o,Math.cos(n)*o,i)},getRandomNormalWithDirectionAndAngle:function(e,t,n){return rotation.setFromToVec(i.zAxis,e),rotation.multVecRot(this.getRandomNormalAngle(t,n))},getRandomSurfaceNormal:function(e){var t=this.getRandomValue(-1,1)*Math.PI,n=Math.pow(Math.random(),1/3),i=Math.acos(n),r=Math.sin(i);return e.set(Math.sin(t)*r,Math.cos(t)*r,n)},animate:function(e,t){for(var n=e.particles,o=e.numParticles,s=e.createParticles,a=e.particleLifetime,u=e.lifetimeVariation,l=e.speeds,c=e.velocities,h=e.turbulences,f=this.rotations,g=e.numForces,m=e.boundedVertices.length,b=e.boundedVolume,w=f.length;w<g;++w)f[w]=new r(0,0,1,0);for(w=0;w<g;++w)f[w].setFromToVec(i.zAxis,c[w]);for(w=0;w<o;++w){var y=n[w],x=y.elapsedTime+t;if(x>y.lifetime)y.lifetime=this.getRandomLifetime(a,u),y.elapsedTime=0,s?(this.getRandomPosition(y.position),this.getRandomVelocity(y.velocity)):y.position.set(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);else{for(var v=y.position,_=y.velocity,S=0;S<g;++S)_.add(f[S].multVecRot(this.getRandomNormalWithAngle(h[S],d)).multiply(l[S]));m?(p.x=v.x,p.y=v.y,p.z=v.z,v.x+=_.x*t,v.y+=_.y*t,v.z+=_.z*t,this.bounce(b,p,v,_)):(v.x+=_.x*t,v.y+=_.y*t,v.z+=_.z*t),y.elapsedTime=x}}e.colorMaterial&&this.getColors(n,e.colorKeys,e.colorRamp,o)},bounce:function(e,t,n,i){d.assign(i).normalize(),f.set(t,d);var r=this.intersections,o=this.intersectionNormals,s=e.intersectsLine(f,r,o);if(s){for(var u=0;u<s;++u)r[u].index=u;g.set(t,d),this.sorter.sort(0,s);var l=a.upperBound(r,0,s,0,c);if(l<s){var h=r[l],p=o[h.index];if(g.set(h,p),g.getDistanceToPoint(t)*g.getDistanceToPoint(n)<0){var m=2*p.dot(i);i.x-=p.x*m,i.y-=p.y*m,i.z-=p.z*m,d.assign(i).normalize();var b=h.distance(t);n.x=h.x+d.x*b,n.y=h.y+d.y*b,n.z=h.z+d.z*b}}}},getColors:function(e,t,n,i){for(var r=t.length,o=0,s=0,u=0,l=0;l<i;++l){var c=e[l],h=c.elapsedTime/c.lifetime,d=c.color;if(1==r||h<=t[0])o=0,s=0,u=0;else if(h>=t[r-1])o=r-2,s=r-1,u=1;else{var p=a.upperBound(t,0,r,h,a.less);if(p<r){s=p;var f=t[o=p-1],g=t[s];u=a.clamp((h-f)/(g-f),0,1)}else o=0,s=0,u=0}var m=n[o],b=n[s];d.x=m.x+u*(b.x-m.x),d.y=m.y+u*(b.y-m.y),d.z=m.z+u*(b.z-m.z),d.w=m.w+u*(b.w-m.w)}}}),h}),define("cobweb/Components/ParticleSystems/PointEmitter",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticleEmitterNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.PointEmitter),this.direction=new s(0,0,0)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"position",new t.SFVec3f),new n(o.inputOutput,"direction",new t.SFVec3f(0,1,0)),new n(o.inputOutput,"speed",new t.SFFloat),new n(o.inputOutput,"variation",new t.SFFloat(.25)),new n(o.initializeOnly,"mass",new t.SFFloat),new n(o.initializeOnly,"surfaceArea",new t.SFFloat)]),getTypeName:function(){return"PointEmitter"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"emitter"},initialize:function(){r.prototype.initialize.call(this),this.position_.addInterest("set_position__",this),this.direction_.addInterest("set_direction__",this),this.set_position__(),this.set_direction__()},set_position__:function(){this.position=this.position_.getValue()},set_direction__:function(){this.direction.assign(this.direction_.getValue()).normalize(),this.direction.equals(s.Zero)?this.getRandomVelocity=this.getSphericalRandomVelocity:delete this.getRandomVelocity},getRandomPosition:function(e){return e.assign(this.position)},getRandomVelocity:function(e){var t=this.direction,n=this.getRandomSpeed();return e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e}}),a}),define("cobweb/Browser/ParticleSystems/X3DParticleSystemsContext",["cobweb/Components/ParticleSystems/PointEmitter"],function(e){function t(){this.defaultEmitter=new e(this.getPrivateScene())}return t.prototype={initialize:function(){this.defaultEmitter.setup()},getDefaultEmitter:function(){return this.defaultEmitter}},t}),define("cobweb/Rendering/X3DRenderObject",["jquery","cobweb/Rendering/DepthBuffer","cobweb/Bits/TraverseType","standard/Math/Algorithm","standard/Math/Algorithms/MergeSort","standard/Math/Geometry/Camera","standard/Math/Geometry/Box3","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack"],function(e,t,n,i,r,o,s,a,u,l,c,h,d){function p(e,t){return e.distance<t.distance}function f(e){this.cameraSpaceMatrix=new d(h),this.inverseCameraSpaceMatrix=new d(h),this.projectionMatrix=new d(h),this.modelViewMatrix=new d(h),this.viewVolumes=[],this.clipPlanes=[],this.globalLights=[],this.localLights=[],this.lights=[],this.localFogs=[],this.layouts=[],this.generatedCubeMapTextures=[],this.shaders=[],this.collisions=[],this.numOpaqueShapes=0,this.numTransparentShapes=0,this.numCollisionShapes=0,this.numDepthShapes=0,this.opaqueShapes=[],this.transparentShapes=[],this.transparencySorter=new r(this.transparentShapes,p),this.collisionShapes=[],this.activeCollisions={},this.depthShapes=[],this.invModelViewMatrix=new h,this.speed=0;try{this.depthBuffer=new t(e.getBrowser(),g,m)}catch(e){console.error(e),this.getDepth=function(){return 0}}}var g=16,m=g,b=new Int32Array(4),w=new h,y=new Float32Array(16),x=new h,v=new h,_=new c(0,0,1,0),S=new u(0,1,0),C=new u(0,0,1),F=new u(0,0,0),T=new c(0,0,1,0),N=new l(0,0,g,m),O=new a,M=new s(u.Zero,u.Zero),V=new u(0,0,0);return O.set(h.Identity,N,N),f.prototype={constructor:f,bboxSize:new u(0,0,0),bboxCenter:new u(0,0,0),translation:new u(0,0,0),initialize:function(){},isIndependent:function(){return!0},getCameraSpaceMatrix:function(){return this.cameraSpaceMatrix},getInverseCameraSpaceMatrix:function(){return this.inverseCameraSpaceMatrix},getProjectionMatrix:function(){return this.projectionMatrix},getModelViewMatrix:function(){return this.modelViewMatrix},getViewVolumes:function(){return this.viewVolumes},getViewVolume:function(){return this.viewVolumes[this.viewVolumes.length-1]},getClipPlanes:function(){return this.clipPlanes},getGlobalLights:function(){return this.globalLights},getLocalLights:function(){return this.localLights},getLights:function(){return this.lights},setGlobalFog:function(e){this.localFog=this.localFogs[0]=e},pushLocalFog:function(e){this.localFogs.push(e),this.localFog=e},popLocalFog:function(){this.localFogs.pop(),this.localFog=this.localFogs[this.localFogs.length-1]},getLayouts:function(){return this.layouts},getParentLayout:function(){return this.layouts.length?this.layouts[this.layouts.length-1]:null},getGeneratedCubeMapTextures:function(){return this.generatedCubeMapTextures},getShaders:function(){return this.shaders},getCollisions:function(){return this.collisions},constrainTranslation:function(e,t){var n=this.getDistance(e);return n-=this.getNavigationInfo().getCollisionRadius(),n>0?e.abs()>n?e.normalize().multiply(n):e:t?this.constrainTranslation(e.normalize().multiply(n),!1):e.assign(u.Zero)},getDistance:function(e){try{var t=performance.now(),n=this.getViewpoint(),i=this.getNavigationInfo(),r=i.getCollisionRadius(),s=i.getStepHeight()-i.getAvatarHeight(),a=i.getNearValue(),u=i.getAvatarHeight();o.ortho(-r,r,Math.min(s,-r),r,a,Math.max(2*r,2*u),w),_.assign(n.orientation_.getValue()).inverse().multRight(n.getOrientation()),T.setFromToVec(C,F.assign(e).negate()).multRight(_),n.straightenHorizon(T),v.assign(n.getTransformationMatrix()),v.translate(n.getUserPosition()),v.rotate(T),v.inverse(),v.multRight(w),v.multLeft(n.getCameraSpaceMatrix()),this.getProjectionMatrix().pushMatrix(v);var l=this.getDepth(w);return this.getProjectionMatrix().pop(),this.collisionTime+=performance.now()-t,-l}catch(e){console.log(e)}},getDepth:function(e){this.depthBuffer.bind(),this.viewVolumes.push(O),this.depth(this.collisionShapes,this.numCollisionShapes),this.viewVolumes.pop();var t=this.depthBuffer.getDepth(e,N);return this.depthBuffer.unbind(),t},render:function(e,t){switch(e){case n.COLLISION:this.numCollisionShapes=0,t.traverse(e,this),this.collide(),this.gravite();break;case n.DEPTH:this.numDepthShapes=0,t.traverse(e,this),this.depth(this.depthShapes,this.numDepthShapes);break;case n.DISPLAY:this.lightIndex=0,this.numOpaqueShapes=0,this.numTransparentShapes=0,this.setGlobalFog(this.getFog()),t.traverse(e,this),this.draw(t)}},addCollisionShape:function(e){var t=this.getModelViewMatrix().get(),n=t.multDirMatrix(this.bboxSize.assign(e.getBBoxSize())),i=t.multVecMatrix(this.bboxCenter.assign(e.getBBoxCenter())),r=n.abs()/2,o=this.viewVolumes[this.viewVolumes.length-1];if(o.intersectsSphere(r,i)){this.numCollisionShapes===this.collisionShapes.length&&this.collisionShapes.push({renderer:this,modelViewMatrix:new Float32Array(16),collisions:[],clipPlanes:[]});var s=this.collisionShapes[this.numCollisionShapes];++this.numCollisionShapes,s.modelViewMatrix.set(t),s.shapeNode=e,s.scissor=o.getScissor();for(var a=this.getCollisions(),u=s.collisions,l=0,c=a.length;l<c;++l)u[l]=a[l];u.length=a.length;for(var h=this.getClipPlanes(),d=s.clipPlanes,l=0,c=h.length;l<c;++l)d[l]=h[l];return d.length=h.length,!0}return!1},addDepthShape:function(e){var t=this.getModelViewMatrix().get(),n=t.multDirMatrix(this.bboxSize.assign(e.getBBoxSize())),i=t.multVecMatrix(this.bboxCenter.assign(e.getBBoxCenter())),r=n.abs()/2,o=this.viewVolumes[this.viewVolumes.length-1];if(o.intersectsSphere(r,i)){this.numDepthShapes===this.depthShapes.length&&this.depthShapes.push({renderer:this,modelViewMatrix:new Float32Array(16),clipPlanes:[]});var s=this.depthShapes[this.numDepthShapes];++this.numDepthShapes,s.modelViewMatrix.set(t),s.shapeNode=e,s.scissor=o.getScissor();for(var a=this.getClipPlanes(),u=s.clipPlanes,l=0,c=a.length;l<c;++l)u[l]=a[l];return u.length=a.length,!0}return!1},addDisplayShape:function(e){var t=this.getModelViewMatrix().get(),n=t.multDirMatrix(this.bboxSize.assign(e.getBBoxSize())),i=t.multVecMatrix(this.bboxCenter.assign(e.getBBoxCenter())),r=n.abs()/2,o=i.z,s=this.viewVolumes[this.viewVolumes.length-1];if(s.intersectsSphere(r,i)){if(e.isTransparent()){(a=this.numTransparentShapes)===this.transparentShapes.length&&this.transparentShapes.push(this.createShapeContext(!0));u=this.transparentShapes[a];++this.numTransparentShapes}else{var a=this.numOpaqueShapes;a===this.opaqueShapes.length&&this.opaqueShapes.push(this.createShapeContext(!1));var u=this.opaqueShapes[a];++this.numOpaqueShapes}u.modelViewMatrix.set(t),u.scissor.assign(s.getScissor()),u.shapeNode=e,u.distance=o-r,u.fogNode=this.localFog;for(var l=this.getClipPlanes(),c=u.clipPlanes,h=0,d=l.length;h<d;++h)c[h]=l[h];c.length=l.length;for(var p=this.getLocalLights(),f=u.localLights,h=0,d=p.length;h<d;++h)f[h]=p[h];return f.length=p.length,!0}return!1},createShapeContext:function(e){return{renderer:this,transparent:!0,geometryType:3,colorMaterial:!1,modelViewMatrix:new Float32Array(16),scissor:new l(0,0,0,0),clipPlanes:[],localLights:[],linePropertiesNode:null,materialNode:null,textureNode:null,textureTransformNode:null,shaderNode:null}},collide:function(){var t={},n=2.2*this.getNavigationInfo().getCollisionRadius();V.set(n,n,n);for(var r=0,o=this.numCollisionShapes;r<o;++r)try{var s=this.collisionShapes[r],a=s.collisions;if(a.length&&(M.set(V,u.Zero),M.multRight(this.invModelViewMatrix.assign(s.modelViewMatrix).inverse()),s.shapeNode.intersectsBox(M,s.clipPlanes,x.assign(s.modelViewMatrix))))for(var l=0;l<a.length;++l)t[a[l].getId()]=a[l]}catch(e){console.log(e)}if(!e.isEmptyObject(this.activeCollisions)){var c=e.isEmptyObject(t)?this.activeCollisions:i.set_difference(this.activeCollisions,t,{});for(var h in c)c[h].set_active(!1)}this.activeCollisions=t;for(var h in t)t[h].set_active(!0)},gravite:function(){try{if(this.getBrowser().getActiveLayer().getNavigationInfo()===this.getNavigationInfo()){if("WALK"!==this.getBrowser().getCurrentViewer())return}else if("WALK"!==this.getNavigationInfo().getViewer())return;var e=this.getNavigationInfo(),t=this.getViewpoint(),n=e.getCollisionRadius(),i=e.getNearValue(),r=e.getAvatarHeight(),s=e.getStepHeight();o.ortho(-n,n,-n,n,i,Math.max(2*n,2*r),w);var a=t.getUpVector(),u=T.setFromToVec(C,a);v.assign(t.getTransformationMatrix()),v.translate(t.getUserPosition()),v.rotate(u),v.inverse(),v.multRight(w),v.multLeft(t.getCameraSpaceMatrix()),this.getProjectionMatrix().pushMatrix(v);var l=-this.getDepth(w);this.getProjectionMatrix().pop(),l-=r;var c=T.setFromToVec(S,a);if(l>0){var h=this.speed?this.getBrowser().getCurrentFrameRate():1e6;this.speed-=this.getBrowser().getBrowserOptions().Gravity_.getValue()/h,(d=this.speed/h)<-l&&(d=-l,this.speed=0),t.positionOffset_=t.positionOffset_.getValue().add(c.multVecRot(F.set(0,d,0)))}else if(this.speed=0,(l=-l)>.01&&l<s){var d=this.constrainTranslation(c.multVecRot(this.translation.set(0,l,0)),!1);t.positionOffset_=d.add(t.positionOffset_.getValue())}}catch(e){console.log(e)}},depth:function(e,t){var n=this.getBrowser(),i=n.getContext(),r=this.getViewVolume().getViewport(),o=n.getDepthShader();o.useProgram(i),y.set(this.getProjectionMatrix().get()),i.uniformMatrix4fv(o.x3d_ProjectionMatrix,!1,y),i.viewport(r[0],r[1],r[2],r[3]),i.scissor(r[0],r[1],r[2],r[3]),i.clearColor(1,0,0,0),i.clear(i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT),i.enable(i.DEPTH_TEST),i.depthMask(!0),i.disable(i.BLEND),i.disable(i.CULL_FACE);for(var s=0;s<t;++s){var a=e[s],u=a.scissor;i.scissor(u.x,u.y,u.z,u.w),o.setClipPlanes(i,a.clipPlanes),i.uniformMatrix4fv(o.x3d_ModelViewMatrix,!1,a.modelViewMatrix),a.shapeNode.depth(a,o)}},draw:function(e){var t=this.getBrowser(),n=t.getContext(),i=this.getViewVolume().getViewport(),r=this.shaders,o=this.lights,s=this.generatedCubeMapTextures;if(this.isIndependent()){for(var a=0,u=o.length;a<u;++a)o[a].renderShadowMap(this);for(var a=0,u=s.length;a<u;++a)s[a].renderTexture(this,e)}t.getHeadlight().setGlobalVariables(this);for(var a=0,u=o.length;a<u;++a)o[a].setGlobalVariables(this);n.viewport(i[0],i[1],i[2],i[3]),n.scissor(i[0],i[1],i[2],i[3]),n.clear(n.DEPTH_BUFFER_BIT),this.getBackground().display(this,i),b.set(i),y.set(this.getProjectionMatrix().get()),t.getPointShader().setGlobalUniforms(this,n,y,b),t.getLineShader().setGlobalUniforms(this,n,y,b),t.getDefaultShader().setGlobalUniforms(this,n,y,b);for(var l in r)r[l].setGlobalUniforms(this,n,y,b);n.enable(n.DEPTH_TEST),n.depthMask(!0),n.disable(n.BLEND);for(a=0;a<this.numOpaqueShapes;++a){h=(c=this.opaqueShapes[a]).scissor;n.scissor(h.x,h.y,h.z,h.w),c.shapeNode.display(c)}n.depthMask(!1),n.enable(n.BLEND),this.transparencySorter.sort(0,this.numTransparentShapes);for(a=0;a<this.numTransparentShapes;++a){var c=this.transparentShapes[a],h=c.scissor;n.scissor(h.x,h.y,h.z,h.w),c.shapeNode.display(c)}n.depthMask(!0),n.disable(n.BLEND),n.activeTexture(n.TEXTURE0);for(var d=this.getBrowser().getClipPlanes(),a=0,u=d.length;a<u;++a)d[a].dispose();if(d.length=0,s.length=0,this.isIndependent()){for(var a=0,u=(o=this.globalLights).length;a<u;++a)o[a].dispose();for(var a=0,u=(o=this.getBrowser().getLocalLights()).length;a<u;++a)o[a].dispose();o.length=0}this.globalLights.length=0,this.lights.length=0}},f}),define("cobweb/Execution/BindableStack",["jquery","cobweb/Basic/X3DBaseNode"],function(e,t){function n(e,n,i){t.call(this,e),this.layer=n,this.array=[i]}return n.prototype=e.extend(Object.create(t.prototype),{constructor:n,getTypeName:function(){return"BindableStack"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"bindableStack"},get:function(){return this.array},top:function(){return this.array[this.array.length-1]},forcePush:function(e){e.isBound_=!0,e.bindTime_=this.getBrowser().getCurrentTime(),this.push(e)},push:function(e){if(0!==this.array.length&&e!==this.array[0]){var t=this.top();e!==t&&(this.pushOnTop(e),t.isBound_.getValue()&&(t.set_bind_=!1,t.isBound_=!1),e.isBound_.getValue()||(e.isBound_=!0,e.bindTime_=this.getBrowser().getCurrentTime(),e.transitionStart(t)),this.pushOnTop(e),this.addNodeEvent())}},pushOnTop:function(e){var t=this.array.indexOf(e);t>-1&&this.array.splice(t,1),this.array.push(e)},remove:function(e){if(e!==this.array[0]){if(e===this.top())return this.pop(e);var t=this.array.indexOf(e);t>-1&&this.array.splice(t,1)}},pop:function(e){if(e!==this.array[0]){var t=this.top();if(e===t){if(e.isBound_.getValue()&&(e.isBound_=!1),0===this.array.length)return;this.array.pop(),(t=this.top()).isBound_.getValue()||(t.set_bind_=!0,t.isBound_=!0,t.bindTime_=this.getBrowser().getCurrentTime(),t.transitionStart(e)),this.addNodeEvent()}}}}),n}),define("cobweb/Execution/BindableList",["jquery","cobweb/Basic/X3DBaseNode"],function(e,t){function n(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}function i(e,n,i){t.call(this,e),this.layer=n,this.collected=[i],this.array=[i]}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,getTypeName:function(){return"BindableList"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"bindableList"},get:function(){return this.array},getBound:function(e){if(e&&e.length)for(var t=1,n=this.array.length;t<n;++t)if((i=this.array[t]).getName()==e)return i;for(var t=1,n=this.array.length;t<n;++t){var i=this.array[t];if(i.isBound_.getValue())return i}return n>1?this.array[1]:this.array[0]},push:function(e){return this.collected.push(e)},update:function(){if(!n(this.collected,this.array)){var e=this.array;this.array=this.collected,this.collected=e}this.collected.length=1}}),i}),define("cobweb/Components/EnvironmentalEffects/X3DFogObject",["jquery","cobweb/Bits/X3DConstants"],function(e,t){function n(e){this.addType(t.X3DFogObject),this.hidden=!1}return n.prototype={constructor:n,initialize:function(){this.fogType_.addInterest("set_fogType__",this),this.set_fogType__()},set_fogType__:function(){switch(this.fogType_.getValue()){case"EXPONENTIAL":this.fogType=2;break;default:this.fogType=1}},setHidden:function(e){this.hidden=e,this.getBrowser().addBrowserEvent()},getHidden:function(){return this.hidden},setShaderUniforms:function(e,t,n){if(this.hidden)e.uniform1i(t.x3d_FogType,0);else{var i=this.color_.getValue(),r=Math.max(0,this.visibilityRange_.getValue());0===r&&(r=n.getNavigationInfo().getFarValue(n.getViewpoint())),e.uniform1i(t.x3d_FogType,this.fogType),e.uniform3f(t.x3d_FogColor,i.r,i.g,i.b),e.uniform1f(t.x3d_FogVisibilityRange,r)}}},n}),define("cobweb/Components/EnvironmentalEffects/Fog",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DBindableNode","cobweb/Components/EnvironmentalEffects/X3DFogObject","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),o.call(this,e),this.addType(a.Fog)}return u.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:u,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOnly,"set_bind",new t.SFBool),new n(a.inputOutput,"fogType",new t.SFString("LINEAR")),new n(a.inputOutput,"color",new t.SFColor(1,1,1)),new n(a.inputOutput,"visibilityRange",new t.SFFloat),new n(a.outputOnly,"isBound",new t.SFBool),new n(a.outputOnly,"bindTime",new t.SFTime)]),getTypeName:function(){return"Fog"},getComponentName:function(){return"EnvironmentalEffects"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this)},bindToLayer:function(e){e.getFogStack().push(this)},unbindFromLayer:function(e){e.getFogStack().pop(this)},removeFromLayer:function(e){e.getFogStack().remove(this)},traverse:function(e,t){t.getLayer().getFogs().push(this)}}),u}),define("cobweb/Components/EnvironmentalEffects/X3DBackgroundNode",["jquery","cobweb/Components/Core/X3DBindableNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l){function c(e){t.call(this,e),this.addType(i.X3DBackgroundNode),this.hidden=!1,this.projectionMatrixArray=new Float32Array(16),this.transformationMatrix=new u,this.modelViewMatrixArray=new Float32Array(16),this.clipPlanes=[],this.colors=[],this.sphere=[],this.textures=0}var h=Math.sqrt(.5),d=h,p=[1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,0,0,1],f=[d,d,-d,1,-d,d,-d,1,-d,-d,-d,1,d,d,-d,1,-d,-d,-d,1,d,-d,-d,1],g=[-d,d,d,1,d,d,d,1,d,-d,d,1,-d,d,d,1,d,-d,d,1,-d,-d,d,1],m=[-d,d,-d,1,-d,d,d,1,-d,-d,d,1,-d,d,-d,1,-d,-d,d,1,-d,-d,-d,1],b=[d,d,d,1,d,d,-d,1,d,-d,-d,1,d,d,d,1,d,-d,-d,1,d,-d,d,1],w=[d,d,d,1,-d,d,d,1,-d,d,-d,1,d,d,d,1,-d,d,-d,1,d,d,-d,1],y=[d,-d,-d,1,-d,-d,-d,1,-d,-d,d,1,d,-d,-d,1,-d,-d,d,1,d,-d,d,1],x=new o(0,0),v=new o(0,0),_=new o(0,0),S=new o(0,0),C=new o(0,0),F=new o(0,0),T=new s(0,0,0),N=new u;return c.prototype=e.extend(Object.create(t.prototype),{constructor:c,modelViewMatrix:new u,rotation:new a,scale:new s(0,0,0),textureMatrixArray:new Float32Array(new u),rectangleCount:6,initialize:function(){t.prototype.initialize.call(this);var e=this.getBrowser().getContext();this.colorBuffer=e.createBuffer(),this.sphereBuffer=e.createBuffer(),this.texCoordBuffer=e.createBuffer(),this.cubeBuffer=e.createBuffer(),this.texCoordBuffers=[e.createBuffer()],this.frontBuffer=e.createBuffer(),this.backBuffer=e.createBuffer(),this.leftBuffer=e.createBuffer(),this.rightBuffer=e.createBuffer(),this.topBuffer=e.createBuffer(),this.bottomBuffer=e.createBuffer(),this.groundAngle_.addInterest("build",this),this.groundColor_.addInterest("build",this),this.skyAngle_.addInterest("build",this),this.skyColor_.addInterest("build",this),this.transparency_.addInterest("build",this),this.build(),this.transferRectangle()},set_frontTexture__:function(e){this.setTexture("frontTexture",e,0)},set_backTexture__:function(e){this.setTexture("backTexture",e,1)},set_leftTexture__:function(e){this.setTexture("leftTexture",e,2)},set_rightTexture__:function(e){this.setTexture("rightTexture",e,3)},set_topTexture__:function(e){this.setTexture("topTexture",e,4)},set_bottomTexture__:function(e){this.setTexture("bottomTexture",e,5)},setTexture:function(e,t,n){this[e]&&this[e].loadState_.removeInterest("setTextureBit",this),this[e]=t,t?(t.loadState_.addInterest("setTextureBit",this,n),this.setTextureBit(t.loadState_,n)):this.textures&=~(1<<n)},setTextureBit:function(e,t){e.getValue()===i.COMPLETE_STATE?this.textures|=1<<t:this.textures&=~(1<<t)},bindToLayer:function(e){e.getBackgroundStack().push(this)},unbindFromLayer:function(e){e.getBackgroundStack().pop(this)},removeFromLayer:function(e){e.getBackgroundStack().remove(this)},setHidden:function(e){this.hidden=e,this.getBrowser().addBrowserEvent()},getHidden:function(){return this.hidden},isTransparent:function(){return!!this.hidden||0!==this.transparency_.getValue()&&(!(this.frontTexture&&!this.frontTexture.transparent_.getValue())||(!(this.backTexture&&!this.backTexture.transparent_.getValue())||(!(this.leftTexture&&!this.leftTexture.transparent_.getValue())||(!(this.rightTexture&&!this.rightTexture.transparent_.getValue())||(!(this.topTexture&&!this.topTexture.transparent_.getValue())||!(this.bottomTexture&&!this.bottomTexture.transparent_.getValue()))))))},getColor:function(e,t,n){return t[l.upperBound(n,0,n.length,e,l.less)]},build:function(){if(this.colors.length=0,this.sphere.length=0,!(this.transparency_.getValue()>=1)){var e=1-l.clamp(this.transparency_.getValue(),0,1);if(0===this.groundColor_.length&&1==this.skyColor_.length){var t=h;this.sphere.vertices=36,this.sphere.push(t,t,-t,1,-t,t,-t,1,-t,-t,-t,1,t,t,-t,1,-t,-t,-t,1,t,-t,-t,1,-t,t,t,1,t,t,t,1,-t,-t,t,1,-t,-t,t,1,t,t,t,1,t,-t,t,1,-t,t,-t,1,-t,t,t,1,-t,-t,t,1,-t,t,-t,1,-t,-t,t,1,-t,-t,-t,1,t,t,t,1,t,t,-t,1,t,-t,t,1,t,-t,t,1,t,t,-t,1,t,-t,-t,1,t,t,t,1,-t,t,t,1,-t,t,-t,1,t,t,t,1,-t,t,-t,1,t,t,-t,1,-t,-t,t,1,t,-t,t,1,-t,-t,-t,1,-t,-t,-t,1,t,-t,t,1,t,-t,-t,1);for(var n=this.skyColor_[0],i=0,r=this.sphere.vertices;i<r;++i)this.colors.push(n.r,n.g,n.b,e)}else{if(this.skyColor_.length>this.skyAngle_.length){for(var o=[],i=0,s=this.skyAngle_.length;i<s;++i)o.push(this.skyAngle_[i]);(0===o.length||o[0]>0)&&o.unshift(0);var a=this.groundColor_.length>this.groundAngle_.length?Math.PI/2:Math.PI;o[o.length-1]<a&&o.push(a),this.buildSphere(1,o,this.skyAngle_,this.skyColor_,e,!1)}if(this.groundColor_.length>this.groundAngle_.length){for(var o=[],i=0,s=this.groundAngle_.length;i<s;++i)o.push(this.groundAngle_[i]);o.reverse(),(0===o.length||o[0]<Math.PI/2)&&o.unshift(Math.PI/2),o[o.length-1]>0&&o.push(0),this.buildSphere(1,o,this.groundAngle_,this.groundColor_,e,!0)}}this.transferSphere()}},buildSphere:function(e,t,n,i,r,o){for(var s=0,a=o?Math.PI/2:Math.PI,u=t.length-1,c=0;c<u;++c){var h=l.clamp(t[c],0,a),d=l.clamp(t[c+1],0,a);o&&(h=Math.PI-h,d=Math.PI-d),x.setPolar(e,h),v.setPolar(e,d);for(var p=this.getColor(t[c],i,n),f=this.getColor(t[c+1],i,n),g=0;g<20;++g){var m=g<19?g+1:0;s=2*Math.PI*(g/20),_.setPolar(-x.imag,s),S.setPolar(-v.imag,s),s=2*Math.PI*(m/20),C.setPolar(-v.imag,s),F.setPolar(-x.imag,s),this.colors.push(p.r,p.g,p.b,r,f.r,f.g,f.b,r,f.r,f.g,f.b,r,p.r,p.g,p.b,r,p.r,p.g,p.b,r,f.r,f.g,f.b,r),this.sphere.push(_.imag,x.real,_.real,1,C.imag,v.real,C.real,1,S.imag,v.real,S.real,1,_.imag,x.real,_.real,1,F.imag,x.real,F.real,1,C.imag,v.real,C.real,1)}}},transferSphere:function(){var e=this.getBrowser().getContext();e.bindBuffer(e.ARRAY_BUFFER,this.colorBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colors),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.sphereBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.sphere),e.STATIC_DRAW),this.sphereCount=this.sphere.length/4},transferRectangle:function(){var e=this.getBrowser().getContext();e.bindBuffer(e.ARRAY_BUFFER,this.texCoordBuffers[0]),e.bufferData(e.ARRAY_BUFFER,new Float32Array(p),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.frontBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(f),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.backBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(g),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.leftBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(m),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.rightBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(b),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.topBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(w),e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.bottomBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(y),e.STATIC_DRAW)},traverse:function(e,t){switch(e){case n.CAMERA:t.getLayer().getBackgrounds().push(this),this.transformationMatrix.assign(t.getModelViewMatrix().get());break;case n.DISPLAY:for(var i=t.getClipPlanes(),r=this.clipPlanes,o=0,s=i.length;o<s;++o)r[o]=i[o];r.length=i.length}},display:function(e,t){try{if(this.hidden)return;var n=e.getBrowser().getContext();n.disable(n.DEPTH_TEST),n.depthMask(!1),n.enable(n.CULL_FACE),n.frontFace(n.CCW);var i=-r.unProjectPointMatrix(0,0,.99999,N.assign(e.getProjectionMatrix().get()).inverse(),t,T).z,o=this.rotation,s=this.modelViewMatrix.assign(this.transformationMatrix);this.projectionMatrixArray.set(e.getProjectionMatrix().get()),s.multRight(e.getInverseCameraSpaceMatrix().get()),s.get(null,o),s.identity(),s.rotate(o),s.scale(this.scale.set(i,i,i)),this.modelViewMatrixArray.set(s),this.drawSphere(e),this.textures&&this.drawCube(e)}catch(e){}},drawSphere:function(e){var t=this.transparency_.getValue();if(!(t>=1)){var n=e.getBrowser(),i=n.getContext(),r=n.getBackgroundSphereShader();r.useProgram(i),r.setClipPlanes(i,this.clipPlanes),r.enableColorAttribute(i,this.colorBuffer),r.enableVertexAttribute(i,this.sphereBuffer),i.uniformMatrix4fv(r.x3d_ProjectionMatrix,!1,this.projectionMatrixArray),i.uniformMatrix4fv(r.x3d_ModelViewMatrix,!1,this.modelViewMatrixArray),t?i.enable(i.BLEND):i.disable(i.BLEND),i.drawArrays(i.TRIANGLES,0,this.sphereCount),r.disableColorAttribute(i)}},drawCube:function(e){var t=e.getBrowser(),n=t.getContext(),i=t.getGouraudShader();i.useProgram(n),i.setClipPlanes(n,this.clipPlanes),i.enableTexCoordAttribute(n,this.texCoordBuffers),n.uniform1i(i.x3d_FogType,0),n.uniform1i(i.x3d_ColorMaterial,!1),n.uniform1i(i.x3d_Lighting,!1),n.uniform1i(i.texturing,!0),n.uniform1i(i.x3d_TextureType,2),n.uniformMatrix4fv(i.x3d_TextureMatrix,!1,this.textureMatrixArray),n.uniformMatrix4fv(i.x3d_ProjectionMatrix,!1,this.projectionMatrixArray),n.uniformMatrix4fv(i.x3d_ModelViewMatrix,!1,this.modelViewMatrixArray),this.drawRectangle(n,i,this.frontTexture,this.frontBuffer),this.drawRectangle(n,i,this.backTexture,this.backBuffer),this.drawRectangle(n,i,this.leftTexture,this.leftBuffer),this.drawRectangle(n,i,this.rightTexture,this.rightBuffer),this.drawRectangle(n,i,this.topTexture,this.topBuffer),this.drawRectangle(n,i,this.bottomTexture,this.bottomBuffer),i.disableTexCoordAttribute(n)},drawRectangle:function(e,t,n,r){n&&n.checkLoadState()===i.COMPLETE_STATE&&(n.setShaderUniforms(e,t,0),n.transparent_.getValue()?e.enable(e.BLEND):e.disable(e.BLEND),t.enableVertexAttribute(e,r),e.drawArrays(e.TRIANGLES,0,this.rectangleCount))}}),c}),define("cobweb/Components/Texturing/X3DTextureNode",["jquery","cobweb/Fields","cobweb/Components/Shape/X3DAppearanceChildNode","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e){n.call(this,e),this.addType(i.X3DTextureNode),this.addChildObjects("transparent",new t.SFBool)}var o=["EXT_texture_filter_anisotropic","MOZ_EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"];return r.prototype=e.extend(Object.create(n.prototype),{constructor:r,initialize:function(){n.prototype.initialize.call(this);var e=this.getBrowser().getContext();this.texture=e.createTexture()},getTexture:function(){return this.texture},updateTextureProperties:function(e,t,n,i,r,s,a,u){var l=this.getBrowser().getContext();l.bindTexture(e,this.getTexture()),Math.max(i,r)<this.getBrowser().getMinTextureSize()&&!t?(l.texParameteri(e,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(e,l.TEXTURE_MAG_FILTER,l.NEAREST)):(n.generateMipMaps_.getValue()&&l.generateMipmap(e),l.texParameteri(e,l.TEXTURE_MIN_FILTER,l[n.getMinificationFilter()]),l.texParameteri(e,l.TEXTURE_MAG_FILTER,l[n.getMagnificationFilter()])),t?(l.texParameteri(e,l.TEXTURE_WRAP_S,l[n.getBoundaryModeS()]),l.texParameteri(e,l.TEXTURE_WRAP_T,l[n.getBoundaryModeT()])):(l.texParameteri(e,l.TEXTURE_WRAP_S,s?l.REPEAT:l.CLAMP_TO_EDGE),l.texParameteri(e,l.TEXTURE_WRAP_T,a?l.REPEAT:l.CLAMP_TO_EDGE));for(var c=0;c<o.length;++c){var h=l.getExtension(o[c]);if(h){l.texParameterf(e,h.TEXTURE_MAX_ANISOTROPY_EXT,n.anisotropicDegree_.getValue());break}}}}),r}),define("cobweb/Components/Texturing/X3DTexture2DNode",["jquery","cobweb/Fields","cobweb/Components/Texturing/X3DTextureNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r){function o(e){n.call(this,e),this.addType(r.X3DTexture2DNode),this.width=0,this.height=0,this.flipY=!1,this.data=null}var s=new Uint8Array([255,255,255,255]);return o.prototype=e.extend(Object.create(n.prototype),{constructor:o,initialize:function(){n.prototype.initialize.call(this);var e=this.getBrowser().getContext();this.target=e.TEXTURE_2D,this.repeatS_.addInterest("updateTextureProperties",this),this.repeatT_.addInterest("updateTextureProperties",this),this.textureProperties_.addInterest("set_textureProperties__",this),e.bindTexture(e.TEXTURE_2D,this.getTexture()),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,s),this.set_textureProperties__()},set_textureProperties__:function(){this.texturePropertiesNode&&this.texturePropertiesNode.removeInterest("updateTextureProperties",this),this.texturePropertiesNode=i(r.TextureProperties,this.textureProperties_),this.texturePropertiesNode||(this.texturePropertiesNode=this.getBrowser().getDefaultTextureProperties()),this.texturePropertiesNode.addInterest("updateTextureProperties",this),this.updateTextureProperties()},getTarget:function(){return this.target},getWidth:function(){return this.width},getHeight:function(){return this.height},getFlipY:function(){return this.flipY},getData:function(){return this.data},setTexture:function(e,t,n,i,r){try{this.transparent_=n,this.width=e,this.height=t,this.flipY=r,this.data=i;var o=this.getBrowser().getContext();o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,r),o.pixelStorei(o.UNPACK_ALIGNMENT,1),o.bindTexture(o.TEXTURE_2D,this.getTexture()),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,e,t,0,o.RGBA,o.UNSIGNED_BYTE,i),this.updateTextureProperties(),this.addNodeEvent()}catch(e){}},updateTexture:function(e,t){try{this.data=e;var n=this.getBrowser().getContext();n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t),n.bindTexture(n.TEXTURE_2D,this.getTexture()),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,e),this.texturePropertiesNode.generateMipMaps_.getValue()&&n.generateMipmap(n.TEXTURE_2D),this.addNodeEvent()}catch(e){}},updateTextureProperties:function(){var e=this.getBrowser().getContext();n.prototype.updateTextureProperties.call(this,e.TEXTURE_2D,this.textureProperties_.getValue(),this.texturePropertiesNode,this.width,this.height,this.repeatS_.getValue(),this.repeatT_.getValue(),!1)},clear:function(){this.setTexture(1,1,!1,s,!1)},resize:function(e,t,n,i,r){for(var o=new Uint8Array(i*r*4),s=i/t,a=r/n,u=0;u<r;++u)for(var l=Math.floor(u/a)*t,c=u*i,h=0;h<i;++h){var d=4*(l+Math.floor(h/s)),p=4*(c+h);o[p]=e[d],o[p+1]=e[d+1],o[p+2]=e[d+2],o[p+3]=e[d+3]}return o},setShaderUniforms:function(e,t,n){t.textureTypeArray[n]=2,e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,this.getTexture()),e.uniform1iv(t.x3d_TextureType,t.textureTypeArray)}}),o}),define("cobweb/Components/Texturing/ImageTexture",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTexture2DNode","cobweb/Components/Networking/X3DUrlObject","cobweb/Bits/X3DConstants","cobweb/Browser/Networking/urls","standard/Networking/URI","standard/Math/Algorithm","cobweb/DEBUG"],function(e,t,n,i,r,o,s,a,u,l,c){function h(e){r.call(this,e),o.call(this,e),this.addType(s.ImageTexture),this.urlStack=new t.MFString}return h.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:h,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"url",new t.MFString),new n(s.initializeOnly,"repeatS",new t.SFBool(!0)),new n(s.initializeOnly,"repeatT",new t.SFBool(!0)),new n(s.initializeOnly,"textureProperties",new t.SFNode)]),getTypeName:function(){return"ImageTexture"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.canvas=e("<canvas></canvas>"),this.image=e("<img></img>"),this.image.load(this.setImage.bind(this)),this.image.error(this.setError.bind(this)),this.image.bind("abort",this.setError.bind(this)),this.image[0].crossOrigin="Anonymous",this.requestAsyncLoad()},set_url__:function(){this.setLoadState(s.NOT_STARTED_STATE),this.requestAsyncLoad()},requestAsyncLoad:function(){this.checkLoadState()!==s.COMPLETE_STATE&&this.checkLoadState()!==s.IN_PROGRESS_STATE&&(this.setLoadState(s.IN_PROGRESS_STATE),this.urlStack.setValue(this.url_),this.loadNext())},loadNext:function(){if(0===this.urlStack.length)return this.clear(),void this.setLoadState(s.FAILED_STATE);this.URL=new u(this.urlStack.shift()),this.URL=this.getExecutionContext().getURL().transform(this.URL),this.image.attr("src",this.URL)},setError:function(){var e=this.URL.toString();c&&(this.URL.isLocal()||"localhost"===this.URL.host||e.match(a.fallbackExpression)||this.urlStack.unshift(a.fallbackUrl+e)),"data"!==this.URL.scheme&&console.warn("Error loading image:",this.URL.toString()),this.loadNext()},setImage:function(){c&&"data"!==this.URL.scheme&&console.info("Done loading image:",this.URL.toString());try{var e=this.image[0],t=e.width,n=e.height,i=this.canvas[0],r=i.getContext("2d");l.isPowerOfTwo(t)&&l.isPowerOfTwo(n)?(i.width=t,i.height=n,r.save(),r.translate(0,n),r.scale(1,-1),r.drawImage(e,0,0),r.restore()):(t=l.nextPowerOfTwo(t),n=l.nextPowerOfTwo(n),i.width=t,i.height=n,r.save(),r.translate(0,n),r.scale(1,-1),r.drawImage(e,0,0,e.width,e.height,0,0,t,n),r.restore());for(var o=r.getImageData(0,0,t,n).data,a=!0,u=3;u<o.length;u+=4)if(255!==o[u]){a=!1;break}setTimeout(function(){this.setTexture(t,n,!a,new Uint8Array(o),!1),this.setLoadState(s.COMPLETE_STATE)}.bind(this),16)}catch(e){console.log(e.message),this.setError()}}}),h}),define("cobweb/Components/EnvironmentalEffects/Background",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EnvironmentalEffects/X3DBackgroundNode","cobweb/Components/Texturing/ImageTexture","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.Background)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_bind",new t.SFBool),new n(s.inputOutput,"frontUrl",new t.MFString),new n(s.inputOutput,"backUrl",new t.MFString),new n(s.inputOutput,"leftUrl",new t.MFString),new n(s.inputOutput,"rightUrl",new t.MFString),new n(s.inputOutput,"topUrl",new t.MFString),new n(s.inputOutput,"bottomUrl",new t.MFString),new n(s.inputOutput,"skyAngle",new t.MFFloat),new n(s.inputOutput,"skyColor",new t.MFColor(new t.SFColor)),new n(s.inputOutput,"groundAngle",new t.MFFloat),new n(s.inputOutput,"groundColor",new t.MFColor),new n(s.inputOutput,"transparency",new t.SFFloat),new n(s.outputOnly,"isBound",new t.SFBool),new n(s.outputOnly,"bindTime",new t.SFTime)]),getTypeName:function(){return"Background"},getComponentName:function(){return"EnvironmentalEffects"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this);var e=new o(this.getExecutionContext()),t=new o(this.getExecutionContext()),n=new o(this.getExecutionContext()),i=new o(this.getExecutionContext()),s=new o(this.getExecutionContext()),a=new o(this.getExecutionContext()),u=this.getBrowser().getBackgroundTextureProperties();this.frontUrl_.addFieldInterest(e.url_),this.backUrl_.addFieldInterest(t.url_),this.leftUrl_.addFieldInterest(n.url_),this.rightUrl_.addFieldInterest(i.url_),this.topUrl_.addFieldInterest(s.url_),this.bottomUrl_.addFieldInterest(a.url_),e.url_=this.frontUrl_,t.url_=this.backUrl_,n.url_=this.leftUrl_,i.url_=this.rightUrl_,s.url_=this.topUrl_,a.url_=this.bottomUrl_,e.textureProperties_=u,t.textureProperties_=u,n.textureProperties_=u,i.textureProperties_=u,s.textureProperties_=u,a.textureProperties_=u,e.setup(),t.setup(),n.setup(),i.setup(),s.setup(),a.setup(),this.set_frontTexture__(e),this.set_backTexture__(t),this.set_leftTexture__(n),this.set_rightTexture__(i),this.set_topTexture__(s),this.set_bottomTexture__(a)}}),a}),define("cobweb/Components/Layering/X3DLayerNode",["jquery","cobweb/Components/Core/X3DNode","cobweb/Rendering/X3DRenderObject","cobweb/Components/Layering/X3DViewportNode","cobweb/Execution/BindableStack","cobweb/Execution/BindableList","cobweb/Components/Navigation/NavigationInfo","cobweb/Components/EnvironmentalEffects/Fog","cobweb/Components/EnvironmentalEffects/Background","cobweb/Bits/X3DCast","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Geometry/Camera","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f){function g(e,i,l){t.call(this,e),n.call(this,e),this.addType(h.X3DLayerNode),this.groupNode=l,this.currentViewport=null,this.defaultBackground=new u(e),this.defaultFog=new a(e),this.defaultNavigationInfo=new s(e),this.defaultViewpoint=i,this.backgroundStack=new r(e,this,this.defaultBackground),this.fogStack=new r(e,this,this.defaultFog),this.navigationInfoStack=new r(e,this,this.defaultNavigationInfo),this.viewpointStack=new r(e,this,this.defaultViewpoint),this.backgrounds=new o(e,this,this.defaultBackground),this.fogs=new o(e,this,this.defaultFog),this.navigationInfos=new o(e,this,this.defaultNavigationInfo),this.viewpoints=new o(e,this,this.defaultViewpoint),this.defaultBackground.setHidden(!0),this.defaultFog.setHidden(!0),this.collisionTime=0}var m=new f;return g.prototype=e.extend(Object.create(t.prototype),n.prototype,{constructor:g,layer0:!1,initialize:function(){t.prototype.initialize.call(this),n.prototype.initialize.call(this),this.groupNode.children_=this.children_,this.groupNode.setPrivate(!0),this.groupNode.setup(),this.defaultNavigationInfo.setup(),this.defaultBackground.setup(),this.defaultFog.setup(),this.defaultViewpoint.setup(),this.backgroundStack.setup(),this.fogStack.setup(),this.navigationInfoStack.setup(),this.viewpointStack.setup(),this.backgrounds.setup(),this.fogs.setup(),this.navigationInfos.setup(),this.viewpoints.setup(),this.viewport_.addInterest("set_viewport__",this),this.addChildren_.addFieldInterest(this.groupNode.addChildren_),this.removeChildren_.addFieldInterest(this.groupNode.removeChildren_),this.children_.addFieldInterest(this.groupNode.children_),this.set_viewport__()},isLayer0:function(e){this.layer0=e,this.defaultBackground.setHidden(!e)},getLayer:function(){return this},getGroup:function(){return this.groupNode},getViewport:function(){return this.currentViewport},getBackground:function(){return this.backgroundStack.top()},getFog:function(){return this.fogStack.top()},getNavigationInfo:function(){return this.navigationInfoStack.top()},getViewpoint:function(){return this.viewpointStack.top()},getBackgrounds:function(){return this.backgrounds},getFogs:function(){return this.fogs},getNavigationInfos:function(){return this.navigationInfos},getViewpoints:function(){return this.viewpoints},getUserViewpoints:function(){for(var e=[],t=0;t<this.viewpoints.get().length;++t){var n=this.viewpoints.get()[t];n.description_.length&&e.push(n)}return e},getBackgroundStack:function(){return this.backgroundStack},getFogStack:function(){return this.fogStack},getNavigationInfoStack:function(){return this.navigationInfoStack},getViewpointStack:function(){return this.viewpointStack},getBBox:function(e){return this.groupNode.getBBox(e)},set_viewport__:function(){this.currentViewport=l(h.X3DViewportNode,this.viewport_),this.currentViewport||(this.currentViewport=this.getBrowser().getDefaultViewport())},bind:function(e){this.traverse(c.CAMERA,this);var t=this.navigationInfos.getBound(),n=this.backgrounds.getBound(),i=this.fogs.getBound(),r=this.viewpoints.getBound(e);this.navigationInfoStack.forcePush(t),this.backgroundStack.forcePush(n),this.fogStack.forcePush(i),this.viewpointStack.forcePush(r),t.addLayer(this),n.addLayer(this),i.addLayer(this),r.addLayer(this),r.resetUserOffsets()},traverse:function(e,t){t=t||this;var n=this.getViewpoint();switch(this.getCameraSpaceMatrix().pushMatrix(n.getCameraSpaceMatrix()),this.getInverseCameraSpaceMatrix().pushMatrix(n.getInverseCameraSpaceMatrix()),this.getProjectionMatrix().pushMatrix(n.getProjectionMatrix(this)),e){case c.POINTER:this.pointer(e,t);break;case c.CAMERA:this.camera(e,t);break;case c.COLLISION:this.collision(e,t);break;case c.DEPTH:case c.DISPLAY:this.display(e,t)}this.getProjectionMatrix().pop(),this.getInverseCameraSpaceMatrix().pop(),this.getCameraSpaceMatrix().pop()},pointer:function(e,t){if(this.isPickable_.getValue()){var n=this.getBrowser(),i=this.currentViewport.getRectangle(n);if(n.getSelectedLayer()){if(n.getSelectedLayer()!==this)return}else if(!n.isPointerInRectangle(i))return;n.setHitRay(this.getProjectionMatrix().get(),i),this.getModelViewMatrix().pushMatrix(this.getInverseCameraSpaceMatrix().get()),this.currentViewport.push(this),this.groupNode.traverse(e,t),this.currentViewport.pop(this),this.getModelViewMatrix().pop()}},camera:function(e,t){this.getModelViewMatrix().pushMatrix(f.Identity),this.currentViewport.push(this),this.groupNode.traverse(e,t),this.currentViewport.pop(this),this.navigationInfos.update(),this.backgrounds.update(),this.fogs.update(),this.viewpoints.update(),this.getViewpoint().update(),this.getModelViewMatrix().pop()},collision:function(e,t){this.collisionTime=0;var n=this.getNavigationInfo(),i=n.getCollisionRadius(),r=n.getAvatarHeight(),o=Math.max(2*i,2*r);d.ortho(-o,o,-o,o,-o,o,m),this.getProjectionMatrix().pushMatrix(m),this.getModelViewMatrix().pushMatrix(this.getInverseCameraSpaceMatrix().get()),this.currentViewport.push(this),t.render(e,this.groupNode),this.currentViewport.pop(this),this.getModelViewMatrix().pop(),this.getProjectionMatrix().pop()},display:function(e,t){this.getNavigationInfo().enable(e,t),this.getModelViewMatrix().pushMatrix(this.getInverseCameraSpaceMatrix().get()),this.currentViewport.push(this),t.render(e,this.groupNode),this.currentViewport.pop(this),this.getModelViewMatrix().pop()}}),g}),define("cobweb/Components/Grouping/Group",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.Group)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(o.initializeOnly,"bboxCenter",new t.SFVec3f),new n(o.inputOnly,"addChildren",new t.MFNode),new n(o.inputOnly,"removeChildren",new t.MFNode),new n(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Group"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"}}),s}),define("cobweb/Components/Layering/Layer",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Layering/X3DLayerNode","cobweb/Components/Navigation/Viewpoint","cobweb/Components/Grouping/Group","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e,new o(e),new s(e)),this.addType(a.Layer)}return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"isPickable",new t.SFBool(!0)),new n(a.inputOutput,"viewport",new t.SFNode),new n(a.inputOnly,"addChildren",new t.MFNode),new n(a.inputOnly,"removeChildren",new t.MFNode),new n(a.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Layer"},getComponentName:function(){return"Layering"},getContainerField:function(){return"layers"}}),u}),define("cobweb/Components/Layering/LayerSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Components/Layering/Layer","cobweb/Bits/X3DCast","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(u.LayerSet),this.layerNodes=[new o(e)],this.layerNode0=this.layerNodes[0],this.activeLayerNode=null}return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(u.inputOutput,"metadata",new t.SFNode),new n(u.inputOutput,"activeLayer",new t.SFInt32),new n(u.inputOutput,"order",new t.MFInt32(0)),new n(u.inputOutput,"layers",new t.MFNode)]),getTypeName:function(){return"LayerSet"},getComponentName:function(){return"Layering"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.layerNode0.setPrivate(!0),this.layerNode0.setup(),this.layerNode0.isLayer0(!0),this.activeLayer_.addInterest("set_activeLayer",this),this.order_.addInterest("set_layers",this),this.layers_.addInterest("set_layers",this),this.set_layers()},getActiveLayer:function(){return this.activeLayerNode},setLayer0:function(e){this.layerNode0=e,this.set_layers()},getLayer0:function(){return this.layerNode0},getLayers:function(){return this.layerNodes},set_activeLayer:function(){if(0===this.activeLayer_.getValue())this.activeLayerNode!==this.layerNode0&&(this.activeLayerNode=this.layerNode0);else{var e=this.activeLayer_-1;e>=0&&e<this.layers_.length?this.activeLayerNode!==this.layers_[e].getValue()&&(this.activeLayerNode=s(u.X3DLayerNode,this.layers_[e])):null!==this.activeLayerNode&&(this.activeLayerNode=null)}},set_layers:function(){var e=this.layers_.getValue();this.layerNodes.length=0;for(var t=0;t<this.order_.length;++t){var n=this.order_[t];if(0===n)this.layerNodes.push(this.layerNode0);else if(--n>=0&&n<e.length){var i=s(u.X3DLayerNode,e[n]);i&&this.layerNodes.push(i)}}this.set_activeLayer()},bind:function(e){var t=this.layers_.getValue();this.layerNode0.bind(e);for(var n=0,i=t.length;n<i;++n){var r=s(u.X3DLayerNode,t[n]);r&&r.bind(e)}},traverse:function(e,t){var n=this.layerNodes;if(e===a.POINTER)for(var i=0,r=n.length;i<r;++i)this.getBrowser().setLayerNumber(i),n[i].traverse(e,t);else for(var i=0,r=n.length;i<r;++i)n[i].traverse(e,t)}}),l}),define("cobweb/Execution/World",["jquery","cobweb/Fields/SFNode","cobweb/Basic/X3DBaseNode","cobweb/Components/Layering/LayerSet","cobweb/Components/Layering/Layer","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){n.call(this,e),this.layerSet=new i(e),this.defaultLayerSet=this.layerSet,this.layer0=new r(e),this.addChildObjects("activeLayer",new t(this.layer0))}return a.prototype=e.extend(Object.create(n.prototype),{constructor:a,getTypeName:function(){return"World"},initialize:function(){n.prototype.initialize.call(this),this.layerSet.setPrivate(!0),this.layerSet.setup(),this.layerSet.setLayer0(this.layer0),this.layerSet.activeLayer_.addInterest("set_activeLayer",this),this.getExecutionContext().getRootNodes().addInterest("set_rootNodes",this),this.getExecutionContext().setup(),this.set_rootNodes(),this.layer0.setPrivate(!0),this.layer0.isLayer0(!0),this.layer0.setup(),this.bind()},getLayerSet:function(){return this.layerSet},getActiveLayer:function(){return this.activeLayer_.getValue()},set_rootNodes:function(){var e=this.layerSet;this.layerSet=this.defaultLayerSet;var t=this.getExecutionContext().getRootNodes();this.layer0.children_=t;for(var n=0;n<t.length;++n){var i=o(s.LayerSet,t[n]);i&&(i.setLayer0(this.layer0),this.layerSet=i)}this.layerSet!==e&&(e.activeLayer_.removeInterest("set_activeLayer",this),this.layerSet.activeLayer_.addInterest("set_activeLayer",this),this.set_activeLayer())},set_activeLayer:function(){this.activeLayer_=this.layerSet.getActiveLayer()},bind:function(){this.layerSet.bind(this.getExecutionContext().getURL().fragment)},traverse:function(e,t){this.layerSet.traverse(e,t)}}),a}),define("cobweb/Browser/X3DBrowserContext",["jquery","cobweb/Fields/SFTime","cobweb/Basic/X3DBaseNode","cobweb/Browser/Core/X3DCoreContext","cobweb/Routing/X3DRoutingContext","cobweb/Browser/Scripting/X3DScriptingContext","cobweb/Browser/Networking/X3DNetworkingContext","cobweb/Browser/Shaders/X3DShadersContext","cobweb/Browser/Shape/X3DShapeContext","cobweb/Browser/Rendering/X3DRenderingContext","cobweb/Browser/Geometry2D/X3DGeometry2DContext","cobweb/Browser/Geometry3D/X3DGeometry3DContext","cobweb/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext","cobweb/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext","cobweb/Browser/Navigation/X3DNavigationContext","cobweb/Browser/Layering/X3DLayeringContext","cobweb/Browser/Layout/X3DLayoutContext","cobweb/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext","cobweb/Browser/Lighting/X3DLightingContext","cobweb/Browser/Sound/X3DSoundContext","cobweb/Browser/Text/X3DTextContext","cobweb/Browser/Texturing/X3DTexturingContext","cobweb/Browser/Time/X3DTimeContext","cobweb/Browser/ParticleSystems/X3DParticleSystemsContext","cobweb/Execution/World","cobweb/Bits/TraverseType"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b,w,y,x,v,_,S,C,F){function T(e){n.call(this,this),r.call(this),i.call(this,e),o.call(this),s.call(this),a.call(this),u.call(this),l.call(this),c.call(this),h.call(this),d.call(this),p.call(this),f.call(this),g.call(this),m.call(this),b.call(this),w.call(this),y.call(this),x.call(this),v.call(this),_.call(this),S.call(this),this.addChildObjects("initialized",new t,"shutdown",new t,"prepareEvents",new t,"sensors",new t,"finished",new t),this.changedTime=0,this.renderCallback=this.traverse.bind(this),this.systemTime=0,this.systemStartTime=0,this.browserTime=0,this.pickingTime=0,this.cameraTime=0,this.collisionTime=0,this.displayTime=0}return T.prototype=e.extend(Object.create(n.prototype),r.prototype,i.prototype,o.prototype,s.prototype,a.prototype,u.prototype,l.prototype,c.prototype,h.prototype,d.prototype,p.prototype,f.prototype,g.prototype,m.prototype,b.prototype,w.prototype,y.prototype,x.prototype,v.prototype,_.prototype,S.prototype,{constructor:T,initialize:function(){n.prototype.initialize.call(this),r.prototype.initialize.call(this),i.prototype.initialize.call(this),o.prototype.initialize.call(this),s.prototype.initialize.call(this),a.prototype.initialize.call(this),u.prototype.initialize.call(this),l.prototype.initialize.call(this),c.prototype.initialize.call(this),h.prototype.initialize.call(this),d.prototype.initialize.call(this),p.prototype.initialize.call(this),f.prototype.initialize.call(this),g.prototype.initialize.call(this),m.prototype.initialize.call(this),b.prototype.initialize.call(this),w.prototype.initialize.call(this),y.prototype.initialize.call(this),x.prototype.initialize.call(this),v.prototype.initialize.call(this),_.prototype.initialize.call(this),S.prototype.initialize.call(this)},initialized:function(){return this.initialized_},shutdown:function(){return this.shutdown_},prepareEvents:function(){return this.prepareEvents_},sensors:function(){return this.sensors_},finished:function(){return this.finished_},getURL:function(){return this.getExecutionContext().getURL()},getBrowser:function(){return this},getWorld:function(){return this.world},setExecutionContext:function(e){this.world=new C(e),this.world.setup()},getExecutionContext:function(){return this.world.getExecutionContext()},addBrowserEvent:function(){this.changedTime!==this.getCurrentTime()&&(this.changedTime=this.getCurrentTime(),requestAnimationFrame(this.renderCallback))},traverse:function(e){var t=this.getContext(),n=performance.now();this.systemTime=n-this.systemStartTime,this.advanceTime(e),this.prepareEvents_.processInterests(),this.processEvents();var i=performance.now();this.world.traverse(F.CAMERA,null),this.cameraTime=performance.now()-i;var r=performance.now();this.getCollisionCount()&&this.world.traverse(F.COLLISION,null),this.collisionTime=performance.now()-r,this.sensors_.processInterests(),this.processEvents();var o=performance.now();t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.world.traverse(F.DISPLAY,null),this.displayTime=performance.now()-o,this.browserTime=performance.now()-n,this.systemStartTime=performance.now(),this.finished_.processInterests()}}),T}),define("cobweb/Configuration/ProfileInfo",["jquery"],function(e){function t(e,t,n,i){this.name=e,this.title=t,this.providerUrl=n,this.components=i,Object.preventExtensions(this),Object.freeze(this),Object.seal(this)}return e.extend(t.prototype,{constructor:t,toXMLStream:function(e){}}),t}),define("cobweb/Configuration/ProfileInfoArray",["jquery","cobweb/Configuration/X3DInfoArray"],function(e,t){function n(){return t.call(this)}return n.prototype=e.extend(Object.create(t.prototype),{constructor:n}),n}),define("cobweb/Configuration/SupportedProfiles",["jquery","cobweb/Configuration/ProfileInfo","cobweb/Configuration/ProfileInfoArray","cobweb/Configuration/ComponentInfoArray","cobweb/Browser/Networking/urls"],function(e,t,n,i,r){return function(e){function o(n,o,s){a.add(o,new t(o,n,r.povider,new i(e,s)))}var s=e.supportedComponents,a=new n;return o("Computer-Aided Design (CAD) interchange","CADInterchange",[s.Core,s.Networking,s.Grouping,s.Rendering,s.Shape,s.Lighting,s.Texturing,s.Navigation,s.Shaders,s.CADGeometry]),o("Core","Core",[s.Core]),o("Full","Full",[s.Core,s.Time,s.Networking,s.Grouping,s.Rendering,s.Shape,s.Geometry3D,s.Geometry2D,s.Text,s.Sound,s.Lighting,s.Texturing,s.Interpolation,s.PointingDeviceSensor,s.KeyDeviceSensor,s.EnvironmentalSensor,s.Navigation,s.EnvironmentalEffects,s.Geospatial,s["H-Anim"],s.NURBS,s.DIS,s.Scripting,s.EventUtilities,s.Shaders,s.CADGeometry,s.Texturing3D,s.CubeMapTexturing,s.Layering,s.Layout,s.RigidBodyPhysics,s.Picking,s.Followers,s.ParticleSystems]),o("Immersive","Immersive",[s.Core,s.Time,s.Networking,s.Grouping,s.Rendering,s.Shape,s.Geometry3D,s.Geometry2D,s.Text,s.Sound,s.Lighting,s.Texturing,s.Interpolation,s.PointingDeviceSensor,s.KeyDeviceSensor,s.EnvironmentalSensor,s.Navigation,s.EnvironmentalEffects,s.Scripting,s.EventUtilities]),o("Interactive","Interactive",[s.Core,s.Time,s.Networking,s.Grouping,s.Rendering,s.Shape,s.Geometry3D,s.Lighting,s.Texturing,s.Interpolation,s.PointingDeviceSensor,s.KeyDeviceSensor,s.EnvironmentalSensor,s.Navigation,s.EnvironmentalEffects,s.EventUtilities]),o("Interchange","Interchange",[s.Core,s.Time,s.Networking,s.Grouping,s.Rendering,s.Shape,s.Geometry3D,s.Lighting,s.Texturing,s.Interpolation,s.Navigation,s.EnvironmentalEffects]),o("MPEG-4 interactive","MPEG-4",[s.Core,s.Time,s.Networking,s.Grouping,s.Rendering,s.Shape,s.Geometry3D,s.Lighting,s.Texturing,s.Interpolation,s.PointingDeviceSensor,s.EnvironmentalSensor,s.Navigation,s.EnvironmentalEffects]),Object.preventExtensions(a),Object.freeze(a),Object.seal(a),a}}),define("cobweb/Configuration/SupportedComponents",["jquery","cobweb/Configuration/ComponentInfoArray","cobweb/Browser/Networking/urls"],function(e,t,n){return function(e){var i=new t(e);return i.addComponentInfo({title:"Computer-Aided Design (CAD) model geometry",name:"CADGeometry",level:2,providerUrl:n.provider}),i.addComponentInfo({title:"Core",name:"Core",level:2,providerUrl:n.provider}),i.addComponentInfo({title:"Cube map environmental texturing",name:"CubeMapTexturing",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Distributed interactive simulation (DIS)",name:"DIS",level:2,providerUrl:n.provider}),i.addComponentInfo({title:"Environmental effects",name:"EnvironmentalEffects",level:4,providerUrl:n.provider}),i.addComponentInfo({title:"Environmental sensor",name:"EnvironmentalSensor",level:4,providerUrl:n.provider}),i.addComponentInfo({title:"Event utilities",name:"EventUtilities",level:4,providerUrl:n.provider}),i.addComponentInfo({title:"Followers",name:"Followers",level:4,providerUrl:n.provider}),i.addComponentInfo({title:"Geometry2D",name:"Geometry2D",level:2,providerUrl:n.provider}),i.addComponentInfo({title:"Geometry3D",name:"Geometry3D",level:4,providerUrl:n.provider}),i.addComponentInfo({title:"Geospatial",name:"Geospatial",level:2,providerUrl:n.provider}),i.addComponentInfo({title:"Grouping",name:"Grouping",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Humanoid animation (H-Anim)",name:"H-Anim",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Interpolation",name:"Interpolation",level:5,providerUrl:n.provider}),i.addComponentInfo({title:"Key device sensor",name:"KeyDeviceSensor",level:2,providerUrl:n.provider}),i.addComponentInfo({title:"Layering",name:"Layering",level:1,providerUrl:n.provider}),i.addComponentInfo({title:"Layout",name:"Layout",level:1,providerUrl:n.provider}),i.addComponentInfo({title:"Lighting",name:"Lighting",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Navigation",name:"Navigation",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Networking",name:"Networking",level:4,providerUrl:n.provider}),i.addComponentInfo({title:"Non-uniform Rational B-Spline (NURBS)",name:"NURBS",level:4,providerUrl:n.provider}),i.addComponentInfo({title:"Particle systems",name:"ParticleSystems",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Picking sensor",name:"Picking",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Pointing device sensor",name:"PointingDeviceSensor",level:1,providerUrl:n.provider}),i.addComponentInfo({title:"Programmable shaders",name:"Shaders",level:1,providerUrl:n.provider}),i.addComponentInfo({title:"Rendering",name:"Rendering",level:5,providerUrl:n.provider}),i.addComponentInfo({title:"Rigid body physics",name:"RigidBodyPhysics",level:5,providerUrl:n.provider}),i.addComponentInfo({title:"Scripting",name:"Scripting",level:1,providerUrl:n.provider}),i.addComponentInfo({title:"Shape",name:"Shape",level:4,providerUrl:n.provider}),i.addComponentInfo({title:"Sound",name:"Sound",level:1,providerUrl:n.provider}),i.addComponentInfo({title:"Text",name:"Text",level:1,providerUrl:n.provider}),i.addComponentInfo({title:"Texturing",name:"Texturing",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Texturing3D",name:"Texturing3D",level:3,providerUrl:n.provider}),i.addComponentInfo({title:"Time",name:"Time",level:2,providerUrl:n.provider}),i.addComponentInfo({title:"Volume rendering",name:"VolumeRendering",level:2,providerUrl:n.provider}),i.addComponentInfo({title:"Cobweb",name:"Cobweb",level:1,providerUrl:n.provider}),Object.preventExtensions(i),Object.freeze(i),Object.seal(i),i}}),define("cobweb/Browser/PointingDeviceSensor/PointingDeviceSensorContainer",["jquery","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4"],function(e,t,n){function i(e,i,r,o){this.node=null,this.modelViewMatrix=new n,this.projectionMatrix=new n,this.viewport=new t(0,0,0,0),this.set(e,i,r,o)}return i.prototype={set:function(e,t,n,i){this.node=e,this.modelViewMatrix.assign(t),this.projectionMatrix.assign(n),this.viewport.assign(i)},set_over__:function(e,t){this.node.set_over__(e,t,this.modelViewMatrix,this.projectionMatrix,this.viewport)},set_active__:function(e,t){this.node.set_active__(e,t,this.modelViewMatrix,this.projectionMatrix,this.viewport)},set_motion__:function(e){this.node.set_motion__(e,this.modelViewMatrix,this.projectionMatrix,this.viewport)}},i}),define("cobweb/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode",["jquery","cobweb/Components/Core/X3DSensorNode","cobweb/Browser/PointingDeviceSensor/PointingDeviceSensorContainer","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e){t.call(this,e),this.addType(i.X3DPointingDeviceSensorNode)}return r.prototype=e.extend(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this)},getMatrices:function(){return this.matrices},set_enabled__:function(){this.enabled_.getValue()||(this.isActive_.getValue()&&(this.isActive_=!1),this.isOver_.getValue()&&(this.isOver_=!1))},set_over__:function(e,t){e!==this.isOver_.getValue()&&(this.isOver_=e,this.isOver_.getValue()&&(this.getBrowser().getNotification().string_=this.description_))},set_active__:function(e,t){e!==this.isActive_.getValue()&&(this.isActive_=e)},set_motion__:function(e){},push:function(e,t){this.enabled_.getValue()&&(t[this.getId()]=new n(this,e.getModelViewMatrix().get(),e.getProjectionMatrix().get(),e.getViewVolume().getViewport()))}}),r}),define("cobweb/Components/PointingDeviceSensor/X3DTouchSensorNode",["jquery","cobweb/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DTouchSensorNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,set_active__:function(e,n){t.prototype.set_active__.call(this,e,n),this.enabled_.getValue()&&this.isOver_.getValue()&&!e&&(this.touchTime_=this.getBrowser().getCurrentTime())}}),i}),define("cobweb/Components/PointingDeviceSensor/TouchSensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/PointingDeviceSensor/X3DTouchSensorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.TouchSensor)}var u=new s;return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"description",new t.SFString),new n(o.outputOnly,"hitTexCoord_changed",new t.SFVec2f),new n(o.outputOnly,"hitNormal_changed",new t.SFVec3f),new n(o.outputOnly,"hitPoint_changed",new t.SFVec3f),new n(o.outputOnly,"isOver",new t.SFBool),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"touchTime",new t.SFTime)]),getTypeName:function(){return"TouchSensor"},getComponentName:function(){return"PointingDeviceSensor"},getContainerField:function(){return"children"},set_over__:function(e,t,n,i,o){try{if(r.prototype.set_over__.call(this,e,t,n,i,o),this.isOver_.getValue()){var s=t.intersection;u.assign(n).inverse(),this.hitTexCoord_changed_=s.texCoord,this.hitNormal_changed_=n.multMatrixDir(s.normal.copy()).normalize(),this.hitPoint_changed_=u.multVecMatrix(s.point.copy())}}catch(e){console.log(e)}}}),a}),define("cobweb/Components/Networking/Anchor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Components/Networking/X3DUrlObject","cobweb/Components/PointingDeviceSensor/TouchSensor","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","cobweb/InputOutput/FileLoader"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),o.call(this,e),this.addType(u.Anchor),this.touchSensorNode=new s(e)}return c.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:c,fieldDefinitions:new i([new n(u.inputOutput,"metadata",new t.SFNode),new n(u.inputOutput,"description",new t.SFString),new n(u.inputOutput,"url",new t.MFString),new n(u.inputOutput,"parameter",new t.MFString),new n(u.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(u.initializeOnly,"bboxCenter",new t.SFVec3f),new n(u.inputOnly,"addChildren",new t.MFNode),new n(u.inputOnly,"removeChildren",new t.MFNode),new n(u.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Anchor"},getComponentName:function(){return"Networking"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.description_.addFieldInterest(this.touchSensorNode.description_),this.touchSensorNode.description_=this.description_,this.touchSensorNode.setup();var e=this,t=this.touchSensorNode.set_active__;this.touchSensorNode.set_active__=function(n,i){t.call(this,n,i),this.isOver_.getValue()&&!n&&e.requestAsyncLoad()}},requestAsyncLoad:function(){this.setLoadState(u.IN_PROGRESS_STATE,!1),new l(this).createX3DFromURL(this.url_,this.parameter_,function(e){e?(this.getBrowser().replaceWorld(e),this.setLoadState(u.COMPLETE_STATE,!1)):this.setLoadState(u.FAILED_STATE,!1)}.bind(this),function(e){try{this.getExecutionContext().changeViewpoint(e)}catch(e){}this.setLoadState(u.COMPLETE_STATE,!1)}.bind(this),function(e,t){t?window.open(e,t):location=e,this.setLoadState(u.COMPLETE_STATE,!1)}.bind(this))},traverse:function(e,t){if(e===a.POINTER){var n={};t.getBrowser().getSensors().push(n),this.touchSensorNode.push(t,n),r.prototype.traverse.call(this,e,t),t.getBrowser().getSensors().pop()}else r.prototype.traverse.call(this,e,t)}}),c}),define("cobweb/Components/Rendering/X3DLineGeometryNode",["jquery","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(e,t,n,i){function r(e){t.call(this,e)}return r.prototype=e.extend(Object.create(t.prototype),{constructor:r,getShader:function(e){return e.getLineShader()},intersectsLine:function(e,t,n,i){return!1},intersectsBox:function(e,t,n){return!1},display:function(e){try{var t=e.renderer.getBrowser(),n=t.getContext(),i=e.shaderNode,r=this.attribNodes,o=this.attribBuffers;i===t.getDefaultShader()&&(i=this.getShader(t)),e.geometryType=this.getGeometryType(),e.colorMaterial=this.getColors().length,i.setLocalUniforms(n,e);for(var s=0,a=r.length;s<a;++s)r[s].enable(n,i,o[s]);this.colors.length&&i.enableColorAttribute(n,this.colorBuffer),i.enableVertexAttribute(n,this.vertexBuffer),n.drawArrays(i.primitiveMode===n.POINTS?n.POINTS:this.primitiveMode,0,this.vertexCount);for(var s=0,a=r.length;s<a;++s)r[s].disable(n,i);i.disableColorAttribute(n)}catch(e){console.log(e)}},displayParticles:function(e,t,n){try{var r=e.renderer.getBrowser(),o=r.getContext(),s=e.shaderNode,a=this.attribNodes,u=this.attribBuffers;s===r.getDefaultShader()&&(s=this.getShader(r)),e.geometryType=this.getGeometryType(),e.colorMaterial=this.colors.length,s.setLocalUniforms(o,e);for(var l=0,c=a.length;l<c;++l)a[l].enable(o,s,u[l]);this.colors.length&&s.enableColorAttribute(o,this.colorBuffer),s.enableVertexAttribute(o,this.vertexBuffer);for(var h=e.modelViewMatrix,d=h[12],p=h[13],f=h[14],g=s.primitiveMode===o.POINTS?o.POINTS:this.primitiveMode,m=0;m<n;++m)h[12]=d,h[13]=p,h[14]=f,i.prototype.translate.call(h,t[m].position),o.uniformMatrix4fv(s.x3d_ModelViewMatrix,!1,h),o.drawArrays(g,0,this.vertexCount);for(var l=0,c=a.length;l<c;++l)a[l].disable(o,s);s.disableColorAttribute(o)}catch(e){console.log(e)}}}),r}),define("cobweb/Components/Geometry2D/Arc2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DLineGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(o.Arc2D),this.setGeometryType(1)}return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"startAngle",new t.SFFloat),new n(o.inputOutput,"endAngle",new t.SFFloat(1.5708)),new n(o.initializeOnly,"radius",new t.SFFloat(1))]),getTypeName:function(){return"Arc2D"},getComponentName:function(){return"Geometry2D"},getContainerField:function(){return"geometry"},set_live__:function(){r.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getArc2DOptions().addInterest("eventsProcessed",this):this.getBrowser().getArc2DOptions().removeInterest("eventsProcessed",this)},getSweepAngle:function(){var e=u.interval(this.startAngle_.getValue(),0,2*Math.PI),t=u.interval(this.endAngle_.getValue(),0,2*Math.PI);if(e===t)return 2*Math.PI;var n=Math.abs(t-e);return e>t?2*Math.PI-n:isNaN(n)?0:n},build:function(){var e=this.getBrowser().getContext(),t=this.getBrowser().getArc2DOptions().dimension_.getValue(),n=this.startAngle_.getValue(),i=Math.abs(this.radius_.getValue()),r=this.getSweepAngle(),o=r==2*Math.PI,a=Math.floor(r*t/(2*Math.PI)),u=this.getVertices();a=Math.max(3,a),o?this.setPrimitiveMode(e.LINE_LOOP):(++a,this.setPrimitiveMode(e.LINE_STRIP));for(var l=o?a:a-1,c=0;c<a;++c){var h=n+r*(c/l),d=s.Polar(i,h);u.push(d.real,d.imag,0,1)}this.getMin().set(-i,-i,0),this.getMax().set(i,i,0),this.setSolid(!1)}}),l}),define("cobweb/Components/Geometry2D/ArcClose2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(o.ArcClose2D),this.setGeometryType(2)}var c=new s(.5,.5);return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"closureType",new t.SFString("PIE")),new n(o.inputOutput,"startAngle",new t.SFFloat),new n(o.inputOutput,"endAngle",new t.SFFloat(1.5708)),new n(o.initializeOnly,"radius",new t.SFFloat(1)),new n(o.initializeOnly,"solid",new t.SFBool)]),getTypeName:function(){return"ArcClose2D"},getComponentName:function(){return"Geometry2D"},getContainerField:function(){return"geometry"},set_live__:function(){r.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getArcClose2DOptions().addInterest("eventsProcessed",this):this.getBrowser().getArcClose2DOptions().removeInterest("eventsProcessed",this)},getSweepAngle:function(){var e=u.interval(this.startAngle_.getValue(),0,2*Math.PI),t=u.interval(this.endAngle_.getValue(),0,2*Math.PI);if(e===t)return 2*Math.PI;var n=Math.abs(t-e);return e>t?2*Math.PI-n:isNaN(n)?0:n},build:function(){var e=this.getBrowser().getArcClose2DOptions(),t="CHORD"===this.closureType_.getValue(),n=e.dimension_.getValue(),i=this.startAngle_.getValue(),r=Math.abs(this.radius_.getValue()),o=this.getSweepAngle(),a=(Math.PI,Math.max(4,Math.floor(o*n/(2*Math.PI)))),u=[],l=this.getNormals(),h=this.getVertices(),d=[],p=[];this.getTexCoords().push(u);for(var f=a-1,g=0;g<a;++g){var m=i+o*(g/f);d.push(s.Polar(.5,m).add(c)),p.push(s.Polar(r,m))}if(t)for(var b=d[0],w=p[0],y=1;y<f;++y){var x=d[y],v=d[y+1],_=p[y],S=p[y+1];u.push(b.real,b.imag,0,1,x.real,x.imag,0,1,v.real,v.imag,0,1),l.push(0,0,1,0,0,1,0,0,1),h.push(w.real,w.imag,0,1,_.real,_.imag,0,1,S.real,S.imag,0,1)}else for(y=0;y<f;++y){var x=d[y],v=d[y+1],_=p[y],S=p[y+1];u.push(.5,.5,0,1,x.real,x.imag,0,1,v.real,v.imag,0,1),l.push(0,0,1,0,0,1,0,0,1),h.push(0,0,0,1,_.real,_.imag,0,1,S.real,S.imag,0,1)}this.getMin().set(-r,-r,0),this.getMax().set(r,r,0),this.setSolid(this.solid_.getValue())}}),l}),define("cobweb/Components/Sound/X3DSoundSourceNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Components/Time/X3DTimeDependentNode","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e){t.call(this,e),n.call(this,e),this.addType(i.X3DSoundSourceNode),this.volume=0,this.media=null}return r.prototype=e.extend(Object.create(t.prototype),n.prototype,{constructor:r,initialize:function(){t.prototype.initialize.call(this),n.prototype.initialize.call(this)},set_browser_live__:function(){n.prototype.set_browser_live__.call(this),this.getDisabled()?(this.getBrowser().volume_.removeInterest("set_volume__",this),this.getBrowser().mute_.removeInterest("set_volume__",this)):(this.getBrowser().volume_.addInterest("set_volume__",this),this.getBrowser().mute_.addInterest("set_volume__",this),this.set_volume__())},setMedia:function(e){if(this.media&&(this.media[0].volume=0,this.media[0].pause(),this.media.unbind("ended")),this.media=e,e){var t=e[0];this.setVolume(0),this.duration_changed_=t.duration,this.enabled_.getValue()&&this.isActive_.getValue()&&(this.loop_.getValue()?t.currentTime=this.getElapsedTime()%t.duration:t.currentTime=this.getElapsedTime(),this.isPaused_.getValue()||this.speed_.getValue()&&t.play())}},getMedia:function(){return this.media},setVolume:function(e){this.volume=e,this.set_volume__()},set_volume__:function(){this.media&&(this.media[0].volume=!this.getBrowser().mute_.getValue()*this.getBrowser().volume_.getValue()*this.volume)},set_speed:function(){},set_pitch:function(){},set_start:function(){this.media&&this.speed_.getValue()&&(this.media[0].currentTime=0,this.media[0].play())},set_pause:function(){this.media&&(this.media.unbind("ended"),this.media[0].pause())},set_resume:function(){this.media&&this.speed_.getValue()&&this.media[0].play()},set_stop:function(){this.media&&(this.media.unbind("ended"),this.media[0].pause())},set_ended:function(){if(this.media){var e=this.media[0];if(e.currentTime<e.duration)return;this.loop_.getValue()?(this.speed_.getValue()&&e.play(),this.elapsedTime_=this.getElapsedTime(),this.cycleTime_=this.getBrowser().getCurrentTime()):this.stop()}},prepareEvents:function(){this.set_ended(),this.elapsedTime_=this.getElapsedTime()}}),r}),define("cobweb/Components/Sound/AudioClip",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Sound/X3DSoundSourceNode","cobweb/Components/Networking/X3DUrlObject","cobweb/Bits/X3DConstants","cobweb/Browser/Networking/urls","standard/Networking/URI","cobweb/DEBUG"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),o.call(this,e),this.addType(s.AudioClip),this.urlStack=new t.MFString}return c.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:c,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"enabled",new t.SFBool(!0)),new n(s.inputOutput,"description",new t.SFString),new n(s.inputOutput,"url",new t.MFString),new n(s.inputOutput,"speed",new t.SFFloat(1)),new n(s.inputOutput,"pitch",new t.SFFloat(1)),new n(s.inputOutput,"loop",new t.SFBool),new n(s.inputOutput,"startTime",new t.SFTime),new n(s.inputOutput,"resumeTime",new t.SFTime),new n(s.inputOutput,"pauseTime",new t.SFTime),new n(s.inputOutput,"stopTime",new t.SFTime),new n(s.outputOnly,"isPaused",new t.SFBool),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"cycleTime",new t.SFTime),new n(s.outputOnly,"elapsedTime",new t.SFTime),new n(s.outputOnly,"duration_changed",new t.SFTime(-1))]),getTypeName:function(){return"AudioClip"},getComponentName:function(){return"Sound"},getContainerField:function(){return"source"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.audio=e("<audio></audio>"),this.audio.error(this.setError.bind(this)),this.audio.bind("abort",this.setError.bind(this)),this.audio[0].preload="auto",this.audio[0].volume=0,this.audio[0].crossOrigin="Anonymous",this.requestAsyncLoad()},set_url__:function(){this.setLoadState(s.NOT_STARTED_STATE),this.requestAsyncLoad()},requestAsyncLoad:function(){this.checkLoadState()!==s.COMPLETE_STATE&&this.checkLoadState()!==s.IN_PROGRESS_STATE&&(this.setLoadState(s.IN_PROGRESS_STATE),this.setMedia(null),this.urlStack.setValue(this.url_),this.audio.bind("canplaythrough",this.setAudio.bind(this)),this.loadNext())},loadNext:function(){if(0===this.urlStack.length)return this.duration_changed_=-1,void this.setLoadState(s.FAILED_STATE);this.URL=new u(this.urlStack.shift()),this.URL=this.getExecutionContext().getURL().transform(this.URL),this.audio.attr("src",this.URL)},setError:function(){var e=this.URL.toString();l&&(this.URL.isLocal()||"localhost"===this.URL.host||e.match(a.fallbackExpression)||this.urlStack.unshift(a.fallbackUrl+e)),"data"!==this.URL.scheme&&console.warn("Error loading audio:",this.URL.toString()),this.loadNext()},setAudio:function(){l&&"data"!==this.URL.scheme&&console.info("Done loading audio:",this.URL.toString()),this.audio.unbind("canplaythrough"),this.setMedia(this.audio),this.setLoadState(s.COMPLETE_STATE)}}),c}),define("cobweb/Components/Navigation/Billboard",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DConstants","cobweb/Bits/TraverseType","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(o.Billboard),this.matrix=new l}var h=new l,d=new a(0,1,0),p=new a(0,0,1),f=new a(0,0,0),g=new a(0,0,0),m=new a(0,0,0),b=new a(0,0,0),w=new a(0,0,0),y=new u(0,0,1,0);return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"axisOfRotation",new t.SFVec3f(0,1,0)),new n(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(o.initializeOnly,"bboxCenter",new t.SFVec3f),new n(o.inputOnly,"addChildren",new t.MFNode),new n(o.inputOnly,"removeChildren",new t.MFNode),new n(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Billboard"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},getBBox:function(e){return r.prototype.getBBox.call(this,e).multRight(this.matrix)},getMatrix:function(){return this.matrix},rotate:function(e){h.assign(e).inverse();var t=h.origin.normalize();if(this.axisOfRotation_.getValue().equals(a.Zero)){h.multDirMatrix(f.assign(d)).normalize(),g.assign(f).cross(t),m.assign(t).cross(g);var n=t;g.normalize(),m.normalize(),this.matrix.set(g[0],g[1],g[2],0,m[0],m[1],m[2],0,n[0],n[1],n[2],0,0,0,0,1)}else b.assign(this.axisOfRotation_.getValue()).cross(t),w.assign(this.axisOfRotation_.getValue()).cross(p),this.matrix.setRotation(y.setFromToVec(w,b));return this.matrix},traverse:function(e,t){var n=t.getModelViewMatrix();n.push();try{switch(e){case s.CAMERA:case s.DEPTH:n.multLeft(this.matrix);break;default:n.multLeft(this.rotate(n.get()))}r.prototype.traverse.call(this,e,t)}catch(e){console.log(e)}n.pop()}}),c}),define("cobweb/Components/EventUtilities/BooleanFilter",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.BooleanFilter)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_boolean",new t.SFBool),new n(o.outputOnly,"inputTrue",new t.SFBool),new n(o.outputOnly,"inputFalse",new t.SFBool),new n(o.outputOnly,"inputNegate",new t.SFBool)]),getTypeName:function(){return"BooleanFilter"},getComponentName:function(){return"EventUtilities"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.set_boolean_.addInterest("set_boolean__",this)},set_boolean__:function(){var e=this.set_boolean_.getValue();e?this.inputTrue_=!0:this.inputFalse_=!0,this.inputNegate_=!e}}),s}),define("cobweb/Components/EventUtilities/X3DSequencerNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i){function r(e){t.call(this,e),this.addType(n.X3DSequencerNode),this.index=-1}return r.prototype=e.extend(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.set_fraction_.addInterest("set_fraction__",this),this.previous_.addInterest("set_previous__",this),this.next_.addInterest("set_next__",this),this.key_.addInterest("set_index__",this)},set_fraction__:function(){var e=this.set_fraction_.getValue(),t=this.key_,n=t.length;if(0!==n){var r=0;(r=1===n||e<=t[0]?0:e>=t[n-1]?this.getSize()-1:i.upperBound(t,0,n,e,i.less)-1)!==this.index&&r<this.getSize()&&this.sequence(this.index=r)}},set_previous__:function(){this.previous_.getValue()&&(this.index<=0?this.index=this.getSize()-1:--this.index,this.index<this.getSize()&&this.sequence(this.index))},set_next__:function(){this.next_.getValue()&&(this.index>=this.getSize()-1?this.index=0:++this.index,this.index<this.getSize()&&this.sequence(this.index))},set_index__:function(){this.index=-1}}),r}),define("cobweb/Components/EventUtilities/BooleanSequencer",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EventUtilities/X3DSequencerNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.BooleanSequencer)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOnly,"previous",new t.SFBool),new n(o.inputOnly,"next",new t.SFBool),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFBool),new n(o.outputOnly,"value_changed",new t.SFBool)]),getTypeName:function(){return"BooleanSequencer"},getComponentName:function(){return"EventUtilities"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_index__",this)},getSize:function(){return this.keyValue_.length},sequence:function(e){this.value_changed_=this.keyValue_[e]}}),s}),define("cobweb/Components/EventUtilities/BooleanToggle",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.BooleanToggle)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_boolean",new t.SFBool),new n(o.inputOutput,"toggle",new t.SFBool)]),getTypeName:function(){return"BooleanToggle"},getComponentName:function(){return"EventUtilities"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.set_boolean_.addInterest("set_boolean__",this)},set_boolean__:function(){this.set_boolean_.getValue()&&(this.toggle_=!this.toggle_.getValue())}}),s}),define("cobweb/Components/EventUtilities/X3DTriggerNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DTriggerNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/EventUtilities/BooleanTrigger",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EventUtilities/X3DTriggerNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.BooleanTrigger)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_triggerTime",new t.SFTime),new n(o.outputOnly,"triggerTrue",new t.SFBool)]),getTypeName:function(){return"BooleanTrigger"},getComponentName:function(){return"EventUtilities"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.set_triggerTime_.addInterest("set_triggerTime__",this)},set_triggerTime__:function(){this.triggerTrue_=!0}}),s}),define("cobweb/Components/ParticleSystems/X3DParticlePhysicsModelNode",["jquery","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DParticlePhysicsModelNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,addForce:function(){}}),i}),define("cobweb/Components/ParticleSystems/BoundedPhysicsModel",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticlePhysicsModelNode","cobweb/Bits/X3DConstants","cobweb/Bits/X3DCast"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.BoundedPhysicsModel)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"geometry",new t.SFNode)]),getTypeName:function(){return"BoundedPhysicsModel"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"physics"},initialize:function(){r.prototype.initialize.call(this),this.geometry_.addInterest("set_geometry__",this),this.set_geometry__()},set_geometry__:function(){this.geometryNode&&this.geometryNode.removeInterest("addNodeEvent",this),this.geometryNode=s(o.X3DGeometryNode,this.geometry_),this.geometryNode&&this.geometryNode.addInterest("addNodeEvent",this)},addGeometry:function(e,t){if(this.geometryNode){for(var n=this.geometryNode.getNormals(),i=this.geometryNode.getVertices(),r=0,o=n.length;r<o;++r)e.push(n[r]);for(var r=0,o=i.length;r<o;++r)t.push(i[r])}}}),a}),define("cobweb/Components/Geometry3D/Box",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.Box)}var u=new s(2,2,2);return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"size",new t.SFVec3f(2,2,2)),new n(o.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Box"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},build:function(){var e=this.getBrowser().getBoxOptions().getGeometry(),t=this.size_.getValue();if(this.setNormals(e.getNormals()),this.setTexCoords(e.getTexCoords()),t.equals(u))this.setVertices(e.getVertices()),this.getMin().assign(e.getMin()),this.getMax().assign(e.getMax());else{for(var n=s.divide(t,2),i=n.x,r=n.y,o=n.z,a=e.getVertices(),l=this.getVertices(),c=0;c<a.length;c+=4)l.push(i*a[c],r*a[c+1],o*a[c+2],1);i=Math.abs(i),r=Math.abs(r),o=Math.abs(o),this.getMin().set(-i,-r,-o),this.getMax().set(i,r,o)}this.setSolid(this.solid_.getValue())}}),a}),define("cobweb/Components/CADGeometry/X3DProductStructureChildNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DProductStructureChildNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/CADGeometry/CADAssembly",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Components/CADGeometry/X3DProductStructureChildNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.CADAssembly)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"name",new t.SFString),new n(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(s.initializeOnly,"bboxCenter",new t.SFVec3f),new n(s.inputOnly,"addChildren",new t.MFNode),new n(s.inputOnly,"removeChildren",new t.MFNode),new n(s.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"CADAssembly"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"}}),a}),define("cobweb/Components/CADGeometry/CADFace",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/CADGeometry/X3DProductStructureChildNode","cobweb/Components/Grouping/X3DBoundedObject","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),o.call(this,e),this.addType(a.CADFace),this.shapeNode=null}return u.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:u,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"name",new t.SFString),new n(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(a.initializeOnly,"bboxCenter",new t.SFVec3f),new n(a.inputOutput,"shape",new t.SFNode)]),getTypeName:function(){return"CADFace"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.shape_.addInterest("set_shape__",this),this.set_shape__()},getBBox:function(e){if(this.bboxSize_.getValue().equals(this.defaultBBoxSize)){var t=s(a.X3DBoundedObject,this.shape_);return t?t.getBBox(e):e.set()}return e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},set_shape__:function(){this.shapeNode&&this.shapeNode.isCameraObject_.removeFieldInterest(this.isCameraObject_),this.shapeNode=null;try{for(var e=this.shape_.getValue().getInnerNode(),t=e.getType(),n=t.length-1;n>=0;--n)switch(t[n]){case a.LOD:case a.Transform:case a.X3DShapeNode:e.isCameraObject_.addFieldInterest(this.isCameraObject_),this.shapeNode=e;break;default:continue}}catch(e){}this.shapeNode?delete this.traverse:this.traverse=Function.prototype},traverse:function(e,t){this.shapeNode.traverse(e,t)}}),u}),define("cobweb/Components/CADGeometry/CADLayer",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.CADLayer)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"name",new t.SFString),new n(o.inputOutput,"visible",new t.MFBool),new n(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(o.initializeOnly,"bboxCenter",new t.SFVec3f),new n(o.inputOnly,"addChildren",new t.MFNode),new n(o.inputOnly,"removeChildren",new t.MFNode),new n(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"CADLayer"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.visible_.addInterest("set_children__",this)},getVisible:function(){return this.visible_}}),s}),define("cobweb/Components/Grouping/X3DTransformMatrix3DNode",["jquery","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o){function s(e){t.call(this,e),this.addType(n.X3DTransformMatrix3DNode),this.matrix=new o}return s.prototype=e.extend(Object.create(t.prototype),{constructor:s,getBBox:function(e){var e=t.prototype.getBBox.call(this,e);return this.traverse===s.prototype.traverse?e.multRight(this.matrix):e},setMatrix:function(e){e.equals(o.Identity)?(this.matrix.identity(),this.traverse=t.prototype.traverse):(this.matrix.assign(e),delete this.traverse)},getMatrix:function(){return this.matrix},setTransform:function(e,n,o,s,a){e.equals(i.Zero)&&n.equals(r.Identity)&&o.equals(i.One)?(this.matrix.identity(),this.traverse=t.prototype.traverse):(this.matrix.set(e,n,o,s,a),delete this.traverse)},traverse:function(e,n){var i=n.getModelViewMatrix();i.push(),i.multLeft(this.matrix),t.prototype.traverse.call(this,e,n),i.pop()}}),s}),define("cobweb/Components/Grouping/X3DTransformNode",["jquery","cobweb/Components/Grouping/X3DTransformMatrix3DNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DTransformNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed:function(){t.prototype.eventsProcessed.call(this),this.setHidden(0===this.scale_.x||0===this.scale_.y||0===this.scale_.z),this.setTransform(this.translation_.getValue(),this.rotation_.getValue(),this.scale_.getValue(),this.scaleOrientation_.getValue(),this.center_.getValue())}}),i}),define("cobweb/Components/CADGeometry/CADPart",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DTransformNode","cobweb/Components/CADGeometry/X3DProductStructureChildNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.CADPart)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"name",new t.SFString),new n(s.inputOutput,"translation",new t.SFVec3f),new n(s.inputOutput,"rotation",new t.SFRotation),new n(s.inputOutput,"scale",new t.SFVec3f(1,1,1)),new n(s.inputOutput,"scaleOrientation",new t.SFRotation),new n(s.inputOutput,"center",new t.SFVec3f),new n(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(s.initializeOnly,"bboxCenter",new t.SFVec3f),new n(s.inputOnly,"addChildren",new t.MFNode),new n(s.inputOnly,"removeChildren",new t.MFNode),new n(s.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"CADPart"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this)}}),a}),define("cobweb/Components/Geometry2D/Circle2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DLineGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.Circle2D),this.setGeometryType(1)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"radius",new t.SFFloat(1))]),getTypeName:function(){return"Circle2D"},getComponentName:function(){return"Geometry2D"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.setPrimitiveMode(this.getBrowser().getContext().LINE_LOOP)},set_live__:function(){r.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getCircle2DOptions().addInterest("eventsProcessed",this):this.getBrowser().getCircle2DOptions().removeInterest("eventsProcessed",this)},build:function(){var e=this.getBrowser().getCircle2DOptions(),t=this.radius_.getValue(),n=e.getVertices(),i=this.getVertices();if(1===t)this.setVertices(n);else for(var r=0,o=n.length;r<o;r+=4)i.push(n[r]*t,n[r+1]*t,0,1);this.getMin().set(-t,-t,0),this.getMax().set(t,t,0)}}),s}),define("cobweb/Components/Rendering/ClipPlane",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Geometry/Plane3","standard/Utility/ObjectCache"],function(e,t,n,i,r,o,s,a,u,l){function c(){this.plane=new u(s.Zero,s.Zero)}function h(e){r.call(this,e),this.addType(o.ClipPlane),this.enabled=!1,this.plane=new a(0,0,0,0)}var d=l(c);return c.prototype={constructor:c,isClipped:function(e){return this.plane.getDistanceToPoint(e)<0},set:function(e,t){var n=this.plane,i=e.plane;try{n.normal.assign(i),n.distanceFromOrigin=-i.w,n.multRight(t)}catch(e){n.normal.set(0,0,0),n.distanceFromOrigin=0}},setShaderUniforms:function(e,t,n){var i=this.plane,r=i.normal;e.uniform4f(t.x3d_ClipPlane[n],r.x,r.y,r.z,i.distanceFromOrigin)},dispose:function(){d.push(this)}},h.prototype=e.extend(Object.create(r.prototype),{constructor:h,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"plane",new t.SFVec4f(0,1,0,0))]),getTypeName:function(){return"ClipPlane"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this),this.plane_.addInterest("set_enabled__",this),this.set_enabled__()},set_enabled__:function(){this.plane.assign(this.plane_.getValue()),this.enabled=this.enabled_.getValue()&&!this.plane.equals(a.Zero)},push:function(e){if(this.enabled){var t=d.pop();t.set(this,e.getModelViewMatrix().get()),e.getClipPlanes().push(t)}},pop:function(e){this.enabled&&e.getBrowser().getClipPlanes().push(e.getClipPlanes().pop())}}),h}),define("cobweb/Components/Navigation/Collision",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Components/Core/X3DSensorNode","cobweb/Bits/X3DCast","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),o.call(this,e),this.addType(u.Collision),this.addAlias("collide",this.enabled_)}return l.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:l,fieldDefinitions:new i([new n(u.inputOutput,"metadata",new t.SFNode),new n(u.inputOutput,"enabled",new t.SFBool(!0)),new n(u.outputOnly,"isActive",new t.SFBool),new n(u.outputOnly,"collideTime",new t.SFTime),new n(u.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(u.initializeOnly,"bboxCenter",new t.SFVec3f),new n(u.initializeOnly,"proxy",new t.SFNode),new n(u.inputOnly,"addChildren",new t.MFNode),new n(u.inputOnly,"removeChildren",new t.MFNode),new n(u.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Collision"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.enabled_.addInterest("set_live__",this),this.proxy_.addInterest("set_proxy__",this),this.set_live__(),this.set_proxy__()},set_live__:function(){this.isLive().getValue()&&this.enabled_.getValue()?this.getBrowser().addCollision(this):this.getBrowser().removeCollision(this)},set_active:function(e){this.isActive_.getValue()!==e&&(this.isActive_=e,e&&(this.collideTime_=this.getBrowser().getCurrentTime()))},set_proxy__:function(){this.proxyNode=s(u.X3DChildNode,this.proxy_)},traverse:function(e,t){switch(e){case a.COLLISION:if(this.enabled_.getValue()){var n=t.getCollisions();n.push(this),this.proxyNode?this.proxyNode.traverse(e,t):r.prototype.traverse.call(this,e,t),n.pop()}break;default:r.prototype.traverse.call(this,e,t)}}}),l}),define("cobweb/Components/Rendering/X3DColorNode",["jquery","cobweb/Components/Rendering/X3DGeometricPropertyNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DColorNode),this.color=this.color_.getValue()}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,get1Color:function(e){return e>=0&&e<this.color.length?this.color[e].getValue():this.color.length?this.color[this.color.length-1].getValue():this.getWhite()}}),i}),define("cobweb/Components/Rendering/Color",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DColorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Color3","standard/Math/Numbers/Vector4"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.Color)}var l=new s(1,1,1);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"color",new t.MFColor)]),getTypeName:function(){return"Color"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"color"},isTransparent:function(){return!1},getWhite:function(){return l},getVectors:function(e){for(var t=this.color_.getValue(),n=0,i=t.length;n<i;++n){var r=t[n].getValue();e[n]=new a(r.r,r.g,r.b,1)}return e.length=i,e}}),u}),define("cobweb/Components/Followers/X3DFollowerNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DFollowerNode),this.buffer=[],this.a=this.getVector(),this.vector=this.getVector()}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this)},duplicate:function(e){return e.copy()},getBuffer:function(){return this.buffer},getValue:function(){return this.set_value_.getValue()},getDestination:function(){return this.set_destination_.getValue()},getInitialValue:function(){return this.initialValue_.getValue()},getInitialDestination:function(){return this.initialDestination_.getValue()},setValue:function(e){this.value_changed_=e},assign:function(e,t,n){e[t].assign(n)},equals:function(e,t,n){return this.a.assign(e).subtract(t).abs()<n},interpolate:function(e,t,n){return this.vector.assign(e).lerp(t,n)},set_live__:function(){this.isLive().getValue()&&this.isActive_.getValue()?(this.getBrowser().prepareEvents().addInterest("prepareEvents",this),this.getBrowser().addBrowserEvent()):this.getBrowser().prepareEvents().removeInterest("prepareEvents",this)},set_active:function(e){e!==this.isActive_.getValue()&&(this.isActive_=e,this.set_live__())}}),i}),define("cobweb/Components/Followers/X3DChaserNode",["jquery","cobweb/Components/Followers/X3DFollowerNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DChaserNode),this.destination=null,this.previousValue=null,this.bufferEndTime=0,this.stepTime=0,this.deltaOut=this.getArray()}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this),this.set_value_.addInterest("set_value__",this),this.set_destination_.addInterest("set_destination__",this),this.duration_.addInterest("set_duration__",this),this.set_duration__();var e=this.getBuffer(),n=this.getInitialValue(),i=this.getInitialDestination(),r=this.getNumBuffers();this.bufferEndTime=this.getBrowser().getCurrentTime(),this.previousValue=this.duplicate(n),e[0]=this.duplicate(i);for(var o=1;o<r;++o)e[o]=this.duplicate(n);this.destination=this.duplicate(i),this.equals(i,n,this.getTolerance())?this.setValue(i):this.set_active(!0)},getNumBuffers:function(){return 60},getTolerance:function(){return 1e-8},getArray:function(){return this.getVector()},setPreviousValue:function(e){this.previousValue.assign(e)},step:function(e,t,n){this.output.add(this.deltaOut.assign(e).subtract(t).multiply(n))},stepResponse:function(e){if(e<=0)return 0;var t=this.duration_.getValue();return e>=t?1:.5-.5*Math.cos(e/t*Math.PI)},set_value__:function(){this.isActive_.getValue()||(this.bufferEndTime=this.getBrowser().getCurrentTime());for(var e=this.getBuffer(),t=this.getValue(),n=1,i=e.length;n<i;++n)this.assign(e,n,t);this.setPreviousValue(t),this.setValue(t),this.set_active(!0)},set_destination__:function(){this.destination=this.duplicate(this.getDestination()),this.isActive_.getValue()||(this.bufferEndTime=this.getBrowser().getCurrentTime()),this.set_active(!0)},set_duration__:function(){this.stepTime=this.duration_.getValue()/this.getNumBuffers()},prepareEvents:function(){try{var e=this.getBuffer(),t=e.length,n=this.updateBuffer();this.output=this.interpolate(this.previousValue,e[t-1],this.stepResponse((t-1+n)*this.stepTime));for(var i=t-2;i>=0;--i)this.step(e[i],e[i+1],this.stepResponse((i+n)*this.stepTime));this.setValue(this.output),this.equals(this.output,this.destination,this.getTolerance())&&this.set_active(!1)}catch(e){}},updateBuffer:function(){var e=this.getBuffer(),t=e.length,n=(this.getBrowser().getCurrentTime()-this.bufferEndTime)/this.stepTime;if(n>=1){var i=Math.floor(n);if(n-=i,i<t){this.setPreviousValue(e[t-i]);for(o=t-1;o>=i;--o)this.assign(e,o,e[o-i]);for(o=0;o<i;++o)try{var r=o/i;this.assign(e,o,this.interpolate(this.destination,e[i],r))}catch(e){}}else{this.setPreviousValue(i==t?e[0]:this.destination);for(var o=0;o<t;++o)this.assign(e,o,this.destination)}this.bufferEndTime+=i*this.stepTime}return n}}),i}),define("cobweb/Components/Followers/ColorChaser",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DChaserNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Color3","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.ColorChaser)}var l=new a(0,0,0),c=new a(0,0,0),h=new a(0,0,0),d=new a(0,0,0);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFColor),new n(o.inputOnly,"set_destination",new t.SFColor),new n(o.initializeOnly,"initialValue",new t.SFColor(.8,.8,.8)),new n(o.initializeOnly,"initialDestination",new t.SFColor(.8,.8,.8)),new n(o.initializeOnly,"duration",new t.SFTime(1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFColor)]),getTypeName:function(){return"ColorChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new a(0,0,0)},getValue:function(){return this.set_value_.getValue().getHSV(d)},getDestination:function(){return this.set_destination_.getValue().getHSV(d)},getInitialValue:function(){return this.initialValue_.getValue().getHSV(l)},getInitialDestination:function(){return this.initialDestination_.getValue().getHSV(c)},setValue:function(e){this.value_changed_.setHSV(e.x,e.y,e.z)},interpolate:function(e,t,n){return s.lerp(e,t,n,d)},step:function(e,t,n){h.assign(this.output).add(e).subtract(t),s.lerp(this.output,h,n,this.output)}}),u}),define("cobweb/Components/Followers/X3DDamperNode",["jquery","cobweb/Components/Followers/X3DFollowerNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i){function r(e){t.call(this,e),this.addType(n.X3DDamperNode)}return r.prototype=e.extend(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.order_.addInterest("set_order__",this),this.set_value_.addInterest("set_value__",this),this.set_destination_.addInterest("set_destination__",this);var e=this.getBuffer(),n=this.getInitialValue(),i=this.getInitialDestination();e[0]=this.duplicate(i);for(var r=1,o=this.getOrder()+1;r<o;++r)e[r]=this.duplicate(n);this.equals(i,n,this.getTolerance())?this.setValue(i):this.set_active(!0)},getOrder:function(){return i.clamp(this.order_.getValue(),0,5)},getTolerance:function(){return this.tolerance_.getValue()<0?1e-4:this.tolerance_.getValue()},prepareEvents:function(){var e=this.getBuffer(),t=e.length-1;if(this.tau_.getValue()){for(var n=1/this.getBrowser().currentFrameRate,i=Math.exp(-n/this.tau_.getValue()),r=0;r<t;++r)try{this.assign(e,r+1,this.interpolate(e[r],e[r+1],i))}catch(e){}if(this.setValue(e[t]),!this.equals(e[t],e[0],this.getTolerance()))return}else this.setValue(e[0]),t=0;for(var r=1,o=e.length;r<o;++r)this.assign(e,r,e[t]);this.set_active(!1)},set_value__:function(){for(var e=this.getBuffer(),t=this.getValue(),n=1,i=e.length;n<i;++n)this.assign(e,n,t);this.setValue(t),this.set_active(!0)},set_destination__:function(){this.assign(this.getBuffer(),0,this.getDestination()),this.set_active(!0)},set_order__:function(){for(var e=this.getBuffer(),t=e[e.length-1],n=e.length,i=this.getOrder()+1;n<i;++n)e[n]=this.duplicate(t);e.length=i}}),r}),define("cobweb/Components/Followers/ColorDamper",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DDamperNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Color3","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.ColorDamper)}var l=new a(0,0,0),c=new a(0,0,0),h=new a(0,0,0),d=new a(0,0,0);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFColor),new n(o.inputOnly,"set_destination",new t.SFColor),new n(o.initializeOnly,"initialValue",new t.SFColor(.8,.8,.8)),new n(o.initializeOnly,"initialDestination",new t.SFColor(.8,.8,.8)),new n(o.initializeOnly,"order",new t.SFInt32(3)),new n(o.inputOutput,"tau",new t.SFTime(.3)),new n(o.inputOutput,"tolerance",new t.SFFloat(-1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFColor)]),getTypeName:function(){return"ColorDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new a(0,0,0)},getValue:function(){return this.set_value_.getValue().getHSV(d)},getDestination:function(){return this.set_destination_.getValue().getHSV(d)},getInitialValue:function(){return this.initialValue_.getValue().getHSV(c)},getInitialDestination:function(){return this.initialDestination_.getValue().getHSV(h)},setValue:function(e){this.value_changed_.setHSV(e.x,e.y,e.z)},equals:function(e,t,n){return l.assign(e).subtract(t).abs()<n},interpolate:function(e,t,n){return s.lerp(e,t,n,d)}}),u}),define("cobweb/Components/Interpolation/ColorInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Color3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.ColorInterpolator),this.hsv=[]}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFColor),new n(o.outputOnly,"value_changed",new t.SFColor)]),value:[],getTypeName:function(){return"ColorInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.keyValue_.getValue();e.length<this.key_.length&&this.keyValue_.resize(this.key_.length,e.length?e[this.keyValue_.length-1]:new t.SFColor),this.hsv.length=0;for(var n=0,i=e.length;n<i;++n)this.hsv.push(e[n].getHSV([]))},interpolate:function(e,t,n){var i=s.lerp(this.hsv[e],this.hsv[t],n,this.value);this.value_changed_.setHSV(i[0],i[1],i[2])}}),a}),define("cobweb/Components/Rendering/ColorRGBA",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DColorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Color4","standard/Math/Numbers/Vector4"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.ColorRGBA)}var l=new s(1,1,1,1);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"color",new t.MFColorRGBA)]),getTypeName:function(){return"ColorRGBA"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"color"},isTransparent:function(){return!0},getWhite:function(){return l},getVectors:function(e){for(var t=this.color_.getValue(),n=0,i=t.length;n<i;++n){var r=t[n].getValue();e[n]=new a(r.r,r.g,r.b,r.a)}return e.length=i,e}}),u}),define("cobweb/Components/CubeMapTexturing/X3DEnvironmentTextureNode",["jquery","cobweb/Components/Texturing/X3DTextureNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DEnvironmentTextureNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this);var e=this.getBrowser().getContext();this.target=e.TEXTURE_CUBE_MAP,this.targets=[e.TEXTURE_CUBE_MAP_POSITIVE_Z,e.TEXTURE_CUBE_MAP_NEGATIVE_Z,e.TEXTURE_CUBE_MAP_NEGATIVE_X,e.TEXTURE_CUBE_MAP_POSITIVE_X,e.TEXTURE_CUBE_MAP_POSITIVE_Y,e.TEXTURE_CUBE_MAP_NEGATIVE_Y]},set_live__:function(){this.isLive().getValue()?(this.getBrowser().getBrowserOptions().TextureQuality_.addInterest("set_textureQuality__",this),this.set_textureQuality__()):this.getBrowser().getBrowserOptions().TextureQuality_.removeInterest("set_textureQuality__",this)},set_textureQuality__:function(){var e=this.getBrowser().getDefaultTextureProperties();this.updateTextureProperties(this.target,!1,e,128,128,!1,!1,!1)},getTarget:function(){return this.target},getTargets:function(){return this.targets},setShaderUniforms:function(e,t,n){t.textureTypeArray[n]=4,e.activeTexture(e.TEXTURE4),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1iv(t.x3d_TextureType,t.textureTypeArray)}}),i}),define("cobweb/Components/CubeMapTexturing/ComposedCubeMapTexture",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/CubeMapTexturing/X3DEnvironmentTextureNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.ComposedCubeMapTexture),this.textures=[null,null,null,null,null,null],this.loadStates=0}var u=new Uint8Array([255,255,255,255]);return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"front",new t.SFNode),new n(s.inputOutput,"back",new t.SFNode),new n(s.inputOutput,"left",new t.SFNode),new n(s.inputOutput,"right",new t.SFNode),new n(s.inputOutput,"bottom",new t.SFNode),new n(s.inputOutput,"top",new t.SFNode)]),getTypeName:function(){return"ComposedCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this);var e=this.getBrowser().getContext();e.bindTexture(this.getTarget(),this.getTexture());for(var t=0;t<6;++t)e.texImage2D(this.getTargets()[t],0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,u);this.isLive().addInterest("set_live__",this),this.front_.addInterest("set_texture__",this,0),this.back_.addInterest("set_texture__",this,1),this.left_.addInterest("set_texture__",this,2),this.right_.addInterest("set_texture__",this,3),this.top_.addInterest("set_texture__",this,5),this.bottom_.addInterest("set_texture__",this,4),this.set_texture__(this.front_,0),this.set_texture__(this.back_,1),this.set_texture__(this.left_,2),this.set_texture__(this.right_,3),this.set_texture__(this.top_,4),this.set_texture__(this.bottom_,5),this.set_live__()},set_texture__:function(e,t){var n=this.textures[t];if(n){i="set_loadState__"+n.getId()+"_"+t;n.removeInterest("set_loadState__",this),n.loadState_.removeFieldCallback(i)}if(n=this.textures[t]=o(s.X3DTexture2DNode,e)){var i="set_loadState__"+n.getId()+"_"+t;n.addInterest("set_loadState__",this,n,t),n.loadState_.addFieldCallback(i,this.set_loadState__.bind(this,null,n,t))}this.set_loadState__(null,n,t)},set_loadState__:function(e,t,n){t?this.setLoadStateBit(t.checkLoadState(),n):this.setLoadStateBit(s.NOT_STARTED,n),this.setTextures()},setLoadStateBit:function(e,t){e===s.COMPLETE_STATE?this.loadStates|=1<<t:this.loadStates&=~(1<<t)},isComplete:function(){if(63!==this.loadStates)return!1;for(var e=this.textures,t=e[0].getWidth(),n=0;n<6;++n){var i=e[n];if(i.getWidth()!==t)return!1;if(i.getHeight()!==t)return!1}return!0},setTextures:function(){if((n=this.getBrowser().getContext()).bindTexture(this.getTarget(),this.getTexture()),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),this.isComplete()){for(var e=this.textures,t=0;t<6;++t){var n=this.getBrowser().getContext(),i=e[t],r=i.getWidth(),o=i.getHeight(),s=i.getData();n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!i.getFlipY()),n.pixelStorei(n.UNPACK_ALIGNMENT,1),s instanceof Uint8Array?n.texImage2D(this.getTargets()[t],0,n.RGBA,r,o,!1,n.RGBA,n.UNSIGNED_BYTE,s):n.texImage2D(this.getTargets()[t],0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,s)}this.set_textureQuality__()}else for(t=0;t<6;++t)n.texImage2D(this.getTargets()[t],0,n.RGBA,1,1,!1,n.RGBA,n.UNSIGNED_BYTE,u);this.set_transparent__()},set_transparent__:function(){var e=this.textures,t=!1;if(this.isComplete())for(var n=0;n<6;++n)if(e[n].transparent_.getValue()){t=!0;break}t!==this.transparent_.getValue()&&(this.transparent_=t)}}),a}),define("cobweb/Components/Geometry3D/Cone",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(o.Cone)}return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"side",new t.SFBool(!0)),new n(o.initializeOnly,"bottom",new t.SFBool(!0)),new n(o.initializeOnly,"height",new t.SFFloat(2)),new n(o.initializeOnly,"bottomRadius",new t.SFFloat(1)),new n(o.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Cone"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},set_live__:function(){r.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getConeOptions().addInterest("eventsProcessed",this):this.getBrowser().getConeOptions().removeInterest("eventsProcessed",this)},build:function(){var e=this.getBrowser().getConeOptions().xDimension_.getValue(),t=this.height_.getValue(),n=this.bottomRadius_.getValue(),i=[],r=this.getNormals(),o=this.getVertices();this.getTexCoords().push(i);var l=t/2,c=-l,h=s.Polar(1,-Math.PI/2+Math.atan(n/t));if(this.side_.getValue())for(F=0;F<e;++F){var d=(F+.5)/e,p=2*Math.PI*d,f=s.Polar(h.imag,p),g=F/e,m=2*Math.PI*g,b=s.Polar(-n,m),w=s.Polar(h.imag,m),y=(F+1)/e,x=2*Math.PI*y,v=s.Polar(-n,x),_=s.Polar(h.imag,x);i.push(d,1,0,1),r.push(f.imag,h.real,f.real),o.push(0,l,0,1),i.push(g,0,0,1),r.push(w.imag,h.real,w.real),o.push(b.imag,c,b.real,1),i.push(y,0,0,1),r.push(_.imag,h.real,_.real),o.push(v.imag,c,v.real,1)}if(this.bottom_.getValue()){for(var S=[],C=[],F=e-1;F>-1;--F){var T=F/e,N=2*Math.PI*T,O=s.Polar(-1,N),M=s.multiply(O,n);S.push(new a((O.imag+1)/2,(O.real+1)/2)),C.push(new u(M.imag,c,M.real))}for(var V=S[0],D=C[0],F=1,I=C.length-1;F<I;++F){var B=S[F],E=S[F+1],A=C[F],b=C[F+1];i.push(V.x,V.y,0,1),r.push(0,-1,0),o.push(D.x,D.y,D.z,1),i.push(B.x,B.y,0,1),r.push(0,-1,0),o.push(A.x,A.y,A.z,1),i.push(E.x,E.y,0,1),r.push(0,-1,0),o.push(b.x,b.y,b.z,1)}}this.setSolid(this.solid_.getValue()),this.setNormals(r),this.setExtents()},setExtents:function(){var e=this.bottomRadius_.getValue(),t=this.height_.getValue()/2,n=-t;this.side_.getValue()||this.bottom_.getValue()?this.side_.getValue()?(this.getMin().set(-e,n,-e),this.getMax().set(e,t,e)):(this.getMin().set(-e,n,-e),this.getMax().set(e,n,e)):(this.getMin().set(0,0,0),this.getMax().set(0,0,0))}}),l}),define("cobweb/Components/ParticleSystems/ConeEmitter",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticleEmitterNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.ConeEmitter),this.rotation=new a(0,0,1,0)}return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"position",new t.SFVec3f),new n(o.inputOutput,"direction",new t.SFVec3f(0,1,0)),new n(o.inputOutput,"angle",new t.SFFloat(.7854)),new n(o.inputOutput,"speed",new t.SFFloat),new n(o.inputOutput,"variation",new t.SFFloat(.25)),new n(o.initializeOnly,"mass",new t.SFFloat),new n(o.initializeOnly,"surfaceArea",new t.SFFloat)]),getTypeName:function(){return"ConeEmitter"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"emitter"},initialize:function(){r.prototype.initialize.call(this),this.position_.addInterest("set_position__",this),this.direction_.addInterest("set_direction__",this),this.angle_.addInterest("set_angle__",this),this.set_position__(),this.set_direction__(),this.set_angle__()},set_position__:function(){this.position=this.position_.getValue()},set_direction__:function(){var e=this.direction_.getValue();this.rotation.setFromToVec(s.zAxis,e),e.equals(s.Zero)?this.getRandomVelocity=this.getSphericalRandomVelocity:delete this.getRandomVelocity},set_angle__:function(){this.angle=this.angle_.getValue()},getRandomPosition:function(e){return e.assign(this.position)},getRandomVelocity:function(e){return this.rotation.multVecRot(this.getRandomNormalWithAngle(this.angle,e).multiply(this.getRandomSpeed()))}}),u}),define("cobweb/Browser/Followers/X3DArrayFollowerTemplate",[],function(){return function(e){function t(){this.array=this.getArray()}return t.prototype={getValue:function(){return this.set_value_},getDestination:function(){return this.set_destination_},getInitialValue:function(){return this.initialValue_},getInitialDestination:function(){return this.initialDestination_},assign:function(e,t,n){e[t].setValue(n)},equals:function(e,t,n){for(var i=this.a,r=e.getValue(),o=t.getValue(),s=0,a=0,u=r.length;a<u;++a)s=Math.max(i.assign(r[a].getValue()).subtract(o[a].getValue()).abs());return s<n},interpolate:function(e,t,n){var i=this.array.getValue(),r=e.getValue(),o=t.getValue();this.array.length=r.length;for(var s=0,a=r.length;s<a;++s)i[s].getValue().assign(r[s].getValue()).lerp(o[s].getValue(),n);return this.array},set_value__:function(){this.getBuffer()[0].length=this.set_value_.length,e.prototype.set_value__.call(this)},set_destination__:function(){for(var t=this.getBuffer(),n=this.set_destination_.length,i=0,r=t.length;i<r;++i)t[i].length=n;e.prototype.set_destination__.call(this)}},t}}),define("cobweb/Browser/Followers/X3DArrayChaserTemplate",["jquery","cobweb/Browser/Followers/X3DArrayFollowerTemplate"],function(e,t){return function(n){function i(){this.array=this.getArray()}return i.prototype=e.extend(Object.create(t(n).prototype),{setPreviousValue:function(e){this.previousValue.setValue(e)},step:function(e,t,n){var i=this.output.getValue(),r=this.deltaOut.getValue();e=e.getValue(),t=t.getValue(),this.deltaOut.length=i.length;for(var o=0,s=i.length;o<s;++o)i[o].getValue().add(r[o].getValue().assign(e[o].getValue()).subtract(t[o].getValue()).multiply(n))}}),i}}),define("cobweb/Components/Followers/CoordinateChaser",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DChaserNode","cobweb/Browser/Followers/X3DArrayChaserTemplate","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),l.call(this,e),this.addType(s.CoordinateChaser)}var l=o(r);return u.prototype=e.extend(Object.create(r.prototype),l.prototype,{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_value",new t.MFVec3f),new n(s.inputOnly,"set_destination",new t.MFVec3f),new n(s.initializeOnly,"initialValue",new t.MFVec3f(new a(0,0,0))),new n(s.initializeOnly,"initialDestination",new t.MFVec3f(new a(0,0,0))),new n(s.initializeOnly,"duration",new t.SFTime(1)),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"value_changed",new t.MFVec3f)]),getTypeName:function(){return"CoordinateChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new a(0,0,0)},getArray:function(){return new t.MFVec3f}}),u}),define("cobweb/Components/Followers/CoordinateDamper",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DDamperNode","cobweb/Browser/Followers/X3DArrayFollowerTemplate","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),l.call(this,e),this.addType(s.CoordinateDamper)}var l=o(r);return u.prototype=e.extend(Object.create(r.prototype),l.prototype,{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_value",new t.MFVec3f),new n(s.inputOnly,"set_destination",new t.MFVec3f),new n(s.initializeOnly,"initialValue",new t.MFVec3f(new a(0,0,0))),new n(s.initializeOnly,"initialDestination",new t.MFVec3f(new a(0,0,0))),new n(s.initializeOnly,"order",new t.SFInt32(3)),new n(s.inputOutput,"tau",new t.SFTime(.3)),new n(s.inputOutput,"tolerance",new t.SFFloat(-1)),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"value_changed",new t.MFVec3f)]),getTypeName:function(){return"CoordinateDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new a(0,0,0)},getArray:function(){return new t.MFVec3f}}),u}),define("cobweb/Components/NURBS/CoordinateDouble",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DCoordinateNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.CoordinateDouble)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"point",new t.MFVec3d)]),getTypeName:function(){return"CoordinateDouble"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"coord"}}),s}),define("cobweb/Components/Interpolation/CoordinateInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.CoordinateInterpolator)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFVec3f),new n(o.outputOnly,"value_changed",new t.MFVec3f)]),keyValue:new s(0,0,0),getTypeName:function(){return"CoordinateInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},set_keyValue__:function(){},interpolate:function(e,t,n){var i=this.keyValue_.getValue(),r=this.value_changed_.getValue(),o=this.key_.length?Math.floor(i.length/this.key_.length):0;t=(e*=o)+(this.key_.length>1?o:0),this.value_changed_.length=o;for(var s=0;s<o;++s)r[s].getValue().assign(i[e+s].getValue()).lerp(i[t+s].getValue(),n);this.value_changed_.addEvent()}}),a}),define("cobweb/Components/Interpolation/CoordinateInterpolator2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.CoordinateInterpolator2D)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFVec2f),new n(o.outputOnly,"value_changed",new t.MFVec2f)]),getTypeName:function(){return"CoordinateInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},set_keyValue__:function(){},interpolate:function(e,t,n){var i=this.keyValue_.getValue(),r=this.value_changed_.getValue(),o=this.key_.length?Math.floor(i.length/this.key_.length):0;t=(e*=o)+(this.key_.length>1?o:0),this.value_changed_.length=o;for(var s=0;s<o;++s)r[s].getValue().assign(i[e+s].getValue()).lerp(i[t+s].getValue(),n);this.value_changed_.addEvent()}}),s}),define("cobweb/Components/Geometry3D/Cylinder",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(o.Cylinder)}return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"top",new t.SFBool(!0)),new n(o.initializeOnly,"side",new t.SFBool(!0)),new n(o.initializeOnly,"bottom",new t.SFBool(!0)),new n(o.initializeOnly,"height",new t.SFFloat(2)),new n(o.initializeOnly,"radius",new t.SFFloat(1)),new n(o.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Cylinder"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},set_live__:function(){r.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getCylinderOptions().addInterest("eventsProcessed",this):this.getBrowser().getCylinderOptions().removeInterest("eventsProcessed",this)},build:function(){var e=this.getBrowser().getCylinderOptions().xDimension_.getValue(),t=[],n=this.getNormals(),i=this.getVertices();this.getTexCoords().push(t);var r=this.radius_.getValue(),o=this.height_.getValue()/2,l=-o;if(this.side_.getValue())for(x=0;x<e;++x){var c=x/e,h=2*Math.PI*c,d=s.Polar(-1,h),p=s.multiply(d,r),f=(x+1)/e,g=2*Math.PI*f,m=s.Polar(-1,g),b=s.multiply(m,r);t.push(c,1,0,1),n.push(d.imag,0,d.real),i.push(p.imag,o,p.real,1),t.push(c,0,0,1),n.push(d.imag,0,d.real),i.push(p.imag,l,p.real,1),t.push(f,0,0,1),n.push(m.imag,0,m.real),i.push(b.imag,l,b.real,1),t.push(c,1,0,1),n.push(d.imag,0,d.real),i.push(p.imag,o,p.real,1),t.push(f,0,0,1),n.push(m.imag,0,m.real),i.push(b.imag,l,b.real,1),t.push(f,1,0,1),n.push(m.imag,0,m.real),i.push(b.imag,o,b.real,1)}if(this.top_.getValue()){for(var w=[],y=[],x=0;x<e;++x){var v=x/e,_=2*Math.PI*v,S=s.Polar(-1,_);w.push(new a((S.imag+1)/2,-(S.real-1)/2)),y.push(new u(S.imag*r,o,S.real*r))}for(var C=w[0],F=y[0],x=1,T=y.length-1;x<T;++x){var N=w[x],O=w[x+1],p=y[x],b=y[x+1];t.push(C.x,C.y,0,1),n.push(0,1,0),i.push(F.x,F.y,F.z,1),t.push(N.x,N.y,0,1),n.push(0,1,0),i.push(p.x,p.y,p.z,1),t.push(O.x,O.y,0,1),n.push(0,1,0),i.push(b.x,b.y,b.z,1)}}if(this.bottom_.getValue()){for(var w=[],y=[],x=e-1;x>-1;--x){var v=x/e,_=2*Math.PI*v,S=s.Polar(-1,_);w.push(new a((S.imag+1)/2,(S.real+1)/2)),y.push(new u(S.imag*r,l,S.real*r))}for(var C=w[0],F=y[0],x=1,T=y.length-1;x<T;++x){var N=w[x],O=w[x+1],p=y[x],b=y[x+1];t.push(C.x,C.y,0,1),n.push(0,-1,0),i.push(F.x,F.y,F.z,1),t.push(N.x,N.y,0,1),n.push(0,-1,0),i.push(p.x,p.y,p.z,1),t.push(O.x,O.y,0,1),n.push(0,-1,0),i.push(b.x,b.y,b.z,1)}}this.setSolid(this.solid_.getValue()),this.setNormals(n),this.setExtents()},setExtents:function(){var e=this.radius_.getValue(),t=this.height_.getValue()/2,n=-t;this.top_.getValue()||this.side_.getValue()||this.bottom_.getValue()?this.top_.getValue()||this.side_.getValue()?this.bottom_.getValue()||this.side_.getValue()?(this.getMin().set(-e,n,-e),this.getMax().set(e,t,e)):(this.getMin().set(-e,t,-e),this.getMax().set(e,t,e)):(this.getMin().set(-e,n,-e),this.getMax().set(e,n,e)):(this.getMin().set(0,0,0),this.getMax().set(0,0,0))}}),l}),define("cobweb/Components/PointingDeviceSensor/X3DDragSensorNode",["jquery","cobweb/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DDragSensorNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("standard/Math/Geometry/Cylinder3",["standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Line3"],function(e,t,n,i){function r(e,t){this.axis=e.copy(),this.radius=t}return r.prototype={constructor:r,intersectsLine:function(r,o,s){var a=new t(this.axis.direction,new e(0,1,0)),u=n.Rotation(a),l=1/this.radius,c=new n;c.scale(new e(l,l,l)),c.multLeft(u);var h=e.subtract(r.point,this.axis.point),d=new i(h,r.direction).multLineMatrix(c),p=this.unitCylinderIntersectsLine(d,o,s);if(p){var f=c.inverse();f.multVecMatrix(o),o.add(this.axis.point),f.multVecMatrix(s),s.add(this.axis.point)}return p},unitCylinderIntersectsLine:function(e,t,n){var i,r,o=e.point,s=e.direction,a=s[0]*s[0]+s[2]*s[2],u=2*(o[0]*s[0]+o[2]*s[2]),l=o[0]*o[0]+o[2]*o[2]-1,c=u*u-4*a*l;if(c<0)return!1;var h=Math.sqrt(c);return u>0?(i=-2*l/(h+u),r=-(h+u)/(2*a)):(i=2*l/(h-u),r=(h-u)/(2*a)),t.assign(s).multiply(i).add(o),n.assign(s).multiply(r).add(o),!0},toString:function(){return this.axis.toString()+" "+this.radius}},r}),define("cobweb/Components/PointingDeviceSensor/CylinderSensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/PointingDeviceSensor/X3DDragSensorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Geometry/Cylinder3","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l,c,h,d){function p(e){r.call(this,e),this.addType(o.CylinderSensor)}return p.prototype=e.extend(Object.create(r.prototype),{constructor:p,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"description",new t.SFString),new n(o.inputOutput,"axisRotation",new t.SFRotation),new n(o.inputOutput,"diskAngle",new t.SFFloat(.261792)),new n(o.inputOutput,"minAngle",new t.SFFloat),new n(o.inputOutput,"maxAngle",new t.SFFloat(-1)),new n(o.inputOutput,"offset",new t.SFFloat),new n(o.inputOutput,"autoOffset",new t.SFBool(!0)),new n(o.outputOnly,"trackPoint_changed",new t.SFVec3f),new n(o.outputOnly,"rotation_changed",new t.SFRotation),new n(o.outputOnly,"isOver",new t.SFBool),new n(o.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"CylinderSensor"},getComponentName:function(){return"PointingDeviceSensor"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.modelViewMatrix=new u,this.invModelViewMatrix=new u,this.cylinder=new h(new l(new s(0,0,0),new s(0,0,0)),0),this.disk=!1,this.yPlane=null,this.zPlane=null,this.sxPlane=null,this.szNormal=null,this.behind=!1,this.fromVector=new s(0,0,0),this.startOffset=new a(0,0,1,0)},isBehind:function(e,t){var n=new s(0,0,0),i=new s(0,0,0);return this.cylinder.intersectsLine(e,n,i),s.subtract(t,n).abs()>s.subtract(t,i).abs()},getTrackPoint:function(e,t){var n=new s(0,0,0);this.zPlane.intersectsLine(e,n);var i=s.add(n,this.cylinder.axis.getPerpendicularVector(n)),r=this.sxPlane.getDistanceToPoint(n)/this.cylinder.radius,o=Math.floor((r+1)/2),u=d.interval(r,-1,1),l=(0===o?Math.asin(u):u*Math.PI/2)+o*Math.PI;new a(this.cylinder.axis.direction,l).multVecRot(t.assign(this.szNormal).multiply(this.cylinder.radius)),t.add(i)},getAngle:function(e){return s.dot(e.getAxis(),this.cylinder.axis.direction)>0?e.angle:-e.angle},set_active__:function(e,t,n,i,o){r.prototype.set_active__.call(this,e,t,n,i,o);try{if(this.isActive_.getValue()){this.modelViewMatrix.assign(n),this.invModelViewMatrix.assign(n).inverse();var u=t.hitRay.copy().multLineMatrix(this.invModelViewMatrix),d=this.invModelViewMatrix.multVecMatrix(t.intersection.point.copy()),p=this.axisRotation_.getValue().multVecRot(new s(0,1,0)),f=this.invModelViewMatrix.multDirMatrix(new s(0,0,1)).normalize(),g=new l(new s(0,0,0),p),m=g.getPerpendicularVector(d).abs();this.cylinder=new h(g,m),this.disk=Math.abs(s.dot(f,p))>Math.cos(this.diskAngle_.getValue()),this.behind=this.isBehind(u,d),this.yPlane=new c(d,p),this.zPlane=new c(d,f);var b=this.invModelViewMatrix.origin,w=s.cross(p,b).normalize();this.sxPlane=new c(new s(0,0,0),w),this.szNormal=s.cross(w,p).normalize();var y=new s(0,0,0);this.disk?this.yPlane.intersectsLine(u,y):this.getTrackPoint(u,y),this.fromVector=this.cylinder.axis.getPerpendicularVector(y).negate(),this.startOffset=new a(p,this.offset_.getValue()),this.trackPoint_changed_=y,this.rotation_changed_=this.startOffset}else this.autoOffset_.getValue()&&(this.offset_=this.getAngle(this.rotation_changed_.getValue()))}catch(e){}},set_motion__:function(e){try{var t=e.hitRay.copy().multLineMatrix(this.invModelViewMatrix),n=new s(0,0,0);this.disk?this.yPlane.intersectsLine(t,n):this.getTrackPoint(t,n),this.trackPoint_changed_=n;var i=this.cylinder.axis.getPerpendicularVector(n).negate(),r=new a(this.fromVector,i);if(this.disk?this.modelViewMatrix.multVecMatrix(n.copy()).z>0&&r.multRight(new a(this.yPlane.normal,Math.PI)):this.behind&&r.inverse(),r.multLeft(this.startOffset),this.minAngle_.getValue()>this.maxAngle_.getValue())this.rotation_changed_=r;else{var o=d.interval(this.getAngle(r),-Math.PI,Math.PI),u=d.interval(this.minAngle_.getValue(),-Math.PI,Math.PI),l=d.interval(this.maxAngle_.getValue(),-Math.PI,Math.PI);o<u?r.setAxisAngle(this.cylinder.axis.direction,u):o>l&&r.setAxisAngle(this.cylinder.axis.direction,l),this.rotation_changed_.getValue().equals(r)||(this.rotation_changed_=r)}}catch(e){this.trackPoint_changed_.addEvent(),this.rotation_changed_.addEvent()}}}),p}),define("cobweb/Components/Geometry2D/Disk2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Components/Rendering/X3DLineGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a){function u(e){o.call(this,e),this.addType(s.Disk2D)}return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"innerRadius",new t.SFFloat),new n(s.inputOutput,"outerRadius",new t.SFFloat(1)),new n(s.initializeOnly,"solid",new t.SFBool)]),getTypeName:function(){return"Disk2D"},getComponentName:function(){return"Geometry2D"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.setPrimitiveMode(this.getBrowser().getContext().LINE_LOOP)},getShader:function(e){return e.getLineShader()},set_live__:function(){r.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getDisk2DOptions().addInterest("eventsProcessed",this):this.getBrowser().getDisk2DOptions().removeInterest("eventsProcessed",this)},build:function(){var e=this.getBrowser().getDisk2DOptions(),t=this.innerRadius_.getValue(),n=this.outerRadius_.getValue();if(t===n){var i=Math.abs(n),r=e.getCircleVertices(),o=this.getVertices();if(1===i)this.setVertices(r);else for(var s=0,a=r.length;s<a;s+=4)o.push(r[s]*i,r[s+1]*i,0,1);return this.getMin().set(-i,-i,0),this.getMax().set(i,i,0),void this.setGeometryType(1)}if(0===t||0===n){var i=Math.abs(Math.max(t,n)),r=e.getDiskVertices(),o=this.getVertices();if(this.getTexCoords().push(e.getDiskTexCoords()),this.setNormals(e.getDiskNormals()),1===i)this.setVertices(r);else for(var s=0,a=r.length;s<a;s+=4)o.push(r[s]*i,r[s+1]*i,0,1);return this.getMin().set(-i,-i,0),this.getMax().set(i,i,0),this.setGeometryType(2),void this.setSolid(this.solid_.getValue())}var u=Math.abs(Math.max(t,n)),l=Math.abs(Math.min(t,n)),c=l/u,h=(1-c)/2,d=e.getDiskTexCoords(),p=[],f=this.getNormals(),g=e.getDiskVertices(),m=this.getVertices();this.getTexCoords().push(p);for(var s=0,a=g.length;s<a;s+=12)p.push(d[s+4]*c+h,d[s+5]*c+h,0,1,d[s+4],d[s+5],0,1,d[s+8],d[s+9],0,1,d[s+4]*c+h,d[s+5]*c+h,0,1,d[s+8],d[s+9],0,1,d[s+8]*c+h,d[s+9]*c+h,0,1),f.push(0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1),m.push(g[s+4]*l,g[s+5]*l,0,1,g[s+4]*u,g[s+5]*u,0,1,g[s+8]*u,g[s+9]*u,0,1,g[s+4]*l,g[s+5]*l,0,1,g[s+8]*u,g[s+9]*u,0,1,g[s+8]*l,g[s+9]*l,0,1);this.getMin().set(-u,-u,0),this.getMax().set(u,u,0),this.setGeometryType(2),this.setSolid(this.solid_.getValue())},intersectsLine:function(e,t,n,i){return this.getGeometryType()<2?o.prototype.intersectsLine.call(this,e,t,n,i):r.prototype.intersectsLine.call(this,e,t,n,i)},intersectsBox:function(e,t,n){return this.getGeometryType()<2?o.prototype.intersectsBox.call(this,e,t,n):r.prototype.intersectsBox.call(this,e,t,n)},display:function(e){return this.getGeometryType()<2?o.prototype.display.call(this,e):r.prototype.display.call(this,e)},displayParticles:function(e,t,n){return this.getGeometryType()<2?o.prototype.displayParticles.call(this,e,t,n):r.prototype.displayParticles.call(this,e,t,n)}}),u}),define("cobweb/Components/Geometry3D/ElevationGrid",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(s.ElevationGrid),this.colorNode=null,this.texCoordNode=null,this.normalNode=null,this.coordNode=null}return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"xDimension",new t.SFInt32),new n(s.initializeOnly,"zDimension",new t.SFInt32),new n(s.initializeOnly,"xSpacing",new t.SFFloat(1)),new n(s.initializeOnly,"zSpacing",new t.SFFloat(1)),new n(s.initializeOnly,"solid",new t.SFBool(!0)),new n(s.initializeOnly,"ccw",new t.SFBool(!0)),new n(s.initializeOnly,"creaseAngle",new t.SFFloat),new n(s.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(s.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(s.inputOutput,"attrib",new t.MFNode),new n(s.inputOutput,"fogCoord",new t.SFNode),new n(s.inputOutput,"color",new t.SFNode),new n(s.inputOutput,"texCoord",new t.SFNode),new n(s.inputOutput,"normal",new t.SFNode),new n(s.inputOutput,"height",new t.MFFloat)]),getTypeName:function(){return"ElevationGrid"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.color_.addInterest("set_color__",this),this.texCoord_.addInterest("set_texCoord__",this),this.normal_.addInterest("set_normal__",this),this.set_attrib__(),this.set_color__(),this.set_texCoord__(),this.set_normal__()},set_attrib__:function(){for(var e=this.getAttrib(),t=0,n=e.length;t<n;++t)e[t].removeInterest("addNodeEvent",this);e.length=0;for(var t=0,n=this.attrib_.length;t<n;++t){var i=o(s.X3DVertexAttributeNode,this.attrib_[t]);i&&e.push(i)}for(t=0;t<this.attribNodes.length;++t)e[t].addInterest("addNodeEvent",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("addNodeEvent",this),this.colorNode.removeInterest("set_transparent__",this)),this.colorNode=o(s.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("addNodeEvent",this),this.colorNode.addInterest("set_transparent__",this),this.set_transparent__()):this.transparent_=!1},set_transparent__:function(){this.transparent_=this.colorNode.isTransparent()},set_texCoord__:function(){this.texCoordNode&&this.texCoordNode.removeInterest("addNodeEvent",this),this.texCoordNode=o(s.X3DTextureCoordinateNode,this.texCoord_),this.texCoordNode&&this.texCoordNode.addInterest("addNodeEvent",this),this.setCurrentTexCoord(this.texCoordNode)},set_normal__:function(){this.normalNode&&this.normalNode.removeInterest("addNodeEvent",this),this.normalNode=o(s.X3DNormalNode,this.normal_),this.normalNode&&this.normalNode.addInterest("addNodeEvent",this)},getColor:function(){return this.colorNode},getTexCoord:function(){return this.texCoordNode},getNormal:function(){return this.normalNode},getHeight:function(e){return e<this.height_.length?this.height_[e]:0},createTexCoords:function(){for(var e=[],t=this.xDimension_.getValue(),n=this.zDimension_.getValue(),i=t-1,r=n-1,o=0;o<n;++o)for(var s=0;s<t;++s)e.push(new u(s/i,o/r));return e},createNormals:function(e,t,n){for(var i=!this.ccw_.getValue(),r=[],o=[],s=0;s<e.length;++s)r[s]=[];for(var u=0;u<t.length;u+=3){var c=t[u],h=t[u+1],d=t[u+2];r[c].push(o.length),r[h].push(o.length+1),r[d].push(o.length+2);var p=a.normal(e[c],e[h],e[d],new l(0,0,0));i&&p.negate(),o.push(p),o.push(p),o.push(p)}return this.refineNormals(r,o,this.creaseAngle_.getValue())},createCoordIndex:function(){for(var e=[],t=this.xDimension_.getValue(),n=t-1,i=this.zDimension_.getValue()-1,r=0;r<i;++r)for(var o=0;o<n;++o){var s=r*t+o,a=(r+1)*t+o,u=(r+1)*t+(o+1),l=r*t+(o+1);e.push(s),e.push(a),e.push(u),e.push(s),e.push(u),e.push(l)}return e},createPoints:function(){for(var e=[],t=this.xDimension_.getValue(),n=this.zDimension_.getValue(),i=this.xSpacing_.getValue(),r=this.zSpacing_.getValue(),o=0;o<n;++o)for(var s=0;s<t;++s)e.push(new l(i*s,this.getHeight(s+o*t),r*o));return e},build:function(){if(!(this.xDimension_.getValue()<2||this.zDimension_.getValue()<2)){var e=this.colorPerVertex_.getValue(),t=this.normalPerVertex_.getValue(),n=this.createCoordIndex(),i=this.getAttrib(),r=i.length,o=this.getAttribs(),s=this.getColor(),a=this.getTexCoord(),u=this.getNormal(),l=this.createPoints(),c=0;if(a)a.init(this.getTexCoords());else{var h=this.createTexCoords();this.getTexCoords().push([])}for(var d=0,p=n.length;d<p;++c)for(var f=0;f<6;++f,++d){for(var g=n[d],m=0;m<r;++m)i[m].addValue(o[m],g);if(s&&(e?this.addColor(s.get1Color(g)):this.addColor(s.get1Color(c))),a)a.addTexCoord(this.getTexCoords(),g);else{var b=h[g];this.getTexCoords()[0].push(b.x,b.y,0,1)}u&&(t?this.addNormal(u.get1Vector(g)):this.addNormal(u.get1Vector(c))),this.addVertex(l[g])}if(!u)for(var w=this.createNormals(l,n),y=0;y<w.length;++y)this.addNormal(w[y]);this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}}}),c}),define("cobweb/Components/ParticleSystems/ExplosionEmitter",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticleEmitterNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.ExplosionEmitter),this.getRandomVelocity=this.getSphericalRandomVelocity}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"position",new t.SFVec3f),new n(o.inputOutput,"speed",new t.SFFloat),new n(o.inputOutput,"variation",new t.SFFloat(.25)),new n(o.initializeOnly,"mass",new t.SFFloat),new n(o.initializeOnly,"surfaceArea",new t.SFFloat)]),getTypeName:function(){return"ExplosionEmitter"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"emitter"},initialize:function(){r.prototype.initialize.call(this),this.position_.addInterest("set_position__",this),this.set_position__()},set_position__:function(){this.position=this.position_.getValue()},isExplosive:function(){return!0},getRandomPosition:function(e){return e.assign(this.position)}}),s}),define("cobweb/Components/Geometry3D/Extrusion",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l,c){function h(e){r.call(this,e),this.addType(o.Extrusion)}var d=new c,p=[];return h.prototype=e.extend(Object.create(r.prototype),{constructor:h,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"beginCap",new t.SFBool(!0)),new n(o.initializeOnly,"endCap",new t.SFBool(!0)),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"convex",new t.SFBool(!0)),new n(o.initializeOnly,"creaseAngle",new t.SFFloat),new n(o.inputOutput,"crossSection",new t.MFVec2f(new a(1,1),new a(1,-1),new a(-1,-1),new a(-1,1),new a(1,1))),new n(o.inputOutput,"orientation",new t.MFRotation(new l)),new n(o.inputOutput,"scale",new t.MFVec2f(new a(1,1))),new n(o.inputOutput,"spine",new t.MFVec3f(new u(0,0,0),new u(0,1,0)))]),getTypeName:function(){return"Extrusion"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},getClosedOrientation:function(){var e=this.orientation_.getValue();if(e.length){var t=e[0].getValue(),n=e[e.length-1].getValue();return t.equals(n)}return!0},createPoints:function(){for(var e=this.crossSection_.getValue(),t=this.orientation_.getValue(),n=this.scale_.getValue(),i=this.spine_.getValue(),r=[],o=this.createRotations(),s=0,a=i.length;s<a;++s){if(d.identity(),d.translate(i[s].getValue()),t.length&&d.rotate(t[Math.min(s,t.length-1)].getValue()),d.multLeft(o[s]),n.length){var l=n[Math.min(s,n.length-1)].getValue();d.scale(new u(l.x,1,l.y))}for(var c=0,h=e.length;c<h;++c){var p=e[c].getValue();r.push(d.multVecMatrix(new u(p.x,0,p.y)))}}return r},createRotations:function(){for(var e=this.spine_.getValue(),t=e.length,n=e[0].getValue(),i=e[e.length-1].getValue(),r=n.equals(i)&&this.getClosedOrientation(),o=p.length;o<t;++o)p[o]=new c;p.length=t;var s,a,h=new u(0,0,0);if(r)a=u.subtract(e[1].getValue(),e[e.length-2].getValue()).normalize(),h=u.subtract(e[1].getValue(),e[0].getValue()).cross(u.subtract(e[e.length-2].getValue(),e[0].getValue())).normalize();else{a=u.subtract(e[1].getValue(),e[0].getValue()).normalize();for(var o=1,d=e.length-1;o<d&&(h=u.subtract(e[o+1].getValue(),e[o].getValue()).cross(u.subtract(e[o-1].getValue(),e[o].getValue())).normalize()).equals(u.Zero);++o);}a.equals(u.Zero)&&a.set(0,1,0),h.equals(u.Zero)&&(h=new l(new u(0,1,0),a).multVecRot(new u(0,0,1))),s=u.cross(a,h),p[0].set(s.x,s.y,s.z,0,a.x,a.y,a.z,0,h.x,h.y,h.z,0,0,0,0,1);for(var f=a,g=h,o=1,d=e.length-1;o<d;++o)a=u.subtract(e[o+1].getValue(),e[o-1].getValue()).normalize(),h=u.subtract(e[o+1].getValue(),e[o].getValue()).cross(u.subtract(e[o-1].getValue(),e[o].getValue())).normalize(),g.dot(h)<0&&h.negate(),a.equals(u.Zero)?a=f:f=a,h.equals(u.Zero)?h=g:g=h,s=u.cross(a,h),p[o].set(s.x,s.y,s.z,0,a.x,a.y,a.z,0,h.x,h.y,h.z,0,0,0,0,1);return r?p[t-1].assign(p[0]):(a=u.subtract(e[e.length-1].getValue(),e[e.length-2].getValue()).normalize(),e.length>2&&(h=u.subtract(e[e.length-1].getValue(),e[e.length-2].getValue()).cross(u.subtract(e[e.length-3].getValue(),e[e.length-2].getValue())).normalize()),g.dot(h)<0&&h.negate(),a.equals(u.Zero)&&(a=f),h.equals(u.Zero)&&(h=g),s=u.cross(a,h),p[t-1].set(s.x,s.y,s.z,0,a.x,a.y,a.z,0,h.x,h.y,h.z,0,0,0,0,1)),p},build:function(){function e(e,t){return e*o+t}var t=!this.ccw_.getValue(),n=this.crossSection_.getValue(),i=this.spine_.getValue(),r=[];if(!(i.length<2||n.length<2)){this.getTexCoords().push(r);for(var o=n.length,l=i[0].getValue(),c=i[i.length-1].getValue(),h=l.equals(c)&&this.getClosedOrientation(),d=n[0].getValue(),p=n[n.length-1].getValue(),f=d.equals(p),g=n[0].getValue().copy(),m=n[0].getValue().copy(),b=1,w=n.length;b<w;++b)g.min(n[b].getValue()),m.max(n[b].getValue());for(var y=a.subtract(m,g),x=Math.max(y.x,y.y),v=f?n.length-1:n.length,_=[],S=[],C=this.createPoints(),F=0,w=C.length;F<w;++F)_[F]=[];for(var T=n.length-1,N=i.length-1,O=e(0,0),M=e(0,f?0:T),V=0;V<N;++V)for(b=0;b<T;++b){var D=h&&V===i.length-2?0:V+1,I=f&&b===n.length-2?0:b+1,B=e(V,b),E=e(V,I),A=e(D,I),P=e(D,b),L=C[B],R=C[E],k=C[A],z=C[P],j=R.distance(k)>=1e-7,X=z.distance(L)>=1e-7;if(t)var U=s.normal(k,R,L,new u(0,0,0)),G=s.normal(z,k,L,new u(0,0,0));else var U=s.normal(L,R,k,new u(0,0,0)),G=s.normal(L,k,z,new u(0,0,0));if(0==b&&(X?O=B:L=C[B=O]),b==n.length-2&&(j?M=E:k=C[A=M]),j){if(X)r.push(b/T,V/N,0,1);else{q=(V/N+(V+1)/N)/2;r.push(b/T,q,0,1)}_[B].push(S.length),S.push(U),this.addVertex(L),r.push((b+1)/T,V/N,0,1),_[E].push(S.length),S.push(U),this.addVertex(R),r.push((b+1)/T,(V+1)/N,0,1),_[A].push(S.length),S.push(U),this.addVertex(k)}if(X){if(r.push(b/T,V/N,0,1),_[B].push(S.length),S.push(G),this.addVertex(L),j)r.push((b+1)/T,(V+1)/N,0,1);else{var q=((V+1)/N+V/N)/2;r.push((b+1)/T,q,0,1)}_[A].push(S.length),S.push(G),this.addVertex(k),r.push(b/T,(V+1)/N,0,1),_[P].push(S.length),S.push(G),this.addVertex(z)}}S=this.refineNormals(_,S,this.creaseAngle_.getValue());for(var H=0;H<S.length;++H)this.addNormal(S[H]);if(x&&n.length>2){if(this.beginCap_.getValue()){for(var W=0,Y=[],$=[],b=0;b<v;++b)(Z=C[K=e(W,v-1-b)].copy()).index=K,Z.texCoord=a.subtract(n[v-1-b].getValue(),g).divide(x),Y.push(Z);if(this.convex_.getValue()?s.triangulateConvexPolygon(Y,$):s.triangulatePolygon(Y,$),$.length>=3){Q=s.normal(C[$[0].index],C[$[1].index],C[$[2].index],new u(0,0,0));t&&Q.negate(),this.addCap(r,Q,C,$)}}if(this.endCap_.getValue()){for(var W=i.length-1,Y=[],$=[],b=0;b<v;++b){var K=e(W,b),Z=C[K].copy();Z.index=K,Z.texCoord=a.subtract(n[b].getValue(),g).divide(x),Y.push(Z)}if(this.convex_.getValue()?s.triangulateConvexPolygon(Y,$):s.triangulatePolygon(Y,$),$.length>=3){var Q=s.normal(C[$[0].index],C[$[1].index],C[$[2].index],new u(0,0,0));t&&Q.negate(),this.addCap(r,Q,C,$)}}}this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}},addCap:function(e,t,n,i){for(var r=0;r<i.length;r+=3){var o=n[i[r].index],s=n[i[r+1].index],a=n[i[r+2].index],u=i[r].texCoord,l=i[r+1].texCoord,c=i[r+2].texCoord;e.push(u.x,u.y,0,1),e.push(l.x,l.y,0,1),e.push(c.x,c.y,0,1),this.addNormal(t),this.addNormal(t),this.addNormal(t),this.addVertex(o),this.addVertex(s),this.addVertex(a)}}}),h}),define("cobweb/Components/Shaders/X3DVertexAttributeNode",["jquery","cobweb/Components/Rendering/X3DGeometricPropertyNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DVertexAttributeNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Shaders/FloatVertexAttribute",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shaders/X3DVertexAttributeNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.FloatVertexAttribute)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"name",new t.SFString),new n(o.initializeOnly,"numComponents",new t.SFInt32(4)),new n(o.inputOutput,"value",new t.MFFloat)]),getTypeName:function(){return"FloatVertexAttribute"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"attrib"},addValue:function(e,t){var n=s.clamp(this.numComponents_.getValue(),1,4),i=t*n,r=i+n;if(r<=this.value_.length)for(;i<r;++i)e.push(this.value_[i]);else for(;i<r;++i)e.push(0)},enable:function(e,t,n){t.enableFloatAttrib(e,this.name_.getValue(),n,s.clamp(this.numComponents_.getValue(),1,4))},disable:function(e,t){t.disableFloatAttrib(e,this.name_.getValue())}}),a}),define("cobweb/Components/ParticleSystems/ForcePhysicsModel",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticlePhysicsModelNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.ForcePhysicsModel)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"force",new t.SFVec3f(0,-9.8,0))]),getTypeName:function(){return"ForcePhysicsModel"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"physics"},addForce:function(e,t,n,i){this.enabled_.getValue()&&(n[e].assign(this.force_.getValue()),i[e]=0)}}),s}),define("cobweb/Rendering/DependentRenderer",["cobweb/Basic/X3DBaseNode","cobweb/Rendering/X3DRenderObject","cobweb/Bits/TraverseType"],function(e,t,n){function i(n){e.call(this,n),t.call(this,n),this.renderObject=null}return i.prototype=$.extend(Object.create(e.prototype),t.prototype,{constructor:i,initialize:function(){e.prototype.initialize.call(this),t.prototype.initialize.call(this)},isIndependent:function(){return!1},setRenderer:function(e){this.renderObject=e},getBrowser:function(){return this.renderObject.getBrowser()},getLayer:function(){return this.renderObject.getLayer()},getBackground:function(){return this.renderObject.getBackground()},getFog:function(){return this.renderObject.getFog()},getNavigationInfo:function(){return this.renderObject.getNavigationInfo()},getViewpoint:function(){return this.renderObject.getViewpoint()},getLightContainer:function(){return this.renderObject.getLights()[this.lightIndex++]},render:function(e,i){switch(e){case n.COLLISION:case n.DEPTH:t.prototype.render.call(this,e,i);break;case n.DISPLAY:this.lightIndex=0,t.prototype.render.call(this,e,i);for(var r=this.renderObject.getLights(),o=0,s=r.length;o<s;++o)r[o].getModelViewMatrix().pop()}}}),i}),define("cobweb/Components/CubeMapTexturing/GeneratedCubeMapTexture",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/CubeMapTexturing/X3DEnvironmentTextureNode","cobweb/Rendering/DependentRenderer","cobweb/Rendering/DepthBuffer","cobweb/Bits/X3DConstants","cobweb/Bits/TraverseType","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g){function m(e){r.call(this,e),this.addType(a.GeneratedCubeMapTexture),this.renderer=new o(e),this.projectionMatrix=new f,this.transformationMatrix=new f,this.viewVolume=new c}var b=[new h(d.zAxis,new d(0,0,-1)),new h(d.zAxis,new d(0,0,1)),new h(d.zAxis,new d(1,0,0)),new h(d.zAxis,new d(-1,0,0)),new h(d.zAxis,new d(0,-1,0)),new h(d.zAxis,new d(0,1,0))],w=[new d(-1,-1,1),new d(-1,-1,1),new d(-1,-1,1),new d(-1,-1,1),new d(1,1,1),new d(1,1,1)],y=new f;return m.prototype=e.extend(Object.create(r.prototype),{constructor:m,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"update",new t.SFString("NONE")),new n(a.initializeOnly,"size",new t.SFInt32(128)),new n(a.initializeOnly,"textureProperties",new t.SFNode)]),getTypeName:function(){return"GeneratedCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),this.renderer.setup();var e=g.nextPowerOfTwo(this.size_.getValue());if(e>0){e=g.nextPowerOfTwo(e);var t=this.getBrowser().getContext(),n=new Uint8Array(e*e*4);t.bindTexture(this.getTarget(),this.getTexture());for(var i=0;i<6;++i)t.texImage2D(this.getTargets()[i],0,t.RGBA,e,e,0,t.RGBA,t.UNSIGNED_BYTE,n);this.viewport=new p(0,0,e,e),this.frameBuffer=new s(this.getBrowser(),e,e),this.isLive().addInterest("set_live__",this),this.set_live__()}},traverse:function(e,t){e===u.DISPLAY&&"NONE"!==this.update_.getValue()&&this.frameBuffer&&t.isIndependent()&&(t.getGeneratedCubeMapTextures().push(this),this.transformationMatrix.assign(t.getModelViewMatrix().get()).multRight(t.getCameraSpaceMatrix().get()))},renderTexture:function(e,t){this.renderer.setRenderer(e);var n=this.renderer,i=e.getBrowser(),r=e.getLayer(),o=i.getContext(),s=n.getBackground(),a=n.getNavigationInfo(),c=n.getViewpoint(),h=i.getHeadlight(),d=a.headlight_.getValue(),p=a.getNearValue(),m=a.getFarValue(c),x=l.perspective(g.radians(90),p,m,1,1,this.projectionMatrix),v=s.isTransparent();v!==this.transparent_.getValue()&&(this.transparent_=v),this.frameBuffer.bind(),n.getViewVolumes().push(this.viewVolume.set(x,this.viewport,this.viewport)),n.getProjectionMatrix().pushMatrix(x),o.bindTexture(this.getTarget(),this.getTexture()),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);for(var _=0;_<6;++_){o.clear(o.COLOR_BUFFER_BIT),n.getCameraSpaceMatrix().pushMatrix(this.transformationMatrix),n.getCameraSpaceMatrix().rotate(b[_]),n.getCameraSpaceMatrix().scale(w[_]);try{n.getInverseCameraSpaceMatrix().pushMatrix(y.assign(n.getCameraSpaceMatrix().get()).inverse())}catch(e){console.log(e),n.getInverseCameraSpaceMatrix().pushMatrix(f.Identity)}n.getModelViewMatrix().pushMatrix(y),d&&(h.getModelViewMatrix().pushMatrix(y),h.getModelViewMatrix().multLeft(c.getCameraSpaceMatrix())),r.traverse(u.DISPLAY,n),d&&h.getModelViewMatrix().pop(),n.getModelViewMatrix().pop(),n.getCameraSpaceMatrix().pop(),n.getInverseCameraSpaceMatrix().pop();var S=this.frameBuffer.readPixels(),C=this.frameBuffer.getWidth(),F=this.frameBuffer.getHeight();o.texImage2D(this.getTargets()[_],0,o.RGBA,C,F,!1,o.RGBA,o.UNSIGNED_BYTE,S)}this.set_textureQuality__(),n.getProjectionMatrix().pop(),n.getViewVolumes().pop(),this.frameBuffer.unbind(),"NEXT_FRAME_ONLY"===this.update_.getValue()&&(this.update_="NONE")}}),m}),define("cobweb/Components/Geospatial/GeoCoordinate",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DCoordinateNode","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Bits/X3DConstants","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),o.call(this,e),this.addType(s.GeoCoordinate),this.points=[],this.origin=new u(0,0,0)}return l.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:l,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"geoOrigin",new t.SFNode),new n(s.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(s.inputOutput,"point",new t.MFVec3d)]),getTypeName:function(){return"GeoCoordinate"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"coord"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed:function(){for(var e=this.point_.getValue(),t=this.points,n=0,i=Math.min(e.length,t.length);n<i;++n)this.getCoord(e[n].getValue(),t[n]);for(i=e.length;n<i;++n){var r=t[n]=new u(0,0,0);this.getCoord(e[n].getValue(),r)}t.length=i,this.getCoord(u.Zero,this.origin)},isEmpty:function(){return 0==this.point_.length},getSize:function(){return this.point_.length},get1Point:function(e){return e<this.points.length?this.points[e]:this.origin},getNormal:function(e,t,n){var i=this.points,r=i.length;return e<r&&t<r&&n<r?a.normal(i[e],i[t],i[n],new u(0,0,0)):new u(0,0,0)},getQuadNormal:function(e,t,n,i){var r=this.points,o=r.length;return e<o&&t<o&&n<o&&i<o?a.quadNormal(r[e],r[t],r[n],r[i],new u(0,0,0)):new u(0,0,0)}}),l}),define("cobweb/Components/Geospatial/GeoElevationGrid",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Bits/X3DConstants","cobweb/Bits/X3DCast","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u,l,c){function h(e){r.call(this,e),o.call(this,e),this.addType(s.GeoElevationGrid),this.colorNode=null,this.texCoordNode=null,this.normalNode=null}return h.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:h,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"geoOrigin",new t.SFNode),new n(s.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(s.initializeOnly,"geoGridOrigin",new t.SFVec3d),new n(s.initializeOnly,"xDimension",new t.SFInt32),new n(s.initializeOnly,"zDimension",new t.SFInt32),new n(s.initializeOnly,"xSpacing",new t.SFDouble(1)),new n(s.initializeOnly,"zSpacing",new t.SFDouble(1)),new n(s.inputOutput,"yScale",new t.SFFloat(1)),new n(s.initializeOnly,"solid",new t.SFBool(!0)),new n(s.initializeOnly,"ccw",new t.SFBool(!0)),new n(s.initializeOnly,"creaseAngle",new t.SFDouble),new n(s.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(s.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(s.inputOutput,"color",new t.SFNode),new n(s.inputOutput,"texCoord",new t.SFNode),new n(s.inputOutput,"normal",new t.SFNode),new n(s.inputOutput,"height",new t.MFDouble(0,0))]),getTypeName:function(){return"GeoElevationGrid"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.color_.addInterest("set_color__",this),this.texCoord_.addInterest("set_texCoord__",this),this.normal_.addInterest("set_normal__",this),this.set_color__(),this.set_texCoord__(),this.set_normal__()},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("addNodeEvent",this),this.colorNode.removeInterest("set_transparent__",this)),this.colorNode=a(s.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("addNodeEvent",this),this.colorNode.addInterest("set_transparent__",this),this.set_transparent__()):this.transparent_=!1},set_transparent__:function(){this.transparent_=this.colorNode.isTransparent()},set_texCoord__:function(){this.texCoordNode&&this.texCoordNode.removeInterest("addNodeEvent",this),this.texCoordNode=a(s.X3DTextureCoordinateNode,this.texCoord_),this.texCoordNode&&this.texCoordNode.addInterest("addNodeEvent",this),this.setCurrentTexCoord(this.texCoordNode)},set_normal__:function(){this.normalNode&&this.normalNode.removeInterest("addNodeEvent",this),this.normalNode=a(s.X3DNormalNode,this.normal_),this.normalNode&&this.normalNode.addInterest("addNodeEvent",this)},getColor:function(){return this.colorNode},getTexCoord:function(){return this.texCoordNode},getNormal:function(){return this.normalNode},getHeight:function(e){return e<this.height_.length?this.height_[e]*this.yScale_.getValue():0},createTexCoords:function(){for(var e=[],t=this.xDimension_.getValue(),n=this.zDimension_.getValue(),i=t-1,r=n-1,o=0;o<n;++o)for(var s=0;s<t;++s)e.push(new l(s/i,o/r));return e},createNormals:function(e,t,n){for(var i=!this.ccw_.getValue(),r=[],o=[],s=0;s<e.length;++s)r[s]=[];for(var a=0;a<t.length;a+=3){var l=t[a],h=t[a+1],d=t[a+2];r[l].push(o.length),r[h].push(o.length+1),r[d].push(o.length+2);var p=u.normal(e[l],e[h],e[d],new c(0,0,0));i&&p.negate(),o.push(p),o.push(p),o.push(p)}return this.refineNormals(r,o,this.creaseAngle_.getValue())},createCoordIndex:function(){for(var e=[],t=this.xDimension_.getValue(),n=t-1,i=this.zDimension_.getValue()-1,r=0;r<i;++r)for(var o=0;o<n;++o){var s=r*t+o,a=(r+1)*t+o,u=(r+1)*t+(o+1),l=r*t+(o+1);e.push(s),e.push(u),e.push(a),e.push(s),e.push(l),e.push(u)}return e},createPoints:function(){var e=[],t=this.xDimension_.getValue(),n=this.zDimension_.getValue(),i=this.xSpacing_.getValue(),r=this.zSpacing_.getValue();if(this.getStandardOrder())for(o=0;o<n;++o)for(s=0;s<t;++s)(a=new c(r*o,i*s,this.getHeight(s+o*t))).add(this.geoGridOrigin_.getValue()),e.push(this.getCoord(a,a));else for(var o=0;o<n;++o)for(var s=0;s<t;++s){var a=new c(i*s,r*o,this.getHeight(s+o*t));a.add(this.geoGridOrigin_.getValue()),e.push(this.getCoord(a,a))}return e},build:function(){if(!(this.xDimension_.getValue()<2||this.zDimension_.getValue()<2)){var e=this.colorPerVertex_.getValue(),t=this.normalPerVertex_.getValue(),n=this.createCoordIndex(),i=this.getColor(),r=this.getTexCoord(),o=this.getNormal(),s=this.createPoints(),a=0;if(r)r.init(this.getTexCoords());else{var u=this.createTexCoords();this.getTexCoords().push([])}for(var l=0;l<n.length;++a)for(var c=0;c<6;++c,++l){var h=n[l];if(i&&(e?this.addColor(i.get1Color(h)):this.addColor(i.get1Color(a))),r)r.addTexCoord(this.getTexCoords(),h);else{var d=u[h];this.getTexCoords()[0].push(d.x,d.y,0,1)}o&&(t?this.addNormal(o.get1Vector(h)):this.addNormal(o.get1Vector(a))),this.addVertex(s[h])}if(!o)for(var p=this.createNormals(s,n),f=0;f<p.length;++f)this.addNormal(p[f]);this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}}}),h}),define("cobweb/Components/Networking/Inline",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DChildNode","cobweb/Components/Networking/X3DUrlObject","cobweb/Components/Grouping/X3DBoundedObject","cobweb/Components/Grouping/Group","cobweb/Bits/X3DConstants","cobweb/InputOutput/FileLoader"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),o.call(this,e),s.call(this,e),this.addType(u.Inline),this.addChildObjects("buffer",new t.SFTime),this.scene=this.getBrowser().getDefaultScene(),this.group=new a(e),this.getBBox=this.group.getBBox.bind(this.group),this.group.addParent(this)}return c.prototype=e.extend(Object.create(r.prototype),o.prototype,s.prototype,{constructor:c,fieldDefinitions:new i([new n(u.inputOutput,"metadata",new t.SFNode),new n(u.inputOutput,"load",new t.SFBool(!0)),new n(u.inputOutput,"url",new t.MFString),new n(u.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(u.initializeOnly,"bboxCenter",new t.SFVec3f)]),getTypeName:function(){return"Inline"},getComponentName:function(){return"Networking"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),s.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.group.setPrivate(!0),this.group.setup(),this.group.isCameraObject_.addFieldInterest(this.isCameraObject_),this.load_.addInterest("set_load__",this),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.requestAsyncLoad()},set_live__:function(){this.getPrivate()||this.scene.setLive(this.isLive().getValue())},set_load__:function(){this.load_.getValue()?this.buffer_.addEvent():this.requestUnload()},set_url__:function(){this.buffer_.addEvent()},set_buffer__:function(){this.load_.getValue()&&(this.setLoadState(u.NOT_STARTED_STATE),this.requestAsyncLoad())},requestImmediateLoad:function(){try{if(this.checkLoadState()===u.COMPLETE_STATE||this.checkLoadState()===u.IN_PROGRESS_STATE)return;this.setLoadState(u.IN_PROGRESS_STATE),this.setInternalScene(new l(this).createX3DFromURL(this.url_,null))}catch(e){console.log(e),this.setInternalScene(this.getBrowser().getDefaultScene())}},requestAsyncLoad:function(){this.checkLoadState()!==u.COMPLETE_STATE&&this.checkLoadState()!==u.IN_PROGRESS_STATE&&(this.setLoadState(u.IN_PROGRESS_STATE),new l(this).createX3DFromURL(this.url_,null,this.setInternalSceneAsync.bind(this)))},requestUnload:function(){this.checkLoadState()!==u.NOT_STARTED_STATE&&this.checkLoadState()!==u.FAILED_STATE&&(this.setLoadState(u.NOT_STARTED_STATE),this.setInternalScene(this.getBrowser().getDefaultScene()))},setInternalSceneAsync:function(e){e?(this.setLoadState(u.COMPLETE_STATE),this.setInternalScene(e)):(this.setLoadState(u.FAILED_STATE),this.setInternalScene(this.getBrowser().getDefaultScene()))},setInternalScene:function(e){this.scene.setLive(!1),this.scene.rootNodes.removeInterest("setValue",this.group.children_),this.scene=e,this.scene.setExecutionContext(this.getExecutionContext()),this.scene.setPrivate(this.getExecutionContext().getPrivate()),this.scene.setup(),this.scene.rootNodes.addInterest("setValue",this.group.children_),this.group.children_=this.scene.rootNodes,this.set_live__(),this.getBrowser().addBrowserEvent()},getInternalScene:function(){return this.scene},traverse:function(e,t){this.group.traverse(e,t)}}),c}),define("cobweb/Components/Geospatial/GeoLOD",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DChildNode","cobweb/Components/Grouping/X3DBoundedObject","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Bits/X3DConstants","cobweb/Bits/TraverseType","cobweb/Components/Grouping/Group","cobweb/Components/Networking/Inline","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Box3"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p){function f(e){r.call(this,e),o.call(this,e),s.call(this,e),this.addType(a.GeoLOD),this.rootGroup=new l(this.getBrowser().getPrivateScene()),this.rootInline=new c(e),this.child1Inline=new c(e),this.child2Inline=new c(e),this.child3Inline=new c(e),this.child4Inline=new c(e),this.childrenLoaded=!1,this.childBBox=new p,this.keepCurrentLevel=!1,this.modelViewMatrix=new d}var g=new h(0,0,0);return f.prototype=e.extend(Object.create(r.prototype),o.prototype,s.prototype,{constructor:f,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.initializeOnly,"geoOrigin",new t.SFNode),new n(a.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(a.initializeOnly,"rootUrl",new t.MFString),new n(a.initializeOnly,"child1Url",new t.MFString),new n(a.initializeOnly,"child2Url",new t.MFString),new n(a.initializeOnly,"child3Url",new t.MFString),new n(a.initializeOnly,"child4Url",new t.MFString),new n(a.initializeOnly,"center",new t.SFVec3d),new n(a.initializeOnly,"range",new t.SFFloat(10)),new n(a.outputOnly,"level_changed",new t.SFInt32(-1)),new n(a.initializeOnly,"rootNode",new t.MFNode),new n(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(a.initializeOnly,"bboxCenter",new t.SFVec3f),new n(a.outputOnly,"children",new t.MFNode)]),getTypeName:function(){return"GeoLOD"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),s.prototype.initialize.call(this),this.rootNode_.addFieldInterest(this.rootGroup.children_),this.rootGroup.children_=this.rootNode_,this.rootGroup.setPrivate(!0),this.rootGroup.setup(),this.rootInline.loadState_.addInterest("set_rootLoadState__",this),this.child1Inline.loadState_.addInterest("set_childLoadState__",this),this.child2Inline.loadState_.addInterest("set_childLoadState__",this),this.child3Inline.loadState_.addInterest("set_childLoadState__",this),this.child4Inline.loadState_.addInterest("set_childLoadState__",this),this.rootUrl_.addFieldInterest(this.rootInline.url_),this.child1Url_.addFieldInterest(this.child1Inline.url_),this.child2Url_.addFieldInterest(this.child2Inline.url_),this.child3Url_.addFieldInterest(this.child3Inline.url_),this.child4Url_.addFieldInterest(this.child4Inline.url_),this.rootInline.load_=!0,this.child1Inline.load_=!1,this.child2Inline.load_=!1,this.child3Inline.load_=!1,this.child4Inline.load_=!1,this.rootInline.url_=this.rootUrl_,this.child1Inline.url_=this.child1Url_,this.child2Inline.url_=this.child2Url_,this.child3Inline.url_=this.child3Url_,this.child4Inline.url_=this.child4Url_,this.rootInline.setup(),this.child1Inline.setup(),this.child2Inline.setup(),this.child3Inline.setup(),this.child4Inline.setup()},getBBox:function(e){if(this.bboxSize_.getValue().equals(this.defaultBBoxSize)){var t=this.level_changed_.getValue();switch(this.childrenLoaded?t:0){case 0:return this.rootNode_.length?this.rootGroup.getBBox(e):this.rootInline.getBBox(e);case 1:return e.set(),e.add(this.child1Inline.getBBox(this.childBBox)),e.add(this.child2Inline.getBBox(this.childBBox)),e.add(this.child3Inline.getBBox(this.childBBox)),e.add(this.child4Inline.getBBox(this.childBBox)),e}return e.set()}return e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},set_rootLoadState__:function(){0===this.level_changed_.getValue()&&(this.rootNode_.length||this.rootInline.checkLoadState()===a.COMPLETE_STATE&&(this.children_=this.rootInline.getInternalScene().getRootNodes(),this.childrenLoaded=!1))},set_childLoadState__:function(){if(1===this.level_changed_.getValue()){var e=0;if(this.child1Inline.checkLoadState()===a.COMPLETE_STATE){for(var t=0,n=(i=this.child1Inline.getInternalScene().getRootNodes()).length;t<n;++t)this.children_.push(i[t]);++e}else 0===this.child1Inline.url_.length&&++e;if(this.child2Inline.checkLoadState()===a.COMPLETE_STATE){for(var t=0,n=(i=this.child2Inline.getInternalScene().getRootNodes()).length;t<n;++t)this.children_.push(i[t]);++e}else 0===this.child2Inline.url_.length&&++e;if(this.child3Inline.checkLoadState()===a.COMPLETE_STATE){for(var t=0,n=(i=this.child3Inline.getInternalScene().getRootNodes()).length;t<n;++t)this.children_.push(i[t]);++e}else 0===this.child3Inline.url_.length&&++e;if(this.child4Inline.checkLoadState()===a.COMPLETE_STATE){for(var i=this.child4Inline.getInternalScene().getRootNodes(),t=0,n=i.length;t<n;++t)this.children_.push(i[t]);++e}else 0===this.child4Inline.url_.length&&++e;4===e&&(this.childrenLoaded=!0)}},getLevel:function(e){return this.getDistance(e)<this.range_.getValue()?1:0},getDistance:function(e){return e.translate(this.getCoord(this.center_.getValue(),g)),e.origin.abs()},traverse:function(e,t){if(e==u.DISPLAY){var n=this.getLevel(this.modelViewMatrix.assign(t.getModelViewMatrix().get()));if(n!==this.level_changed_.getValue())switch(this.level_changed_=n,n){case 0:this.rootNode_.length?(this.children_=this.rootNode_,this.childrenLoaded=!1):this.rootInline.checkLoadState()==a.COMPLETE_STATE&&(this.children_=this.rootInline.getInternalScene().getRootNodes(),this.childrenLoaded=!1),this.child1Inline.load_=!1,this.child2Inline.load_=!1,this.child3Inline.load_=!1,this.child4Inline.load_=!1;break;case 1:this.child1Inline.load_=!0,this.child2Inline.load_=!0,this.child3Inline.load_=!0,this.child4Inline.load_=!0}}switch(this.childrenLoaded?this.level_changed_.getValue():0){case 0:this.rootNode_.length?this.rootGroup.traverse(e,t):this.rootInline.traverse(e,t);break;case 1:this.child1Inline.traverse(e,t),this.child2Inline.traverse(e,t),this.child3Inline.traverse(e,t),this.child4Inline.traverse(e,t)}}}),f}),define("cobweb/Components/Geospatial/GeoLocation",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DTransformMatrix3DNode","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),o.call(this,e),this.addType(s.GeoLocation)}var l=new a;return u.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(s.inputOutput,"geoCoords",new t.SFVec3d),new n(s.initializeOnly,"geoOrigin",new t.SFNode),new n(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(s.initializeOnly,"bboxCenter",new t.SFVec3f),new n(s.inputOnly,"addChildren",new t.MFNode),new n(s.inputOnly,"removeChildren",new t.MFNode),new n(s.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"GeoLocation"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed:function(){this.setMatrix(this.getLocationMatrix(this.geoCoords_.getValue(),l))}}),u}),define("cobweb/Components/Core/X3DInfoNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DInfoNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Geospatial/GeoMetadata",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DInfoNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.GeoMetadata)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"url",new t.MFString),new n(o.inputOutput,"summary",new t.MFString),new n(o.inputOutput,"data",new t.MFNode)]),getTypeName:function(){return"GeoMetadata"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"children"}}),s}),define("cobweb/Components/Geospatial/GeoOrigin",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Bits/X3DConstants","cobweb/Browser/Geospatial/Geospatial"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.GeoOrigin),this.radians=!1}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(o.inputOutput,"geoCoords",new t.SFVec3d),new n(o.initializeOnly,"rotateYUp",new t.SFBool)]),getTypeName:function(){return"GeoOrigin"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"geoOrigin"},initialize:function(){r.prototype.initialize.call(this),this.geoSystem_.addInterest("set_geoSystem__",this),this.set_geoSystem__()},set_geoSystem__:function(){this.referenceFrame=s.getReferenceFrame(this.geoSystem_,this.radians)},getOrigin:function(e){return this.referenceFrame.convert(this.geoCoords_.getValue(),e)}}),a}),define("cobweb/Components/Geospatial/GeoPositionInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Browser/Geospatial/Geocentric","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),o.call(this,e),this.addType(a.GeoPositionInterpolator),this.geocentric=new s}return l.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:l,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.initializeOnly,"geoOrigin",new t.SFNode),new n(a.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(a.inputOnly,"set_fraction",new t.SFFloat),new n(a.inputOutput,"key",new t.MFFloat),new n(a.inputOutput,"keyValue",new t.MFVec3d),new n(a.outputOnly,"value_changed",new t.SFVec3d),new n(a.outputOnly,"geovalue_changed",new t.SFVec3d)]),keyValue0:new u(0,0,0),keyValue1:new u(0,0,0),geovalue:new u(0,0,0),value:new u(0,0,0),getTypeName:function(){return"GeoPositionInterpolator"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"children"},setup:function(){o.prototype.initialize.call(this),r.prototype.setup.call(this)},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,n=this.keyValue_;n.length<e.length&&n.resize(e.length,n.length?n[n.length-1]:new t.SFVec3f)},interpolate:function(e,t,n){try{this.getCoord(this.keyValue_[e].getValue(),this.keyValue0),this.getCoord(this.keyValue_[t].getValue(),this.keyValue1);var i=this.geocentric.slerp(this.keyValue0,this.keyValue1,n);this.geovalue_changed_=this.getGeoCoord(i,this.geovalue),this.value_changed_=i}catch(e){}}}),l}),define("cobweb/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode",["jquery","cobweb/Fields","cobweb/Components/Core/X3DSensorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r){function o(e){n.call(this,e),this.addType(i.X3DEnvironmentalSensorNode),this.addChildObjects("traversed",new t.SFBool(!0)),this.currentTraversed=!0}return o.prototype=e.extend(Object.create(n.prototype),{constructor:o,initialize:function(){n.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.enabled_.addInterest("set_live__",this),this.size_.addInterest("set_live__",this),this.traversed_.addInterest("set_live__",this),this.set_live__()},set_live__:function(){this.isLive().getValue()&&this.traversed_.getValue()&&this.enabled_.getValue()&&!this.size_.getValue().equals(r.Zero)?this.getBrowser().sensors().addInterest("update",this):(this.getBrowser().sensors().removeInterest("update",this),this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime()))},setTraversed:function(e){e?!1===this.traversed_.getValue()&&(this.traversed_=!0):this.currentTraversed!==this.traversed_.getValue()&&(this.traversed_=this.currentTraversed),this.currentTraversed=e},getTraversed:function(){return this.currentTraversed},update:function(){}}),o}),define("cobweb/Components/EnvironmentalSensor/ProximitySensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(s.ProximitySensor),this.setCameraObject(!0),this.viewpoint=null,this.modelViewMatrix=new l,this.invModelViewMatrix=new l,this.centerOfRotationMatrix=new l,this.position=new a(0,0,0),this.orientation=new u(0,0,1,0),this.centerOfRotation=new a(0,0,0),this.viewer=new a(0,0,0),this.inside=!1}function h(e,t){try{switch(e){case o.CAMERA:return this.viewpoint=t.getViewpoint(),void this.modelViewMatrix.assign(t.getModelViewMatrix().get());case o.DISPLAY:if(this.setTraversed(!0),this.inside)return;if(this.size_.getValue().equals(d))this.inside=!0;else{var n=this.invModelViewMatrix.assign(t.getModelViewMatrix().get()).inverse();this.viewer.set(n[12],n[13],n[14]),this.inside=this.intersectsPoint(this.viewer)}return}}catch(e){}}var d=new a(-1,-1,-1);return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"enabled",new t.SFBool(!0)),new n(s.inputOutput,"size",new t.SFVec3f),new n(s.inputOutput,"center",new t.SFVec3f),new n(s.outputOnly,"enterTime",new t.SFTime),new n(s.outputOnly,"exitTime",new t.SFTime),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"position_changed",new t.SFVec3f),new n(s.outputOnly,"orientation_changed",new t.SFRotation),new n(s.outputOnly,"centerOfRotation_changed",new t.SFVec3f)]),getTypeName:function(){return"ProximitySensor"},getComponentName:function(){return"EnvironmentalSensor"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this),this.size_.addInterest("set_extents__",this),this.center_.addInterest("set_extents__",this),this.traversed_.addFieldInterest(this.isCameraObject_),this.min=new a(0,0,0),this.max=new a(0,0,0),this.set_enabled__(),this.set_extents__()},set_enabled__:function(){this.setCameraObject(this.enabled_.getValue()),this.enabled_.getValue()?this.traverse=h:delete this.traverse},set_extents__:function(){var e=this.size_.getValue(),t=this.center_.getValue(),n=e.x/2,i=e.y/2,r=e.z/2,o=t.x,s=t.y,a=t.z;this.min.set(o-n,s-i,a-r),this.max.set(o+n,s+i,a+r)},update:function(){try{if(this.inside&&this.getTraversed()){var e=this.modelViewMatrix,t=this.centerOfRotationMatrix;t.assign(this.viewpoint.getTransformationMatrix()),t.translate(this.viewpoint.getUserCenterOfRotation()),t.multRight(this.invModelViewMatrix.assign(e).inverse()),e.multRight(this.viewpoint.getInverseCameraSpaceMatrix()),e.get(null,this.orientation),e.inverse(),this.position.set(e[12],e[13],e[14]),this.orientation.inverse(),this.centerOfRotation.set(t[12],t[13],t[14]),this.isActive_.getValue()?(this.position_changed_.getValue().equals(this.position)||(this.position_changed_=this.position),this.orientation_changed_.getValue().equals(this.orientation)||(this.orientation_changed_=this.orientation),this.centerOfRotation_changed_.getValue().equals(this.centerOfRotation)||(this.centerOfRotation_changed_=this.centerOfRotation)):(this.isActive_=!0,this.enterTime_=this.getBrowser().getCurrentTime(),this.position_changed_=this.position,this.orientation_changed_=this.orientation,this.centerOfRotation_changed_=this.centerOfRotation),this.inside=!1}else this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime())}catch(e){}this.setTraversed(!1)},traverse:function(){},intersectsPoint:function(e){var t=this.min,n=this.max;return t.x<=e.x&&n.x>=e.x&&t.y<=e.y&&n.y>=e.y&&t.z<=e.z&&n.z>=e.z}}),c}),define("cobweb/Components/Geospatial/GeoProximitySensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Components/EnvironmentalSensor/ProximitySensor","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),o.call(this,e),this.addType(a.GeoProximitySensor),this.proximitySensor=new s(e),this.setCameraObject(this.proximitySensor.getCameraObject())}var c=new u(0,0,0);return l.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:l,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.initializeOnly,"geoOrigin",new t.SFNode),new n(a.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(a.inputOutput,"enabled",new t.SFBool(!0)),new n(a.inputOutput,"size",new t.SFVec3f),new n(a.inputOutput,"center",new t.SFVec3f),new n(a.outputOnly,"isActive",new t.SFBool),new n(a.outputOnly,"enterTime",new t.SFTime),new n(a.outputOnly,"exitTime",new t.SFTime),new n(a.outputOnly,"geoCoord_changed",new t.SFVec3d),new n(a.outputOnly,"position_changed",new t.SFVec3f),new n(a.outputOnly,"orientation_changed",new t.SFRotation),new n(a.outputOnly,"centerOfRotation_changed",new t.SFVec3f)]),getTypeName:function(){return"GeoProximitySensor"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.enabled_.addFieldInterest(this.proximitySensor.enabled_),this.size_.addFieldInterest(this.proximitySensor.size_),this.center_.addFieldInterest(this.proximitySensor.center_),this.proximitySensor.isCameraObject_.addFieldInterest(this.isCameraObject_),this.proximitySensor.isActive_.addFieldInterest(this.isActive_),this.proximitySensor.enterTime_.addFieldInterest(this.enterTime_),this.proximitySensor.exitTime_.addFieldInterest(this.exitTime_),this.proximitySensor.position_changed_.addFieldInterest(this.position_changed_),this.proximitySensor.orientation_changed_.addFieldInterest(this.orientation_changed_),this.proximitySensor.centerOfRotation_changed_.addFieldInterest(this.centerOfRotation_changed_),this.proximitySensor.position_changed_.addInterest("set_position__",this),this.proximitySensor.enabled_=this.enabled_,this.proximitySensor.size_=this.size_,this.proximitySensor.center_=this.center_,this.proximitySensor.setup()},set_position__:function(e){this.geoCoord_changed_=this.getGeoCoord(this.proximitySensor.position_changed_.getValue(),c)},traverse:function(e,t){this.proximitySensor.traverse(e,t)}}),l}),define("cobweb/Components/Geospatial/GeoTouchSensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/PointingDeviceSensor/X3DTouchSensorNode","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),o.call(this,e),this.addType(s.GeoTouchSensor)}var c=new u,h=new a(0,0,0);return l.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:l,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"geoOrigin",new t.SFNode),new n(s.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(s.inputOutput,"enabled",new t.SFBool(!0)),new n(s.inputOutput,"description",new t.SFString),new n(s.outputOnly,"hitTexCoord_changed",new t.SFVec2f),new n(s.outputOnly,"hitNormal_changed",new t.SFVec3f),new n(s.outputOnly,"hitPoint_changed",new t.SFVec3f),new n(s.outputOnly,"hitGeoCoord_changed",new t.SFVec3d),new n(s.outputOnly,"isOver",new t.SFBool),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"touchTime",new t.SFTime)]),getTypeName:function(){return"GeoTouchSensor"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this)},set_over__:function(e,t,n,i,o){try{if(r.prototype.set_over__.call(this,e,t,n,i,o),this.isOver_.getValue()){var s=t.intersection;c.assign(n).inverse(),this.hitTexCoord_changed_=s.texCoord,this.hitNormal_changed_=n.multMatrixDir(s.normal.copy()).normalize(),this.hitPoint_changed_=c.multVecMatrix(s.point.copy()),this.hitGeoCoord_changed_=this.getGeoCoord(this.hitPoint_changed_.getValue(),h)}}catch(e){console.log(e)}}}),l}),define("cobweb/Components/Geospatial/GeoTransform",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DTransformMatrix3DNode","cobweb/Components/Geospatial/X3DGeospatialObject","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),o.call(this,e),this.addType(s.GeoTransform)}var l=new a,c=new a;return u.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"translation",new t.SFVec3f),new n(s.inputOutput,"rotation",new t.SFRotation),new n(s.inputOutput,"scale",new t.SFVec3f(1,1,1)),new n(s.inputOutput,"scaleOrientation",new t.SFRotation),new n(s.initializeOnly,"geoOrigin",new t.SFNode),new n(s.initializeOnly,"geoSystem",new t.MFString("GD","WE")),new n(s.inputOutput,"geoCenter",new t.SFVec3d),new n(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(s.initializeOnly,"bboxCenter",new t.SFVec3f),new n(s.inputOnly,"addChildren",new t.MFNode),new n(s.inputOnly,"removeChildren",new t.MFNode),new n(s.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"GeoTransform"},getComponentName:function(){return"Geospatial"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed:function(){try{this.setHidden(0===this.scale_.x||0===this.scale_.y||0===this.scale_.z),this.getLocationMatrix(this.geoCenter_.getValue(),c),l.set(this.translation_.getValue(),this.rotation_.getValue(),this.scale_.getValue(),this.scaleOrientation_.getValue()),this.setMatrix(l.multRight(c).multLeft(c.inverse()))}catch(e){this.setHidden(!0)}}}),u}),define("cobweb/Components/CubeMapTexturing/ImageCubeMapTexture",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/CubeMapTexturing/X3DEnvironmentTextureNode","cobweb/Components/Networking/X3DUrlObject","cobweb/Bits/X3DConstants","cobweb/Browser/Networking/urls","standard/Networking/URI","standard/Math/Numbers/Vector2","standard/Math/Algorithm","cobweb/DEBUG"],function(e,t,n,i,r,o,s,a,u,l,c,h){function d(e){r.call(this,e),o.call(this,e),this.addType(s.ImageCubeMapTexture),this.urlStack=new t.MFString}var p=new Uint8Array([255,255,255,255]),f=[new l(1,1),new l(3,1),new l(0,1),new l(2,1),new l(1,0),new l(1,2)];return d.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:d,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"url",new t.MFString),new n(s.initializeOnly,"textureProperties",new t.SFNode)]),getTypeName:function(){return"ImageCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this);var t=this.getBrowser().getContext();t.bindTexture(this.getTarget(),this.getTexture());for(var n=0;n<6;++n)t.texImage2D(this.getTargets()[n],0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,p);this.url_.addInterest("set_url__",this),this.canvas=e("<canvas></canvas>"),this.image=e("<img></img>"),this.image.load(this.setImage.bind(this)),this.image.error(this.setError.bind(this)),this.image.bind("abort",this.setError.bind(this)),this.image[0].crossOrigin="Anonymous",this.requestAsyncLoad()},set_url__:function(){this.setLoadState(s.NOT_STARTED_STATE),this.requestAsyncLoad()},requestAsyncLoad:function(){this.checkLoadState()!==s.COMPLETE_STATE&&this.checkLoadState()!==s.IN_PROGRESS_STATE&&(this.setLoadState(s.IN_PROGRESS_STATE),this.urlStack.setValue(this.url_),this.loadNext())},loadNext:function(){if(0===this.urlStack.length)return this.clear(),void this.setLoadState(s.FAILED_STATE);this.URL=new u(this.urlStack.shift()),this.URL=this.getExecutionContext().getURL().transform(this.URL),this.image.attr("src",this.URL)},setError:function(){var e=this.URL.toString();h&&(this.URL.isLocal()||"localhost"===this.URL.host||e.match(a.fallbackExpression)||this.urlStack.unshift(a.fallbackUrl+e)),"data"!==this.URL.scheme&&console.warn("Error loading image:",this.URL.toString()),this.loadNext()},setImage:function(){h&&"data"!==this.URL.scheme&&console.info("Done loading image cube map texture:",this.URL.toString());try{var e=this.image[0],t=e.width,n=e.height,i=Math.floor(t/4),r=Math.floor(n/3),o=this.canvas[0],a=o.getContext("2d");c.isPowerOfTwo(i)&&c.isPowerOfTwo(r)&&4*i===t&&3*r===n?(o.width=t,o.height=n,a.drawImage(e,0,0)):(t=4*(i=c.nextPowerOfTwo(i)),n=3*(r=c.nextPowerOfTwo(r)),o.width=t,o.height=n,a.drawImage(e,0,0,e.width,e.height,0,0,t,n));var u=this.getBrowser().getContext(),l=!0;u.bindTexture(this.getTarget(),this.getTexture()),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1);for(var d=0;d<6;++d){var p=a.getImageData(f[d].x*i,f[d].y*r,i,r).data;if(l)for(var g=3;g<p.length;g+=4)if(255!==p[g]){l=!1;break}u.texImage2D(this.getTargets()[d],0,u.RGBA,i,r,!1,u.RGBA,u.UNSIGNED_BYTE,new Uint8Array(p))}this.set_textureQuality__();var m=!l;m!==this.transparent_.getValue()&&(this.transparent_=m),this.setLoadState(s.COMPLETE_STATE)}catch(e){console.log(e.message),this.setError()}}}),d}),define("cobweb/Components/Rendering/IndexedLineSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DLineGeometryNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.IndexedLineSet),this.setGeometryType(1),this.colorNode=null,this.coordNode=null}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(s.inputOutput,"colorIndex",new t.MFInt32),new n(s.inputOutput,"coordIndex",new t.MFInt32),new n(s.inputOutput,"attrib",new t.MFNode),new n(s.inputOutput,"fogCoord",new t.SFNode),new n(s.inputOutput,"color",new t.SFNode),new n(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedLineSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.color_.addInterest("set_color__",this),this.coord_.addInterest("set_coord__",this),this.setPrimitiveMode(this.getBrowser().getContext().LINES),this.setSolid(!1),this.set_attrib__(),this.set_color__(),this.set_coord__()},set_attrib__:function(){for(var e=this.getAttrib(),t=0,n=e.length;t<n;++t)e[t].removeInterest("addNodeEvent",this);e.length=0;for(var t=0,n=this.attrib_.length;t<n;++t){var i=o(s.X3DVertexAttributeNode,this.attrib_[t]);i&&e.push(i)}for(t=0;t<this.attribNodes.length;++t)e[t].addInterest("addNodeEvent",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("addNodeEvent",this),this.colorNode.removeInterest("set_transparent__",this)),this.colorNode=o(s.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("addNodeEvent",this),this.colorNode.addInterest("set_transparent__",this),this.set_transparent__()):this.transparent_=!1},set_transparent__:function(){this.transparent_=this.colorNode.isTransparent()},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("addNodeEvent",this),this.coordNode=o(s.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("addNodeEvent",this)},getColorPerVertexIndex:function(e){return e<this.colorIndex_.length?this.colorIndex_[e]:this.coordIndex_[e]},getColorIndex:function(e){return e<this.colorIndex_.length?this.colorIndex_[e]:e},getPolylineIndices:function(){var e=this.coordIndex_.getValue(),t=[],n=[];if(this.coordIndex_.length){for(var i=0,i=0;i<e.length;++i)e[i].getValue()>=0?n.push(i):(t.push(n),n=[]);e[e.length-1].getValue()>=0&&t.push(n)}return t},getPolylines:function(e){if(e.length=0,!this.coordNode||this.coordNode.isEmpty())return e;for(var t=this.getPolylineIndices(),n=this.coordIndex_.getValue(),i=0;i<t.length;++i)for(var r=t[i],o=0,s=r.length-1;o<s;++o)for(var a=o,u=o+2;a<u;++a)e.push(this.coordNode.get1Point(n[r[a]].getValue()));return e},build:function(){if(this.coordNode&&!this.coordNode.isEmpty())for(var e=this.coordIndex_.getValue(),t=this.getPolylineIndices(),n=this.colorPerVertex_.getValue(),i=this.getAttrib(),r=i.length,o=this.getAttribs(),s=this.colorNode,a=this.coordNode,u=0,l=0;l<t.length;++l){var c=t[l];if(c.length>1)for(var h=0,d=c.length-1;h<d;++h)for(var p=h,f=h+2;p<f;++p){for(var g=c[p],m=e[g].getValue(),b=0;b<r;++b)i[b].addValue(o[b],m);s&&(n?this.addColor(s.get1Color(this.getColorPerVertexIndex(g))):this.addColor(s.get1Color(this.getColorIndex(u)))),this.addVertex(a.get1Point(m))}++u}}}),a}),define("cobweb/Components/CADGeometry/IndexedQuadSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.IndexedQuadSet),this.triangleIndex=[]}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.inputOutput,"index",new t.MFInt32),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedQuadSet"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.index_.addInterest("set_index__",this),this.set_index__()},set_index__:function(){var e=this.index_.getValue().length,t=this.triangleIndex;e-=e%4,t.length=0;for(var n=0;n<e;n+=4){var i=n,r=n+1,o=n+2,s=n+3;t.push(i,r,o,i,o,s)}},getTriangleIndex:function(e){return this.triangleIndex[e]},getPolygonIndex:function(e){return this.index_[e]},build:function(){r.prototype.build.call(this,4,this.index_.length,6,this.triangleIndex.length)}}),s}),define("cobweb/Components/Rendering/IndexedTriangleFanSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.IndexedTriangleFanSet),this.triangleIndex=[]}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"index",new t.MFInt32),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedTriangleFanSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.index_.addInterest("set_index__",this),this.set_index__()},set_index__:function(){var e=this.index_.getValue(),t=this.triangleIndex;t.length=0;for(var n=0,i=e.length;n<i;++n){var r=e[n].getValue();if(++n<i){var o=e[n].getValue();if(o<0)continue;for(++n;n<i;++n){var s=e[n].getValue();if(s<0)break;t.push(r,o,s),o=s}}}},getPolygonIndex:function(e){return this.triangleIndex[e]},build:function(){r.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),s}),define("cobweb/Components/Rendering/IndexedTriangleSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.IndexedTriangleSet)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"index",new t.MFInt32),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedTriangleSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},getPolygonIndex:function(e){return this.index_[e]},build:function(){r.prototype.build.call(this,3,this.index_.length,3,this.index_.length)}}),s}),define("cobweb/Components/Rendering/IndexedTriangleStripSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.IndexedTriangleStripSet),this.triangleIndex=[]}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"index",new t.MFInt32),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedTriangleStripSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.index_.addInterest("set_index__",this),this.set_index__()},set_index__:function(){var e=this.index_.getValue(),t=this.triangleIndex;t.length=0;for(var n=0,i=e.length;n<i;++n){var r=e[n].getValue();if(!(r<0)&&++n<i){var o=e[n].getValue();if(o<0)continue;++n;for(var s=0;n<i;++n,++s){var a=e[n].getValue();if(a<0)break;t.push(r,o,a),1&s?o=a:r=a}}}},getPolygonIndex:function(e){return this.triangleIndex[e]},build:function(){r.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),s}),define("cobweb/Components/EventUtilities/IntegerSequencer",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EventUtilities/X3DSequencerNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.IntegerSequencer)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOnly,"previous",new t.SFBool),new n(o.inputOnly,"next",new t.SFBool),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFInt32),new n(o.outputOnly,"value_changed",new t.SFInt32)]),getTypeName:function(){return"IntegerSequencer"},getComponentName:function(){return"EventUtilities"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_index__",this)},getSize:function(){return this.keyValue_.length},sequence:function(e){this.value_changed_=this.keyValue_[e]}}),s}),define("cobweb/Components/EventUtilities/IntegerTrigger",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EventUtilities/X3DTriggerNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.IntegerTrigger)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_boolean",new t.SFBool),new n(o.inputOutput,"integerKey",new t.SFInt32(-1)),new n(o.outputOnly,"triggerValue",new t.SFInt32)]),getTypeName:function(){return"IntegerTrigger"},getComponentName:function(){return"EventUtilities"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.set_boolean_.addInterest("set_boolean__",this)},set_boolean__:function(){this.triggerValue_=this.integerKey_}}),s}),define("cobweb/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode",["jquery","cobweb/Components/Core/X3DSensorNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DKeyDeviceSensorNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.set_live__()},set_live__:function(){this.isLive().getValue()?(this.enabled_.addInterest("set_enabled__",this),this.enabled_.getValue()&&this.enable()):(this.enabled_.removeInterest("set_enabled__",this),this.enabled_.getValue()&&this.disable())},set_enabled__:function(){this.enabled_.getValue()?this.enable():this.disable()},enable:function(){if(!this.isActive_.getValue()){var e=this.getBrowser().getKeyDeviceSensorNode();e&&(e.enabled_=!1,e.isActive_=!1),this.getBrowser().setKeyDeviceSensorNode(this),this.isActive_=!0}},disable:function(){this.isActive_.getValue()&&(this.getBrowser().setKeyDeviceSensorNode(null),this.release(),this.isActive_=!1)},keydown:function(){},keyup:function(){},release:function(){}}),i}),define("cobweb/Components/KeyDeviceSensor/KeySensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.KeySensor)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.outputOnly,"controlKey",new t.SFBool),new n(o.outputOnly,"shiftKey",new t.SFBool),new n(o.outputOnly,"altKey",new t.SFBool),new n(o.outputOnly,"actionKeyPress",new t.SFInt32),new n(o.outputOnly,"actionKeyRelease",new t.SFInt32),new n(o.outputOnly,"keyPress",new t.SFString),new n(o.outputOnly,"keyRelease",new t.SFString),new n(o.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"KeySensor"},getComponentName:function(){return"KeyDeviceSensor"},getContainerField:function(){return"children"},keydown:function(e){switch(e.which){case 16:this.shiftKey_=!0;break;case 17:this.controlKey_=!0;break;case 18:this.altKey_=!0;break;case 112:this.actionKeyPress_=1;break;case 113:this.actionKeyPress_=2;break;case 114:this.actionKeyPress_=3;break;case 115:this.actionKeyPress_=4;break;case 116:this.actionKeyPress_=5;break;case 117:this.actionKeyPress_=6;break;case 118:this.actionKeyPress_=7;break;case 119:this.actionKeyPress_=8;break;case 120:this.actionKeyPress_=9;break;case 121:this.actionKeyPress_=10;break;case 122:this.actionKeyPress_=11;break;case 123:this.actionKeyPress_=12;break;case 36:this.actionKeyPress_=13;break;case 35:this.actionKeyPress_=14;break;case 33:this.actionKeyPress_=15;break;case 34:this.actionKeyPress_=16;break;case 38:this.actionKeyPress_=17;break;case 40:this.actionKeyPress_=18;break;case 37:this.actionKeyPress_=19;break;case 39:this.actionKeyPress_=20;break;default:e.charCode&&(this.keyPress_=e.key)}},keyup:function(e){switch(e.which){case 16:this.shiftKey_=!1;break;case 17:this.controlKey_=!1;break;case 18:this.altKey_=!1;break;case 112:this.actionKeyRelease_=1;break;case 113:this.actionKeyRelease_=2;break;case 114:this.actionKeyRelease_=3;break;case 115:this.actionKeyRelease_=4;break;case 116:this.actionKeyRelease_=5;break;case 117:this.actionKeyRelease_=6;break;case 118:this.actionKeyRelease_=7;break;case 119:this.actionKeyRelease_=8;break;case 120:this.actionKeyRelease_=9;break;case 121:this.actionKeyRelease_=10;break;case 122:this.actionKeyRelease_=11;break;case 123:this.actionKeyRelease_=12;break;case 36:this.actionKeyRelease_=13;break;case 35:this.actionKeyRelease_=14;break;case 33:this.actionKeyRelease_=15;break;case 34:this.actionKeyRelease_=16;break;case 38:this.actionKeyRelease_=17;break;case 40:this.actionKeyRelease_=18;break;case 37:this.actionKeyRelease_=19;break;case 39:this.actionKeyRelease_=20;break;default:e.charCode&&(this.keyRelease_=e.key)}},release:function(){this.shiftKey_.getValue()&&(this.shiftKey_=!1),this.controlKey_.getValue()&&(this.controlKey_=!1),this.altKey_.getValue()&&(this.altKey_=!1)}}),s}),define("cobweb/Components/Navigation/LOD",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DCast","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(a.LOD),this.addAlias("level",this.children_),this.frameRate=60,this.keepCurrentLevel=!1}return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.initializeOnly,"forceTransitions",new t.SFBool),new n(a.initializeOnly,"center",new t.SFVec3f),new n(a.initializeOnly,"range",new t.MFFloat),new n(a.outputOnly,"level_changed",new t.SFInt32(-1)),new n(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(a.initializeOnly,"bboxCenter",new t.SFVec3f),new n(a.inputOnly,"addChildren",new t.MFNode),new n(a.inputOnly,"removeChildren",new t.MFNode),new n(a.inputOutput,"children",new t.MFNode)]),modelViewMatrix:new u,getTypeName:function(){return"LOD"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.child=this.getChild(this.level_changed_.getValue()),this.set_cameraObjects__()},set_cameraObjects__:function(){this.child&&this.child.getCameraObject?this.setCameraObject(this.child.getCameraObject()):this.setCameraObject(!1)},getBBox:function(e){if(this.bboxSize_.getValue().equals(this.defaultBBoxSize)){var t=o(a.X3DBoundedObject,this.child);return t?t.getBBox(e):e.set()}return e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},getLevel:function(e,t){if(0===this.range_.length){var n=this.children_.length;if(n<2)return 0;if(this.frameRate=(179*this.frameRate+e.currentFrameRate)/180,2===n)return Number(this.frameRate>55);var i=n-1,r=Math.max((this.frameRate-20)/35,0);return Math.min(Math.ceil(r*(i-1)),i)}var o=this.getDistance(t);return l.upperBound(this.range_,0,this.range_.length,o,l.less)},getDistance:function(e){return e.translate(this.center_.getValue()),e.origin.abs()},traverse:function(e,t){if(!this.keepCurrentLevel&&e===s.DISPLAY){var n=this.getLevel(t.getBrowser(),this.modelViewMatrix.assign(t.getModelViewMatrix().get())),i=this.level_changed_.getValue();this.forceTransitions_.getValue()&&(n>i?n=i+1:n<i&&(n=i-1)),n!==i&&(this.level_changed_=n,this.child=this.getChild(Math.min(n,this.children_.length-1)),this.set_cameraObjects__())}this.child&&this.child.traverse(e,t)}}),c}),define("cobweb/Components/Layout/X3DLayoutNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DLayoutNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Layout/Layout",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Layout/X3DLayoutNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l,c){function h(e){r.call(this,e),this.addType(s.Layout),this.alignX=f,this.alignY=f,this.offsetUnitX=w,this.offsetUnitY=w,this.offsetX=0,this.offsetY=0,this.sizeUnitX=w,this.sizeUnitY=w,this.sizeX=1,this.sizeY=1,this.scaleModeX=v,this.scaleModeY=v,this.parent=null,this.rectangleCenter=new a(0,0),this.rectangleSize=new a(0,0),this.matrix=new c}var d=0,p=d++,f=d++,g=d++,m=d++,b=d++,w=d++,y=d++,x=d++,v=d++,_=d++;return h.prototype=e.extend(Object.create(r.prototype),{constructor:h,viewportPixel:new a(0,0),pixelSize:new a(0,0),translation:new u(0,0,0),offset:new u(0,0,0),scale:new u(1,1,1),currentTranslation:new u(0,0,0),currentRotation:new l(0,0,1,0),currentScale:new u(0,0,0),modelViewMatrix:new c,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"align",new t.MFString("CENTER","CENTER")),new n(s.inputOutput,"offsetUnits",new t.MFString("WORLD","WORLD")),new n(s.inputOutput,"offset",new t.MFFloat(0,0)),new n(s.inputOutput,"sizeUnits",new t.MFString("WORLD","WORLD")),new n(s.inputOutput,"size",new t.MFFloat(1,1)),new n(s.inputOutput,"scaleMode",new t.MFString("NONE","NONE"))]),getTypeName:function(){return"Layout"},getComponentName:function(){return"Layout"},getContainerField:function(){return"layout"},initialize:function(){r.prototype.initialize.call(this),this.align_.addInterest("set_align__",this),this.offsetUnits_.addInterest("set_offsetUnits__",this),this.offset_.addInterest("set_offset__",this),this.sizeUnits_.addInterest("set_sizeUnits__",this),this.size_.addInterest("set_size__",this),this.scaleMode_.addInterest("set_scaleMode__",this),this.set_align__(),this.set_offsetUnits__(),this.set_offset__(),this.set_sizeUnits__(),this.set_size__(),this.set_scaleMode__()},set_align__:function(){this.align_.length>0?"LEFT"===this.align_[0]?this.alignX=p:"RIGHT"===this.align_[0]?this.alignX=g:this.alignX=f:this.alignX=f,this.align_.length>1?"BOTTOM"===this.align_[1]?this.alignY=m:"TOP"===this.align_[1]?this.alignY=b:this.alignY=f:this.alignY=f},set_offsetUnits__:function(){this.offsetUnits_.length>0?("FRACTION"===this.offsetUnits_[0]?this.offsetUnitX=y:"PIXEL"===this.offsetUnits_[0]?this.offsetUnitX=x:this.offsetUnitX=w,this.offsetUnits_.length>1?"FRACTION"===this.offsetUnits_[1]?this.offsetUnitY=y:"PIXEL"===this.offsetUnits_[1]?this.offsetUnitY=x:this.offsetUnitY=w:this.offsetUnitY=this.offsetUnitX):(this.offsetUnitX=w,this.offsetUnitY=w)},set_offset__:function(){this.offset_.length>0?(this.offsetX=this.offset_[0],this.offset_.length>1?this.offsetY=this.offset_[1]:this.offsetY=offsetX):(this.offsetX=0,this.offsetY=0)},set_sizeUnits__:function(){this.sizeUnits_.length>0?("FRACTION"===this.sizeUnits_[0]?this.sizeUnitX=y:"PIXEL"===this.sizeUnits_[0]?this.sizeUnitX=x:this.sizeUnitX=w,this.sizeUnits_.length>1?"FRACTION"===this.sizeUnits_[1]?this.sizeUnitY=y:"PIXEL"===this.sizeUnits_[1]?this.sizeUnitY=x:this.sizeUnitY=w:this.sizeUnitY=this.sizeUnitX):(this.sizeUnitX=w,this.sizeUnitY=w)},set_size__:function(){this.size_.length>0?(this.sizeX=this.size_[0],this.size_.length>1?this.sizeY=this.size_[1]:this.sizeY=this.sizeX):(this.sizeX=0,this.sizeY=0)},set_scaleMode__:function(){this.scaleMode_.length>0?("FRACTION"===this.scaleMode_[0]?this.scaleModeX=y:"PIXEL"===this.scaleMode_[0]?this.scaleModeX=x:"STRETCH"===this.scaleMode_[0]?this.scaleModeX=_:this.scaleModeX=v,this.scaleMode_.length>1?"FRACTION"===this.scaleMode_[1]?this.scaleModeY=y:"PIXEL"===this.scaleMode_[1]?this.scaleModeY=x:"STRETCH"===this.scaleMode_[1]?this.scaleModeY=_:this.scaleModeY=v:this.scaleModeY=this.scaleModeX):(this.scaleModeX=v,this.scaleModeY=v)},getRectangleCenter:function(){return this.rectangleCenter},getRectangleSize:function(){return this.rectangleSize},getAlignX:function(){return this.alignX},getAlignY:function(){return this.alignY},getOffsetUnitX:function(){return this.offsetUnitX===w?this.parent?this.parent.getOffsetUnitX():y:this.offsetUnitX},getOffsetUnitY:function(){return this.offsetUnitY===w?this.parent?this.parent.getOffsetUnitY():y:this.offsetUnitY},getOffsetX:function(){return this.offsetX},getOffsetY:function(){return this.offsetY},getSizeUnitX:function(){return this.sizeUnitX===w?this.parent?this.parent.getSizeUnitX():y:this.sizeUnitX},getSizeUnitY:function(){return this.sizeUnitY===w?this.parent?this.parent.getSizeUnitY():y:this.sizeUnitY},getSizeX:function(){return this.sizeX},getSizeY:function(){return this.sizeY},getScaleModeX:function(){return this.parent?this.scaleModeX:this.scaleModeX===v?y:this.scaleModeX},getScaleModeY:function(){return this.parent?this.scaleModeY:this.scaleModeY===v?y:this.scaleModeY},transform:function(e,t){var n=this.matrix,i=o(s.OrthoViewpoint,t.getViewpoint());if(i){var r=this.parent=t.getParentLayout(),a=t.getViewVolume().getScissor(),u=i.getViewportSize(a),l=this.viewportPixel,c=this.pixelSize,h=r?r.getRectangleSize():u,d=this.rectangleSize,w=this.rectangleCenter;switch(l.set(a[2],a[3]),c.assign(u).divVec(l),this.getSizeUnitX()){case y:d.x=this.sizeX*h.x;break;case x:d.x=this.sizeX*c.x}switch(this.getSizeUnitY()){case y:d.y=this.sizeY*h.y;break;case x:d.y=this.sizeY*c.y}var S=this.translation.set(0,0,0);switch(this.getAlignX()){case p:S.x=-(h.x-d.x)/2;break;case f:this.getSizeUnitX()===x&&1&l.x&&(S.x=-c.x/2);break;case g:S.x=(h.x-d.x)/2}switch(this.getAlignY()){case m:S.y=-(h.y-d.y)/2;break;case f:this.getSizeUnitX===x&&1&l.y&&(S.y=-c.y/2);break;case b:S.y=(h.y-d.y)/2}var C=this.offset.set(0,0,0);switch(this.getOffsetUnitX()){case y:C.x=this.offsetX*h.x;break;case x:C.x=this.offsetX*u.x/l.x}switch(this.getOffsetUnitY()){case y:C.y=this.offsetY*h.y;break;case x:C.y=this.offsetY*u.y/l.y}var F=this.scale.set(1,1,1),T=this.currentTranslation,N=this.currentRotation,O=this.currentScale;switch(t.getModelViewMatrix().get().get(T,N,O),this.getScaleModeX()){case v:F.x=O.x;break;case y:F.x=d.x;break;case _:break;case x:F.x=u.x/l.x}switch(this.getScaleModeY()){case v:F.y=O.y;break;case y:F.y=d.y;break;case _:break;case x:F.y=u.y/l.y}this.getScaleModeX()===_?this.getScaleModeY()===_?d.x>d.y?(F.x=d.x,F.y=F.x):(F.y=d.y,F.x=F.y):F.x=F.y:this.getScaleModeY()===_&&(F.y=F.x),w.assign(S).add(C),n.set(T,N),n.translate(S.add(C)),n.scale(F)}else n.identity();return n}}),h}),define("cobweb/Components/Layout/LayoutGroup",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DCast","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(a.LayoutGroup),this.viewportNode=null,this.layoutNode=null,this.modelViewMatrix=new u,this.screenMatrix=new u}return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"layout",new t.SFNode),new n(a.inputOutput,"viewport",new t.SFNode),new n(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(a.initializeOnly,"bboxCenter",new t.SFVec3f),new n(a.inputOnly,"addChildren",new t.MFNode),new n(a.inputOnly,"removeChildren",new t.MFNode),new n(a.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"LayoutGroup"},getComponentName:function(){return"Layout"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.viewport_.addInterest("set_viewport__",this),this.layout_.addInterest("set_layout__",this),this.set_viewport__(),this.set_layout__()},set_viewport__:function(){this.viewportNode=o(a.X3DViewportNode,this.viewport_)},set_layout__:function(){this.layoutNode=o(a.X3DLayoutNode,this.layout_)},getBBox:function(e){return r.prototype.getBBox.call(this,e).multRight(this.getMatrix())},getMatrix:function(){try{this.layoutNode?this.matrix.assign(this.modelViewMatrix).inverse().multLeft(this.screenMatrix):this.matrix.identity()}catch(e){}return this.matrix},traverse:function(e,t){switch(e){case s.POINTER:case s.CAMERA:case s.DEPTH:case s.DISPLAY:if(this.viewportNode&&this.viewportNode.push(),this.layoutNode){var n=t.getModelViewMatrix();this.modelViewMatrix.assign(n.get()),n.push(),n.set(this.screenMatrix.assign(this.layoutNode.transform(e,t))),t.getLayouts().push(this.layoutNode),r.prototype.traverse.call(this,e,t),t.getLayouts().pop(),n.pop()}else r.prototype.traverse.call(this,e,t);this.viewportNode&&this.viewportNode.pop()}}}),l}),define("cobweb/Components/Layout/LayoutLayer",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Layering/X3DLayerNode","cobweb/Components/Layout/LayoutGroup","cobweb/Components/Navigation/OrthoViewpoint","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e,new s(e),new o(e)),this.addType(a.LayoutLayer)}return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"isPickable",new t.SFBool(!0)),new n(a.inputOutput,"layout",new t.SFNode),new n(a.inputOutput,"viewport",new t.SFNode),new n(a.inputOnly,"addChildren",new t.MFNode),new n(a.inputOnly,"removeChildren",new t.MFNode),new n(a.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"LayoutLayer"},getComponentName:function(){return"Layout"},getContainerField:function(){return"layers"},initialize:function(){this.layout_.addFieldInterest(this.getGroup().layout_),this.getGroup().layout_=this.layout_,r.prototype.initialize.call(this)}}),u}),define("cobweb/Components/Shape/LineProperties",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shape/X3DAppearanceChildNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.LineProperties)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"applied",new t.SFBool(!0)),new n(o.inputOutput,"linetype",new t.SFInt32(1)),new n(o.inputOutput,"linewidthScaleFactor",new t.SFFloat)]),getTypeName:function(){return"LineProperties"},getComponentName:function(){return"Shape"},getContainerField:function(){return"lineProperties"},initialize:function(){r.prototype.initialize.call(this),this.linewidthScaleFactor_.addInterest("set_linewidthScaleFactor__",this),this.set_linewidthScaleFactor__()},getLinewidthScaleFactor:function(){return this.linewidthScaleFactor},set_linewidthScaleFactor__:function(){this.linewidthScaleFactor=Math.max(1,this.linewidthScaleFactor_.getValue())}}),s}),define("cobweb/Components/Rendering/LineSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DLineGeometryNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.LineSet),this.setGeometryType(1),this.colorNode=null,this.coordNode=null}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"vertexCount",new t.MFInt32),new n(s.inputOutput,"attrib",new t.MFNode),new n(s.inputOutput,"fogCoord",new t.SFNode),new n(s.inputOutput,"color",new t.SFNode),new n(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"LineSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.color_.addInterest("set_color__",this),this.coord_.addInterest("set_coord__",this),this.setPrimitiveMode(this.getBrowser().getContext().LINES),this.setSolid(!1),this.set_attrib__(),this.set_color__(),this.set_coord__()},set_attrib__:function(){for(var e=this.getAttrib(),t=0,n=e.length;t<n;++t)e[t].removeInterest("addNodeEvent",this);e.length=0;for(var t=0,n=this.attrib_.length;t<n;++t){var i=o(s.X3DVertexAttributeNode,this.attrib_[t]);i&&e.push(i)}for(t=0;t<this.attribNodes.length;++t)e[t].addInterest("addNodeEvent",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("addNodeEvent",this),this.colorNode.removeInterest("set_transparent__",this)),this.colorNode=o(s.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("addNodeEvent",this),this.colorNode.addInterest("set_transparent__",this),this.set_transparent__()):this.transparent_=!1},set_transparent__:function(){this.transparent_=this.colorNode.isTransparent()},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("addNodeEvent",this),this.coordNode=o(s.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("addNodeEvent",this)},build:function(){if(this.coordNode&&!this.coordNode.isEmpty())for(var e=this.vertexCount_.getValue(),t=this.getAttrib().length,n=this.getAttribs(),i=this.colorNode,r=this.coordNode,o=r.getSize(),s=0,a=0,u=e.length;a<u;++a){var l=e[a].getValue();if(s+l>o)break;if(l>1){l=2*l-2;for(var c=0;c<l;++c,s+=1&c){for(var h=0;h<t;++h)attrib[h].addValue(n[h],s);i&&this.addColor(i.get1Color(s)),this.addVertex(r.get1Point(s))}++s}else s+=l}}}),a}),define("cobweb/Components/EnvironmentalEffects/LocalFog",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DChildNode","cobweb/Components/EnvironmentalEffects/X3DFogObject","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.LocalFog)}return a.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"enabled",new t.SFBool(!0)),new n(s.inputOutput,"fogType",new t.SFString("LINEAR")),new n(s.inputOutput,"color",new t.SFColor(1,1,1)),new n(s.inputOutput,"visibilityRange",new t.SFFloat)]),getTypeName:function(){return"LocalFog"},getComponentName:function(){return"EnvironmentalEffects"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this)},push:function(e){this.enabled_.getValue()&&e.pushLocalFog(this)},pop:function(e){this.enabled_.getValue()&&e.popLocalFog()}}),a}),define("cobweb/Components/Shape/X3DMaterialNode",["jquery","cobweb/Components/Shape/X3DAppearanceChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DMaterialNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Shape/Material",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shape/X3DMaterialNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.Material),this.diffuseColor=new Float32Array(3),this.specularColor=new Float32Array(3),this.emissiveColor=new Float32Array(3)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"ambientIntensity",new t.SFFloat(.2)),new n(o.inputOutput,"diffuseColor",new t.SFColor(.8,.8,.8)),new n(o.inputOutput,"specularColor",new t.SFColor),new n(o.inputOutput,"emissiveColor",new t.SFColor),new n(o.inputOutput,"shininess",new t.SFFloat(.2)),new n(o.inputOutput,"transparency",new t.SFFloat)]),getTypeName:function(){return"Material"},getComponentName:function(){return"Shape"},getContainerField:function(){return"material"},initialize:function(){r.prototype.initialize.call(this),this.addChildObjects("transparent",new t.SFBool),this.ambientIntensity_.addInterest("set_ambientIntensity__",this),this.diffuseColor_.addInterest("set_diffuseColor__",this),this.specularColor_.addInterest("set_specularColor__",this),this.emissiveColor_.addInterest("set_emissiveColor__",this),this.shininess_.addInterest("set_shininess__",this),this.transparency_.addInterest("set_transparency__",this),this.set_ambientIntensity__(),this.set_diffuseColor__(),this.set_specularColor__(),this.set_emissiveColor__(),this.set_shininess__(),this.set_transparency__()},set_ambientIntensity__:function(){this.ambientIntensity=Math.max(this.ambientIntensity_.getValue(),0)},set_diffuseColor__:function(){var e=this.diffuseColor,t=this.diffuseColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_specularColor__:function(){var e=this.specularColor,t=this.specularColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_emissiveColor__:function(){var e=this.emissiveColor,t=this.emissiveColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_shininess__:function(){this.shininess=s.clamp(this.shininess_.getValue(),0,1)},set_transparency__:function(){var e=s.clamp(this.transparency_.getValue(),0,1);this.transparency=e,e!=this.transparent_.getValue()&&(this.transparent_=e)},setShaderUniforms:function(e,t){e.uniform1i(t.x3d_SeparateBackColor,!1),e.uniform1f(t.x3d_AmbientIntensity,this.ambientIntensity),e.uniform3fv(t.x3d_DiffuseColor,this.diffuseColor),e.uniform3fv(t.x3d_SpecularColor,this.specularColor),e.uniform3fv(t.x3d_EmissiveColor,this.emissiveColor),e.uniform1f(t.x3d_Shininess,this.shininess),e.uniform1f(t.x3d_Transparency,this.transparency)}}),a}),define("cobweb/Components/Shaders/Matrix3VertexAttribute",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shaders/X3DVertexAttributeNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Matrix3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.Matrix3VertexAttribute)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"name",new t.SFString),new n(o.inputOutput,"value",new t.MFMatrix3f)]),getTypeName:function(){return"Matrix3VertexAttribute"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"attrib"},addValue:function(e,t){if(t<this.value_.length)for(var n=this.value_[t].getValue(),i=0;i<9;++i)e.push(n[i]);else for(var n=s.Identity,i=0;i<9;++i)e.push(n[i])},enable:function(e,t,n){t.enableMatrix3Attrib(e,this.name_.getValue(),n)},disable:function(e,t){t.disableMatrix3Attrib(e,this.name_.getValue())}}),a}),define("cobweb/Components/Shaders/Matrix4VertexAttribute",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shaders/X3DVertexAttributeNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.Matrix4VertexAttribute)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"name",new t.SFString),new n(o.inputOutput,"value",new t.MFMatrix4f)]),getTypeName:function(){return"Matrix4VertexAttribute"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"attrib"},addValue:function(e,t){if(t<this.value_.length)for(var n=this.value_[t].getValue(),i=0;i<16;++i)e.push(n[i]);else for(var n=Matrix4.Identity,i=0;i<16;++i)e.push(n[i])},enable:function(e,t,n){t.enableMatrix4Attrib(e,this.name_.getValue(),n)},disable:function(e,t){t.disableMatrix4Attrib(e,this.name_.getValue())}}),s}),define("cobweb/Components/Core/X3DMetadataObject",["jquery","cobweb/Bits/X3DConstants"],function(e,t){function n(e){this.addType(t.X3DMetadataObject)}return n.prototype={constructor:n,initialize:function(){}},n}),define("cobweb/Components/Core/MetadataBoolean",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Components/Core/X3DMetadataObject","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.MetadataBoolean)}return a.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"name",new t.SFString),new n(s.inputOutput,"reference",new t.SFString),new n(s.inputOutput,"value",new t.MFBool)]),getTypeName:function(){return"MetadataBoolean"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),a}),define("cobweb/Components/Core/MetadataDouble",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Components/Core/X3DMetadataObject","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.MetadataDouble)}return a.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"name",new t.SFString),new n(s.inputOutput,"reference",new t.SFString),new n(s.inputOutput,"value",new t.MFDouble)]),getTypeName:function(){return"MetadataDouble"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),a}),define("cobweb/Components/Core/MetadataFloat",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Components/Core/X3DMetadataObject","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.MetadataFloat)}return a.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"name",new t.SFString),new n(s.inputOutput,"reference",new t.SFString),new n(s.inputOutput,"value",new t.MFFloat)]),getTypeName:function(){return"MetadataFloat"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),a}),define("cobweb/Components/Core/MetadataInteger",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Components/Core/X3DMetadataObject","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.MetadataInteger)}return a.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"name",new t.SFString),new n(s.inputOutput,"reference",new t.SFString),new n(s.inputOutput,"value",new t.MFInt32)]),getTypeName:function(){return"MetadataInteger"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),a}),define("cobweb/Components/Core/MetadataSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Components/Core/X3DMetadataObject","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.MetadataSet)}return a.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"name",new t.SFString),new n(s.inputOutput,"reference",new t.SFString),new n(s.inputOutput,"value",new t.MFNode)]),getTypeName:function(){return"MetadataSet"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),a}),define("cobweb/Components/Core/MetadataString",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DNode","cobweb/Components/Core/X3DMetadataObject","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),o.call(this,e),this.addType(s.MetadataString)}return a.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"name",new t.SFString),new n(s.inputOutput,"reference",new t.SFString),new n(s.inputOutput,"value",new t.MFString)]),getTypeName:function(){return"MetadataString"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),a}),define("cobweb/Components/Texturing/MovieTexture",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTexture2DNode","cobweb/Components/Sound/X3DSoundSourceNode","cobweb/Components/Networking/X3DUrlObject","cobweb/Bits/X3DConstants","cobweb/Browser/Networking/urls","standard/Networking/URI","standard/Math/Algorithm","cobweb/DEBUG"],function(e,t,n,i,r,o,s,a,u,l,c,h){function d(e){r.call(this,e),o.call(this,e),s.call(this,e),this.addType(a.MovieTexture),this.urlStack=new t.MFString}return d.prototype=e.extend(Object.create(r.prototype),o.prototype,s.prototype,{constructor:d,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"enabled",new t.SFBool(!0)),new n(a.inputOutput,"description",new t.SFString),new n(a.inputOutput,"url",new t.MFString),new n(a.inputOutput,"speed",new t.SFFloat(1)),new n(a.inputOutput,"pitch",new t.SFFloat(1)),new n(a.inputOutput,"loop",new t.SFBool),new n(a.inputOutput,"startTime",new t.SFTime),new n(a.inputOutput,"resumeTime",new t.SFTime),new n(a.inputOutput,"pauseTime",new t.SFTime),new n(a.inputOutput,"stopTime",new t.SFTime),new n(a.outputOnly,"isPaused",new t.SFBool),new n(a.outputOnly,"isActive",new t.SFBool),new n(a.outputOnly,"cycleTime",new t.SFTime),new n(a.outputOnly,"elapsedTime",new t.SFTime),new n(a.outputOnly,"duration_changed",new t.SFTime(-1)),new n(a.initializeOnly,"repeatS",new t.SFBool(!0)),new n(a.initializeOnly,"repeatT",new t.SFBool(!0)),new n(a.initializeOnly,"textureProperties",new t.SFNode)]),getTypeName:function(){return"MovieTexture"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),s.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.canvas=e("<canvas></canvas>"),this.video=e("<video></video>"),this.video.error(this.setError.bind(this)),this.video.bind("abort",this.setError.bind(this)),this.video[0].preload="auto",this.video[0].volume=0,this.video[0].crossOrigin="Anonymous",this.requestAsyncLoad()},set_url__:function(){this.setLoadState(a.NOT_STARTED_STATE),this.requestAsyncLoad()},requestAsyncLoad:function(){this.checkLoadState()!==a.COMPLETE_STATE&&this.checkLoadState()!==a.IN_PROGRESS_STATE&&(this.setLoadState(a.IN_PROGRESS_STATE),this.setMedia(null),this.urlStack.setValue(this.url_),this.video.bind("canplaythrough",this.setVideo.bind(this)),this.loadNext())},loadNext:function(){if(0===this.urlStack.length)return this.duration_changed_=-1,this.clear(),void this.setLoadState(a.FAILED_STATE);this.URL=new l(this.urlStack.shift()),this.URL=this.getExecutionContext().getURL().transform(this.URL),this.video.attr("src",this.URL)},setError:function(){var e=this.URL.toString();h&&(this.URL.isLocal()||"localhost"===this.URL.host||e.match(u.fallbackExpression)||this.urlStack.unshift(u.fallbackUrl+e)),"data"!==this.URL.scheme&&console.warn("Error loading movie:",this.URL.toString()),this.loadNext()},setVideo:function(){h&&"data"!==this.URL.scheme&&console.info("Done loading movie:",this.URL.toString());var e=this.video[0];try{var t=e.videoWidth,n=e.videoHeight,i=this.canvas[0],r=i.getContext("2d");if(!c.isPowerOfTwo(t)||!c.isPowerOfTwo(n))throw new Error("The movie texture is a non power-of-two texture.");i.width=t,i.height=n,r.drawImage(e,0,0);var o=r.getImageData(0,0,t,n).data;setTimeout(function(){this.video.unbind("canplaythrough"),this.setMedia(this.video),this.setTexture(t,n,!1,new Uint8Array(o),!0),this.setLoadState(a.COMPLETE_STATE)}.bind(this),16)}catch(e){console.log(e.message),this.setError()}},prepareEvents:function(){o.prototype.prepareEvents.call(this),this.checkLoadState()===a.COMPLETE_STATE&&this.updateTexture(this.getMedia()[0],!0)},traverse:r.prototype.traverse}),d}),define("cobweb/Components/Rendering/X3DNormalNode",["jquery","cobweb/Components/Rendering/X3DGeometricPropertyNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DNormalNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Rendering/Normal",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DNormalNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.Normal),this.vector=this.vector_.getValue()}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"vector",new t.MFVec3f)]),getTypeName:function(){return"Normal"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"normal"},get1Vector:function(e){return e>=0&&e<this.vector.length?this.vector[e].getValue():new s(0,0,0)}}),a}),define("cobweb/Components/Interpolation/NormalInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.NormalInterpolator)}return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFVec3f),new n(o.outputOnly,"value_changed",new t.MFVec3f)]),keyValue0:new s(0,0,0),keyValue1:new s(0,0,0),getTypeName:function(){return"NormalInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){},interpolate:function(e,t,n){var i=this.keyValue_.getValue(),r=this.value_changed_.getValue(),o=this.key_.length>1?Math.floor(i.length/this.key_.length):0;t=(e*=o)+o,this.value_changed_.length=o;for(var s=0;s<o;++s)try{r[s].set(a.simpleSlerp(this.keyValue0.assign(i[e+s].getValue()),this.keyValue1.assign(i[t+s].getValue()),n))}catch(e){}this.value_changed_.addEvent()}}),u}),define("cobweb/Components/Followers/OrientationChaser",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DChaserNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Rotation4"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.OrientationChaser)}var u=new s(0,0,1,0),l=new s(0,0,1,0);return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFRotation),new n(o.inputOnly,"set_destination",new t.SFRotation),new n(o.initializeOnly,"initialValue",new t.SFRotation),new n(o.initializeOnly,"initialDestination",new t.SFRotation),new n(o.initializeOnly,"duration",new t.SFTime(1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFRotation)]),getTypeName:function(){return"OrientationChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0,1,0)},equals:function(e,t,n){return u.assign(e).inverse().multRight(t),Math.abs(u.angle)<n},interpolate:function(e,t,n){return l.assign(e).slerp(t,n)},step:function(e,t,n){this.deltaOut.assign(t).inverse().multRight(e).multLeft(this.output),this.output.slerp(this.deltaOut,n)}}),a}),define("cobweb/Components/Followers/OrientationDamper",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DDamperNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Rotation4"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.OrientationDamper)}var u=new s(0,0,1,0),l=new s(0,0,1,0);return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFRotation),new n(o.inputOnly,"set_destination",new t.SFRotation),new n(o.initializeOnly,"initialValue",new t.SFRotation),new n(o.initializeOnly,"initialDestination",new t.SFRotation),new n(o.initializeOnly,"order",new t.SFInt32(3)),new n(o.inputOutput,"tau",new t.SFTime(.3)),new n(o.inputOutput,"tolerance",new t.SFFloat(-1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFRotation)]),getTypeName:function(){return"OrientationDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0,1,0)},equals:function(e,t,n){return u.assign(e).inverse().multRight(t),Math.abs(u.angle)<n},interpolate:function(e,t,n){return l.assign(e).slerp(t,n)}}),a}),define("cobweb/Components/Shape/X3DShapeNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Components/Grouping/X3DBoundedObject","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants","standard/Math/Geometry/Box3"],function(e,t,n,i,r,o){function s(e){t.call(this,e),n.call(this,e),this.addType(r.X3DShapeNode),this.bbox=new o}return s.prototype=e.extend(Object.create(t.prototype),n.prototype,{constructor:s,initialize:function(){t.prototype.initialize.call(this),n.prototype.initialize.call(this),this.bboxSize_.addInterest("set_bbox__",this),this.bboxCenter_.addInterest("set_bbox__",this),this.appearance_.addInterest("set_apparance__",this),this.geometry_.addInterest("set_geometry__",this),this.set_apparance__(),this.set_geometry__(),this.set_bbox__()},getBBox:function(e){return e.assign(this.bbox)},getBBoxSize:function(){return this.bboxSize},getBBoxCenter:function(){return this.bboxCenter},getAppearance:function(){return this.apparanceNode},getGeometry:function(){return this.geometryNode},setTransparent:function(e){this.transparent=e},isTransparent:function(){return this.transparent},set_bbox__:function(){this.bboxSize_.getValue().equals(this.defaultBBoxSize)?this.getGeometry()?this.bbox.assign(this.getGeometry().getBBox()):this.bbox.set():this.bbox.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue()),this.bboxSize=this.bbox.size,this.bboxCenter=this.bbox.center},set_apparance__:function(){this.apparanceNode&&this.apparanceNode.removeInterest("set_transparent__",this),this.apparanceNode=i(r.X3DAppearanceNode,this.appearance_),this.apparanceNode?this.apparanceNode.addInterest("set_transparent__",this):this.apparanceNode=this.getBrowser().getDefaultAppearance(),this.set_transparent__()},set_geometry__:function(){this.geometryNode&&(this.geometryNode.transparent_.addInterest("set_transparent__",this),this.geometryNode.bbox_changed_.addInterest("set_bbox__",this)),this.geometryNode=i(r.X3DGeometryNode,this.geometry_),this.geometryNode&&(this.geometryNode.transparent_.addInterest("set_transparent__",this),this.geometryNode.bbox_changed_.addInterest("set_bbox__",this)),this.set_transparent__(),this.set_bbox__()},set_transparent__:function(){this.transparent=this.apparanceNode&&this.apparanceNode.transparent_.getValue()||this.geometryNode&&this.geometryNode.transparent_.getValue()}}),s}),define("standard/Math/Utility/BVH",["standard/Math/Numbers/Vector3","standard/Math/Geometry/Plane3","standard/Math/Algorithms/QuickSort"],function(e,t,n){function i(e,t){function n(e,i){var r=n.vertices;return t=n.axis,Math.min(r[e+t],r[e+4+t],r[e+8+t])<Math.min(r[i+t],r[i+4+t],r[i+8+t])}return n.vertices=e,n.axis=t,n}function r(e,t){this.vertices=e.vertices,this.normals=e.normals,this.i4=12*t,this.i3=9*t}function o(n,i,s,c){this.min=new e(0,0,0),this.max=new e(0,0,0),this.planes=[],this.intersection=new e(0,0,0);var d=n.vertices,p=this.min,f=this.max,g=s+c,m=12*i[s];p.set(d[m],d[m+1],d[m+2]),f.assign(p);for(b=s;b<g;++b)m=12*i[b],a.set(d[m+0],d[m+1],d[m+2]),u.set(d[m+4],d[m+5],d[m+6]),l.set(d[m+8],d[m+9],d[m+10]),p.min(a,u,l),f.max(a,u,l);for(var b=0;b<5;++b)this.planes[b]=new t(b%2?p:f,h[b]);if(c>2){n.sorter.compare.axis=this.getLongestAxis(p,f),n.sorter.sort(s,g);w=c>>>1}else var w=1;var y=c-w;this.left=w>1?new o(n,i,s,w):new r(n,i[s]),this.right=y>1?new o(n,i,s+w,y):new r(n,i[s+w])}function s(e,t){this.vertices=e,this.normals=t;var s=e.length/12;switch(s){case 0:this.root=null;break;case 1:this.root=new r(this,0);break;default:for(var a=[],u=0;u<s;++u)a.push(u);this.sorter=new n(a,i(e,0)),this.root=new o(this,a,0,s)}}var a=new e(0,0,0),u=new e(0,0,0),l=new e(0,0,0),c={u:0,v:0,t:0},h=[new e(0,0,1),new e(0,0,-1),new e(0,1,0),new e(0,-1,0),new e(1,0,0)];return r.prototype={intersectsLine:function(t,n,i){var r=this.vertices,o=this.normals,s=this.i4,h=this.i3;if(a.x=r[s+0],a.y=r[s+1],a.z=r[s+2],u.x=r[s+4],u.y=r[s+5],u.z=r[s+6],l.x=r[s+8],l.y=r[s+9],l.z=r[s+10],t.intersectsTriangle(a,u,l,c)){var d=c.u,p=c.v,f=1-d-p,g=n.size++;g>=n.length&&(n.push(new e(0,0,0)),i.push(new e(0,0,0))),n[g].set(f*r[s+0]+d*r[s+4]+p*r[s+8],f*r[s+1]+d*r[s+5]+p*r[s+9],f*r[s+2]+d*r[s+6]+p*r[s+10]),i[g].set(f*o[h+0]+d*o[h+3]+p*o[h+6],f*o[h+1]+d*o[h+4]+p*o[h+7],f*o[h+2]+d*o[h+5]+p*o[h+8])}}},o.prototype={intersectsLine:function(e,t,n){this.intersectsBBox(e)&&(this.left.intersectsLine(e,t,n),this.right.intersectsLine(e,t,n))},intersectsBBox:function(e){var t=this.planes,n=this.min,i=this.max,r=n.x,o=i.x,s=n.y,a=i.y,u=n.z,l=i.z,c=this.intersection;return!!(t[0].intersectsLine(e,c)&&c.x>=r&&c.x<=o&&c.y>=s&&c.y<=a)||(!!(t[1].intersectsLine(e,c)&&c.x>=r&&c.x<=o&&c.y>=s&&c.y<=a)||(!!(t[2].intersectsLine(e,c)&&c.x>=r&&c.x<=o&&c.z>=u&&c.z<=l)||(!!(t[3].intersectsLine(e,c)&&c.x>=r&&c.x<=o&&c.z>=u&&c.z<=l)||!!(t[4].intersectsLine(e,c)&&c.y>=s&&c.y<=a&&c.z>=u&&c.z<=l))))},getLongestAxis:function(e,t){var n=t.x-e.x,i=t.y-e.y,r=t.z-e.z;return n<i?i<r?2:1:n<r?2:0}},s.prototype={constructor:s,intersectsLine:function(e,t,n){return t.size=0,this.root?(this.root.intersectsLine(e,t,n),t.size):0}},s}),define("cobweb/Components/ParticleSystems/ParticleSystem",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shape/X3DShapeNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","cobweb/Bits/X3DCast","standard/Math/Numbers/Color4","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Numbers/Matrix3","standard/Math/Algorithms/QuickSort","standard/Math/Algorithm","standard/Math/Utility/BVH"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g){function m(e,t){return e.distance<t.distance}function b(e){r.call(this,e),this.addType(s.ParticleSystem),this.createParticles=!0,this.particles=[],this.velocities=[],this.speeds=[],this.turbulences=[],this.geometryType=y,this.maxParticles=0,this.numParticles=0,this.particleLifetime=0,this.lifetimeVariation=0,this.emitterNode=null,this.forcePhysicsModelNodes=[],this.boundedPhysicsModelNodes=[],this.boundedNormals=[],this.boundedVertices=[],this.boundedVolume=null,this.creationTime=0,this.pauseTime=0,this.deltaTime=0,this.numForces=0,this.colorKeys=[],this.colorRamppNode=null,this.colorRamp=[],this.colorMaterial=!1,this.texCoordKeys=[],this.texCoordRampNode=null,this.texCoordRamp=[],this.texCoordAnim=!1,this.vertexCount=0,this.shaderNode=this.getBrowser().getPointShader(),this.rotation=new d,this.particleSorter=new p(this.particles,m),this.sortParticles=!1}var w=0,y=w++,x=w++,v=w++,_=w++,S=w++,C=w++,F={POINT:y,LINE:x,TRIANGLE:v,QUAD:_,GEOMETRY:S,SPRITE:C},T=new h,N=new l(0,0,0),O=new l(0,0,0),M=new l(0,0,0),V=new l(0,0,0),D=new l(0,0,0),I=new l(0,0,0),B=new l(0,0,0),E=new l(0,0,0),A=new l(0,0,0),P=new l(0,0,0);return b.prototype=e.extend(Object.create(r.prototype),{constructor:b,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"enabled",new t.SFBool(!0)),new n(s.inputOutput,"createParticles",new t.SFBool(!0)),new n(s.initializeOnly,"geometryType",new t.SFString("QUAD")),new n(s.inputOutput,"maxParticles",new t.SFInt32(200)),new n(s.inputOutput,"particleLifetime",new t.SFFloat(5)),new n(s.inputOutput,"lifetimeVariation",new t.SFFloat(.25)),new n(s.inputOutput,"particleSize",new t.SFVec2f(.02,.02)),new n(s.initializeOnly,"emitter",new t.SFNode),new n(s.initializeOnly,"physics",new t.MFNode),new n(s.initializeOnly,"colorKey",new t.MFFloat),new n(s.initializeOnly,"colorRamp",new t.SFNode),new n(s.initializeOnly,"texCoordKey",new t.MFFloat),new n(s.initializeOnly,"texCoordRamp",new t.SFNode),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(s.initializeOnly,"bboxCenter",new t.SFVec3f),new n(s.inputOutput,"appearance",new t.SFNode),new n(s.inputOutput,"geometry",new t.SFNode)]),getTypeName:function(){return"ParticleSystem"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this);var e=this.getBrowser().getContext();this.isLive().addInterest("set_live__",this),this.getBrowser().getBrowserOptions().Shading_.addInterest("set_shader__",this),this.enabled_.addInterest("set_enabled__",this),this.createParticles_.addInterest("set_createParticles__",this),this.geometryType_.addInterest("set_geometryType__",this),this.maxParticles_.addInterest("set_enabled__",this),this.particleLifetime_.addInterest("set_particleLifetime__",this),this.lifetimeVariation_.addInterest("set_lifetimeVariation__",this),this.emitter_.addInterest("set_emitter__",this),this.physics_.addInterest("set_physics__",this),this.colorKey_.addInterest("set_color__",this),this.colorRamp_.addInterest("set_colorRamp__",this),this.texCoordKey_.addInterest("set_texCoord__",this),this.texCoordRamp_.addInterest("set_texCoordRamp__",this),this.colorBuffer=e.createBuffer(),this.texCoordBuffers=[e.createBuffer()],this.normalBuffer=e.createBuffer(),this.vertexBuffer=e.createBuffer(),this.colorArray=new Float32Array,this.texCoordArray=new Float32Array,this.normalArray=new Float32Array,this.vertexArray=new Float32Array,this.set_emitter__(),this.set_enabled__(),this.set_createParticles__(),this.set_particleLifetime__(),this.set_lifetimeVariation__(),this.set_physics__(),this.set_colorRamp__(),this.set_texCoordRamp__()},set_bbox__:function(){this.bboxSize_.getValue().equals(this.defaultBBoxSize)?this.bbox.set():this.bbox.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue()),this.bboxSize=this.bbox.size,this.bboxCenter=this.bbox.center},set_transparent__:function(){switch(this.geometryType){case y:this.setTransparent(!0);break;default:this.setTransparent(this.getAppearance()&&this.getAppearance().transparent_.getValue()||this.colorRampNode&&this.colorRampNode.isTransparent()||this.geometryType===S&&this.geometryNode&&this.geometryNode.transparent_.getValue())}},set_live__:function(){this.isLive().getValue()?this.isActive_.getValue()&&this.maxParticles_.getValue()&&(this.getBrowser().sensors().addInterest("animateParticles",this),this.pauseTime&&(this.creationTime+=performance.now()/1e3-this.pauseTime,this.pauseTime=0)):this.isActive_.getValue()&&this.maxParticles_.getValue()&&(this.getBrowser().sensors().removeInterest("animateParticles",this),0===this.pauseTime&&(this.pauseTime=performance.now()/1e3))},set_enabled__:function(){this.enabled_.getValue()&&this.maxParticles_.getValue()?this.isActive_.getValue()||(this.isLive().getValue()?(this.getBrowser().sensors().addInterest("animateParticles",this),this.pauseTime=0):this.pauseTime=performance.now()/1e3,this.isActive_=!0):this.isActive_.getValue()&&(this.isLive().getValue()&&this.getBrowser().sensors().removeInterest("animateParticles",this),this.isActive_=!1),this.set_maxParticles__()},set_createParticles__:function(){this.createParticles=this.createParticles_.getValue()},set_geometryType__:function(){var e=this.getBrowser().getContext(),t=this.maxParticles;switch(this.geometryType=F[this.geometryType_.getValue()],this.geometryType||(this.geometryType=y),this.geometryType){case y:this.colorArray=new Float32Array(4*t),this.texCoordArray=new Float32Array,this.normalArray=new Float32Array,this.vertexArray=new Float32Array(4*t),this.colorArray.fill(1),this.vertexArray.fill(1),this.texCoordCount=0,this.vertexCount=1;break;case x:this.colorArray=new Float32Array(8*t),this.texCoordArray=new Float32Array,this.normalArray=new Float32Array,this.vertexArray=new Float32Array(8*t),this.colorArray.fill(1),this.vertexArray.fill(1),this.texCoordCount=2,this.vertexCount=2,this.shaderNode=this.getBrowser().getLineShader();break;case v:case _:case C:this.colorArray=new Float32Array(24*t),this.texCoordArray=new Float32Array(24*t),this.normalArray=new Float32Array(18*t),this.vertexArray=new Float32Array(24*t),this.colorArray.fill(1),this.vertexArray.fill(1);for(var n=this.texCoordArray,i=this.normalArray,r=0,o=18*t;r<o;r+=3)i[r]=0,i[r+1]=0,i[r+2]=1;e.bindBuffer(e.ARRAY_BUFFER,this.normalBuffer),e.bufferData(e.ARRAY_BUFFER,this.normalArray,e.STATIC_DRAW);for(r=0;r<t;++r){var s=24*r;n[s]=n[s+12]=0,n[s+1]=n[s+13]=0,n[s+2]=n[s+14]=0,n[s+3]=n[s+15]=1,n[s+4]=1,n[s+5]=0,n[s+6]=0,n[s+7]=1,n[s+8]=n[s+16]=1,n[s+9]=n[s+17]=1,n[s+10]=n[s+18]=0,n[s+11]=n[s+19]=1,n[s+20]=0,n[s+21]=1,n[s+22]=0,n[s+23]=1}e.bindBuffer(e.ARRAY_BUFFER,this.texCoordBuffers[0]),e.bufferData(e.ARRAY_BUFFER,this.texCoordArray,e.STATIC_DRAW),this.texCoordCount=4,this.vertexCount=6;break;case S:this.texCoordCount=0,this.vertexCount=0}this.set_shader__(),this.set_transparent__()},set_shader__:function(){switch(this.geometryType){case y:this.shaderGeometryType=0,this.shaderNode=this.getBrowser().getPointShader();break;case x:this.shaderGeometryType=1,this.shaderNode=this.getBrowser().getLineShader();break;case v:case _:case C:case S:this.shaderGeometryType=3,this.shaderNode=this.getBrowser().getDefaultShader()}},set_maxParticles__:function(){for(var e=this.particles,t=Math.max(0,this.maxParticles_.getValue()),n=this.numParticles,i=Math.min(e.length,t);n<i;++n)e[n].lifetime=-1;for(var n=e.length,i=t;n<i;++n)e[n]={lifetime:-1,elapsedTime:0,position:new l(0,0,0),velocity:new l(0,0,0),color:new c(1,1,1,1),distance:0};this.maxParticles=t,this.numParticles=Math.min(this.numParticles,t),this.emitterNode.isExplosive()||(this.creationTime=performance.now()/1e3),this.set_geometryType__()},set_particleLifetime__:function(){this.particleLifetime=this.particleLifetime_.getValue()},set_lifetimeVariation__:function(){this.lifetimeVariation=this.lifetimeVariation_.getValue()},set_emitter__:function(){this.emitterNode=a(s.X3DParticleEmitterNode,this.emitter_),this.emitterNode||(this.emitterNode=this.getBrowser().getDefaultEmitter())},set_physics__:function(){for(var e=this.physics_.getValue(),t=this.forcePhysicsModelNodes,n=this.boundedPhysicsModelNodes,i=0,r=n.length;i<r;++i)n[i].removeInterest("set_boundedPhysics__",this);t.length=0,n.length=0;for(var i=0,r=e.length;i<r;++i)try{for(var o=e[i].getValue().getInnerNode(),a=o.getType(),u=a.length-1;u>=0;--u){switch(a[u]){case s.ForcePhysicsModel:case s.WindPhysicsModel:t.push(o);break;case s.BoundedPhysicsModel:o.addInterest("set_boundedPhysics__",this),n.push(o);break;default:continue}break}}catch(e){}this.set_boundedPhysics__()},set_boundedPhysics__:function(){var e=this.boundedPhysicsModelNodes,t=this.boundedNormals,n=this.boundedVertices;t.length=0,n.length=0;for(var i=0,r=e.length;i<r;++i)e[i].addGeometry(t,n);this.boundedVolume=new g(n,t)},set_colorRamp__:function(){this.colorRampNode&&this.colorRampNode.removeInterest("set_color__",this),this.colorRampNode=a(s.X3DColorNode,this.colorRamp_),this.colorRampNode&&this.colorRampNode.addInterest("set_color__",this),this.set_color__(),this.set_transparent__()},set_color__:function(){for(var e=this.colorKey_.getValue(),t=this.colorKeys,n=this.colorRamp,i=0,r=e.length;i<r;++i)t[i]=e[i].getValue();t.length=r,this.colorRampNode&&this.colorRampNode.getVectors(this.colorRamp);for(var i=n.length,r=e.length;i<r;++i)n[i]=new c(1,1,1,1);n.length=r,this.colorMaterial=Boolean(t.length&&this.colorRampNode)},set_texCoordRamp__:function(){this.texCoordRampNode&&this.texCoordRampNode.removeInterest("set_texCoord__",this),this.texCoordRampNode=a(s.X3DTextureCoordinateNode,this.texCoordRamp_),this.texCoordRampNode&&this.texCoordRampNode.addInterest("set_texCoord__",this),this.set_texCoord__()},set_texCoord__:function(){for(var e=this.texCoordKey_.getValue(),t=this.texCoordKeys,n=this.texCoordRamp,i=0,r=e.length;i<r;++i)t[i]=e[i].getValue();t.length=r,this.texCoordRampNode&&this.texCoordRampNode.getTexCoord(n);for(var i=n.length,r=e.length*this.texCoordCount;i<r;++i)n[i]=new c(0,0,0,0);n.length=r,this.texCoordAnim=Boolean(t.length&&this.texCoordRampNode)},intersectsBox:function(e,t){},animateParticles:function(){var e=this.emitterNode,t=1/this.getBrowser().getCurrentFrameRate(),n=this.deltaTime=(14*this.deltaTime+t)/15;if(e.isExplosive()){var i=performance.now()/1e3,r=this.particleLifetime+this.particleLifetime*this.lifetimeVariation;0===this.numParticles||i-this.creationTime>r?(this.creationTime=i,this.numParticles=this.maxParticles,this.createParticles=this.createParticles_.getValue(),n=Number.POSITIVE_INFINITY):this.createParticles=!1}else if(this.numParticles<this.maxParticles){var i=performance.now()/1e3,o=Math.max(0,Math.ceil((i-this.creationTime)*this.maxParticles/this.particleLifetime));o&&(this.creationTime=i),this.numParticles=Math.floor(Math.min(this.maxParticles,this.numParticles+o))}if(e.getMass()){for(var s=this.forcePhysicsModelNodes,a=this.velocities,u=this.speeds,c=this.turbulences,h=this.deltaTime/e.getMass(),d=a.length,p=s.length;d<p;++d)a[d]=new l(0,0,0);for(var d=0,p=s.length;d<p;++d)s[d].addForce(d,e,a,c);for(var d=0,p=a.length;d<p;++d)a[d].multiply(h),u[d]=a[d].abs();this.numForces=p}else this.numForces=0;e.animate(this,n),this.updateGeometry(null),this.getBrowser().addBrowserEvent(this)},updateGeometry:function(e){switch(this.geometryType){case y:e||this.updatePoint();break;case x:e||this.updateLine();break;case v:case _:case C:this.updateQuad(e)}},updatePoint:function(){var e=this.getBrowser().getContext(),t=this.particles,n=this.numParticles,i=this.colorArray,r=this.vertexArray;if(this.colorMaterial){for(s=0;s<n;++s){var o=t[s].color;i[u=4*s]=o.x,i[u+1]=o.y,i[u+2]=o.z,i[u+3]=o.w}e.bindBuffer(e.ARRAY_BUFFER,this.colorBuffer),e.bufferData(e.ARRAY_BUFFER,this.colorArray,e.STATIC_DRAW)}for(var s=0;s<n;++s){var a=t[s].position,u=4*s;r[u]=a.x,r[u+1]=a.y,r[u+2]=a.z}e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertexArray,e.STATIC_DRAW)},updateLine:function(){var e=this.getBrowser().getContext(),t=this.particles,n=this.numParticles,i=this.colorArray,r=this.vertexArray,o=this.particleSize_.y/2;if(this.colorMaterial){for(a=0;a<n;++a){var s=t[a].color;i[c=8*a]=s.x,i[c+1]=s.y,i[c+2]=s.z,i[c+3]=s.w,i[c+4]=s.x,i[c+5]=s.y,i[c+6]=s.z,i[c+7]=s.w}e.bindBuffer(e.ARRAY_BUFFER,this.colorBuffer),e.bufferData(e.ARRAY_BUFFER,this.colorArray,e.STATIC_DRAW)}for(var a=0;a<n;++a){var u=t[a],l=u.position,c=8*a;V.assign(u.velocity).normalize(),r[c]=l.x-V.x*o,r[c+1]=l.y-V.y*o,r[c+2]=l.z-V.z*o,r[c+4]=l.x+V.x*o,r[c+5]=l.y+V.y*o,r[c+6]=l.z+V.z*o}e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertexArray,e.STATIC_DRAW)},updateQuad:function(e){try{var t=this.getBrowser().getContext(),n=this.particles,i=this.maxParticles,r=this.numParticles,o=this.colorArray,s=this.texCoordArray,a=this.normalArray,u=this.vertexArray,l=this.particleSize_.x/2,c=this.particleSize_.y/2;if(!e){if(this.colorMaterial){for(b=0;b<i;++b){var h=n[b].color;o[z=24*b]=o[z+4]=o[z+8]=o[z+12]=o[z+16]=o[z+20]=h.x,o[z+1]=o[z+5]=o[z+9]=o[z+13]=o[z+17]=o[z+21]=h.y,o[z+2]=o[z+6]=o[z+10]=o[z+14]=o[z+18]=o[z+22]=h.z,o[z+3]=o[z+7]=o[z+11]=o[z+15]=o[z+19]=o[z+23]=h.w}t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colorArray,t.STATIC_DRAW)}if(this.texCoordAnim&&this.texCoordArray.length){for(var d=this.texCoordKeys,p=this.texCoordRamp,g=d.length,m=0,b=0;b<i;++b){var w=n[b],y=w.elapsedTime/w.lifetime;if(1==g||y<=d[0])m=0;else if(y>=d[g-1])m=g-2;else{var x=f.upperBound(d,0,g,y,f.less);m=x<g?x-1:0}var v=p[m*=this.texCoordCount],_=p[m+1],S=p[m+2],F=p[m+3];s[z=24*b]=s[z+12]=v.x,s[z+1]=s[z+13]=v.y,s[z+2]=s[z+14]=v.z,s[z+3]=s[z+15]=v.w,s[z+4]=_.x,s[z+5]=_.y,s[z+6]=_.z,s[z+7]=_.w,s[z+8]=s[z+16]=S.x,s[z+9]=s[z+17]=S.y,s[z+10]=s[z+18]=S.z,s[z+11]=s[z+19]=S.w,s[z+20]=F.x,s[z+21]=F.y,s[z+22]=F.z,s[z+23]=F.w}t.bindBuffer(t.ARRAY_BUFFER,this.texCoordBuffers[0]),t.bufferData(t.ARRAY_BUFFER,this.texCoordArray,t.STATIC_DRAW)}}if(this.geometryType===C){if(e){var T=this.getScreenAlignedRotation(e);V.set(T[0],T[1],T[2]).cross(M.set(T[4],T[5],T[6])).normalize();for(var N=V.x,O=V.y,A=V.z,b=0,g=18*i;b<g;b+=3)a[b]=N,a[b+1]=O,a[b+2]=A;t.bindBuffer(t.ARRAY_BUFFER,this.normalBuffer),t.bufferData(t.ARRAY_BUFFER,this.normalArray,t.STATIC_DRAW),D.set(-l,-c,0),I.set(l,-c,0),B.set(l,c,0),E.set(-l,c,0),T.multVecMatrix(D),T.multVecMatrix(I),T.multVecMatrix(B),T.multVecMatrix(E);for(b=0;b<r;++b){var P=(k=n[b].position).x,L=k.y,R=k.z;u[z=24*b]=u[z+12]=P+D.x,u[z+1]=u[z+13]=L+D.y,u[z+2]=u[z+14]=R+D.z,u[z+4]=P+I.x,u[z+5]=L+I.y,u[z+6]=R+I.z,u[z+8]=u[z+16]=P+B.x,u[z+9]=u[z+17]=L+B.y,u[z+10]=u[z+18]=R+B.z,u[z+20]=P+E.x,u[z+21]=L+E.y,u[z+22]=R+E.z}t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertexArray,t.STATIC_DRAW)}}else if(!e){for(b=0;b<r;++b){var k=n[b].position,P=k.x,L=k.y,R=k.z,z=24*b;u[z]=u[z+12]=P-l,u[z+1]=u[z+13]=L-c,u[z+2]=u[z+14]=R,u[z+4]=P+l,u[z+5]=L-c,u[z+6]=R,u[z+8]=u[z+16]=P+l,u[z+9]=u[z+17]=L+c,u[z+10]=u[z+18]=R,u[z+20]=P-l,u[z+21]=L+c,u[z+22]=R}t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertexArray,t.STATIC_DRAW)}}catch(e){console.log(e)}},traverse:function(e,t){if(this.isActive_.getValue()){switch(e){case o.POINTER:case o.COLLISION:break;case o.DEPTH:t.addDepthShape(this);break;case o.DISPLAY:t.addDisplayShape(this)&&this.getAppearance().traverse(e,t)}if(this.geometryType===S){if(!this.getGeometry())return;this.getGeometry().traverse(e,t)}}},depth:function(e,t){if(this.updateGeometry(e.modelViewMatrix),this.geometryType===S){var n=this.getGeometry();n&&n.displayParticlesDepth(e,t,this.particles,this.numParticles)}else{if(this.numParticles<=0)return;var i=e.renderer.getBrowser().getContext();t.enableVertexAttribute(i,this.vertexBuffer),i.drawArrays(this.shaderNode.primitiveMode,0,this.numParticles*this.vertexCount)}},display:function(e){try{if(this.getAppearance().display(e),this.updateGeometry(e.modelViewMatrix),this.geometryType===S){var t=this.getGeometry();t&&t.displayParticles(e,this.particles,this.numParticles)}else{var n=e.renderer.getBrowser(),i=n.getContext(),r=e.shaderNode;if(r===n.getDefaultShader()&&(r=this.shaderNode),this.numParticles<=0)return;e.geometryType=this.shaderGeometryType,e.colorMaterial=this.colorMaterial,r.setLocalUniforms(i,e),this.colorMaterial&&r.enableColorAttribute(i,this.colorBuffer),this.texCoordArray.length&&r.enableTexCoordAttribute(i,this.texCoordBuffers),this.normalArray.length&&r.enableNormalAttribute(i,this.normalBuffer),r.enableVertexAttribute(i,this.vertexBuffer);var o=!1;switch(this.geometryType){case y:case x:break;case v:case _:case C:o=!0}if(r.wireframe&&o)for(var s=0,a=this.numParticles*this.vertexCount;s<a;s+=3)i.drawArrays(r.primitiveMode,s,3);else{var u=h.prototype.determinant3.call(e.modelViewMatrix)>0;i.frontFace(u?i.CCW:i.CW),i.enable(i.CULL_FACE),i.cullFace(i.BACK),i.drawArrays(this.shaderNode.primitiveMode,0,this.numParticles*this.vertexCount)}r.disableColorAttribute(i),r.disableTexCoordAttribute(i),r.disableNormalAttribute(i)}}catch(e){console.log(e)}},getScreenAlignedRotation:function(e){T.assign(e).inverse(),T.multDirMatrix(N.assign(l.zAxis)),T.multDirMatrix(O.assign(l.yAxis)),A.assign(O).cross(N),P.assign(N).cross(A);var t=N;return A.normalize(),P.normalize(),t.normalize(),this.rotation.set(A.x,A.y,A.z,P.x,P.y,P.z,t.x,t.y,t.z)}}),b}),define("cobweb/Components/Texturing/PixelTexture",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTexture2DNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.PixelTexture),this.addChildObjects("loadState",new t.SFInt32(o.NOT_STARTED_STATE))}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"image",new t.SFImage(0,0,0,[])),new n(o.initializeOnly,"repeatS",new t.SFBool(!0)),new n(o.initializeOnly,"repeatT",new t.SFBool(!0)),new n(o.initializeOnly,"textureProperties",new t.SFNode)]),getTypeName:function(){return"PixelTexture"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),this.image_.addInterest("set_image__",this),this.set_image__()},checkLoadState:function(){return this.loadState_.getValue()},convert:function(e,t,n){switch(t){case 1:for(var i=0,r=0,o=n.length;i<o;++i,r+=4){s=n[i].getValue();e[r]=e[r+1]=e[r+2]=255&s,e[r+3]=255}break;case 2:for(var i=0,r=0,o=n.length;i<o;++i,r+=4){s=n[i].getValue();e[r]=e[r+1]=e[r+2]=s>>>8&255,e[r+3]=255&s}break;case 3:for(var i=0,r=0,o=n.length;i<o;++i,r+=4){s=n[i].getValue();e[r]=s>>>16&255,e[r+1]=s>>>8&255,e[r+2]=255&s,e[r+3]=255}break;case 4:for(var i=0,r=0,o=n.length;i<o;++i,r+=4){var s=n[i].getValue();e[r]=s>>>24,e[r+1]=s>>>16&255,e[r+2]=s>>>8&255,e[r+3]=255&s}}},set_image__:function(){var t=this.image_.width,n=this.image_.height,i=this.image_.comp,r=this.image_.array.getValue(),a=!(i%2),u=null;if(t>0&&n>0&&i>0&&i<5){if(s.isPowerOfTwo(t)&&s.isPowerOfTwo(n))u=new Uint8Array(t*n*4),this.convert(u,i,r);else if(Math.max(t,n)<this.getBrowser().getMinTextureSize()&&!this.textureProperties_.getValue()){u=new Uint8Array(t*n*4),this.convert(u,i,r);var l=t,c=n;t=4*s.nextPowerOfTwo(l),n=4*s.nextPowerOfTwo(c),u=this.resize(u,l,c,t,n)}else{var h=e("<canvas></canvas>")[0],d=e("<canvas></canvas>")[0],p=h.getContext("2d"),f=d.getContext("2d"),g=p.createImageData(t,n);h.width=t,h.height=n,this.convert(g.data,i,r),p.putImageData(g,0,0),t=s.nextPowerOfTwo(t),n=s.nextPowerOfTwo(n),d.width=t,d.height=n,f.drawImage(h,0,0,h.width,h.height,0,0,t,n),u=f.getImageData(0,0,t,n).data}this.setTexture(t,n,a,new Uint8Array(u),!1),this.loadState_=o.COMPLETE_STATE}else this.clear(),this.loadState_=o.FAILED_STATE}}),a}),define("cobweb/Components/PointingDeviceSensor/PlaneSensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/PointingDeviceSensor/X3DDragSensorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Geometry/ViewVolume","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p){function f(e){r.call(this,e),this.addType(o.PlaneSensor)}var g=new c(a.Zero,a.Zero),m=new a(0,0,0),b=new c(a.Zero,a.Zero);return f.prototype=e.extend(Object.create(r.prototype),{constructor:f,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"description",new t.SFString),new n(o.inputOutput,"axisRotation",new t.SFRotation),new n(o.inputOutput,"autoOffset",new t.SFBool(!0)),new n(o.inputOutput,"offset",new t.SFVec3f),new n(o.inputOutput,"minPosition",new t.SFVec2f),new n(o.inputOutput,"maxPosition",new t.SFVec2f(-1,-1)),new n(o.outputOnly,"trackPoint_changed",new t.SFVec3f),new n(o.outputOnly,"translation_changed",new t.SFVec3f),new n(o.outputOnly,"isOver",new t.SFBool),new n(o.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"PlaneSensor"},getComponentName:function(){return"PointingDeviceSensor"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.modelViewMatrix=new l,this.invModelViewMatrix=new l,this.projectionMatrix=new l,this.viewport=new u,this.planeSensor=!0,this.plane=null,this.line=null,this.startOffset=new a(0,0,0),this.startPoint=new a(0,0,0)},getLineTrackPoint:function(e,t,n){return d.projectLine(t,this.modelViewMatrix,this.projectionMatrix,this.viewport,g),g.getClosestPointToPoint(new a(e.pointer.x,e.pointer.y,0),m),d.unProjectRay(m.x,m.y,this.modelViewMatrix,this.projectionMatrix,this.viewport,b),t.getClosestPointToLine(b,n)},set_active__:function(e,t,n,i,o){r.prototype.set_active__.call(this,e,t,n,i,o);try{if(this.isActive_.getValue()){this.modelViewMatrix.assign(n),this.projectionMatrix.assign(i),this.viewport.assign(o),this.invModelViewMatrix.assign(n).inverse();var s=t.hitRay.copy().multLineMatrix(this.invModelViewMatrix),u=this.invModelViewMatrix.multVecMatrix(t.intersection.point.copy()),l=this.axisRotation_.getValue();if(this.minPosition_.x===this.maxPosition_.x){this.planeSensor=!1;d=l.multVecRot(new a(0,Math.abs(this.maxPosition_.y-this.minPosition_.y),0));this.line=new c(u,d.normalize())}else if(this.minPosition_.y===this.maxPosition_.y){this.planeSensor=!1;var d=l.multVecRot(new a(Math.abs(this.maxPosition_.x-this.minPosition_.x),0,0));this.line=new c(u,d.normalize())}else this.planeSensor=!0,this.plane=new h(u,l.multVecRot(new a(0,0,1)));if(this.planeSensor)this.plane.intersectsLine(s,this.startPoint)&&this.trackStart(this.startPoint);else if(this.getLineTrackPoint(t,this.line,this.startPoint)){var p=new a(0,0,0);try{this.getLineTrackPoint(t,new c(this.line.direction,this.line.direction),p)}catch(e){p=this.startPoint}this.trackStart(p)}}else this.autoOffset_.getValue()&&(this.offset_=this.translation_changed_)}catch(e){console.log(e)}},trackStart:function(e){this.startOffset.assign(this.offset_.getValue()),this.trackPoint_changed_=e,this.translation_changed_=this.offset_.getValue()},set_motion__:function(e){try{if(this.planeSensor){var t=e.hitRay.copy().multLineMatrix(this.invModelViewMatrix),n=new a(0,0,0);if(!this.plane.intersectsLine(t,n))throw new Error("Plane and line are parallel.");this.track(n,n.copy())}else{var n=new a(0,0,0),i=new a(0,0,0);if(!this.getLineTrackPoint(e,this.line,n))throw new Error("Lines are parallel.");try{this.getLineTrackPoint(e,new c(a.Zero,this.line.direction),i)}catch(e){i.assign(n)}this.track(n,i)}}catch(e){this.trackPoint_changed_.addEvent(),this.translation_changed_.addEvent()}},track:function(e,t){var n=this.axisRotation_.getValue(),i=s.inverse(n).multVecRot(e.add(this.startOffset).subtract(this.startPoint));this.minPosition_.x>this.maxPosition_.x||(i.x=p.clamp(i.x,this.minPosition_.x,this.maxPosition_.x)),this.minPosition_.y>this.maxPosition_.y||(i.y=p.clamp(i.y,this.minPosition_.y,this.maxPosition_.y)),n.multVecRot(i),this.trackPoint_changed_.getValue().equals(t)||(this.trackPoint_changed_=t),this.translation_changed_.getValue().equals(i)||(this.translation_changed_=i)}}),f}),define("cobweb/Components/Lighting/PointLight",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Lighting/X3DLightNode","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Geometry/Box3","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Math/Algorithm","standard/Utility/ObjectCache"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b){function w(){var e=l.perspective(m.radians(120),.125,1e3,1,1,new f);this.location=new h(0,0,0),this.direction=new h(0,0,0),this.shadowBuffer=null,this.viewVolume=new c,this.viewport=new d(0,0,0,0),this.projectionMatrix=e,this.modelViewMatrix=new g(f),this.transformationMatrix=new f,this.invLightSpaceMatrix=new f,this.shadowMatrix=new f,this.shadowMatrixArray=new Float32Array(16),this.invGroupMatrix=new f,this.rotation=new p,this.rotationMatrix=new f,this.textureUnit=0}function y(e){r.call(this,e),this.addType(a.PointLight)}var x=new f(1/6,0,0,0,0,.25,0,0,0,0,.5,0,1/6,.25,.5,1),v=[new h(1,0,0),new h(-1,0,0),new h(0,0,1),new h(0,0,-1),new h(0,1,0),new h(0,-1,0)],_=b(w);return w.prototype={constructor:w,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(e,t,n,i){var r=e.getContext(),o=t.getShadowMapSize();this.browser=e,this.lightNode=t,this.groupNode=n,this.modelViewMatrix.pushMatrix(i),t.getShadowIntensity()>0&&o>0&&(this.shadowBuffer=e.popShadowBuffer(o),this.shadowBuffer?e.getCombinedTextureUnits().length?(this.textureUnit=e.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(e){try{if(!this.shadowBuffer)return;var t=this.lightNode,n=e.getCameraSpaceMatrix().get(),i=this.transformationMatrix.assign(this.modelViewMatrix.get()).multRight(n),r=this.invLightSpaceMatrix.assign(t.getGlobal()?i:f.Identity);r.translate(t.getLocation()),r.inverse();var o=t.getShadowMapSize()/2,a=t.getShadowMapSize()/3,u=this.projectionMatrix,l=this.invGroupMatrix.assign(this.groupNode.getMatrix()).inverse();this.shadowBuffer.bind(),e.getProjectionMatrix().pushMatrix(this.projectionMatrix);for(var c=0;c<2;++c)for(var d=0;d<3;++d){var p=this.rotation.setFromToVec(this.direction.assign(v[3*c+d]),h.zAxis),g=this.viewport.set(d*a,c*o,a,o);e.getViewVolumes().push(this.viewVolume.set(u,g,g)),e.getModelViewMatrix().pushMatrix(this.rotationMatrix.setRotation(p)),e.getModelViewMatrix().multLeft(r),e.getModelViewMatrix().multLeft(l),e.render(s.DEPTH,this.groupNode),e.getModelViewMatrix().pop(),e.getViewVolumes().pop()}e.getProjectionMatrix().pop(),this.shadowBuffer.unbind(),t.getGlobal()||r.multLeft(i.inverse())}catch(e){console.log(e)}},setGlobalVariables:function(e){this.modelViewMatrix.get().multVecMatrix(this.location.assign(this.lightNode.location_.getValue())),this.shadowMatrix.assign(e.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(e,t,n){var i=this.lightNode,r=i.getColor(),o=i.getAttenuation(),s=this.location,a=i.getShadowColor();e.uniform1i(t.x3d_LightType[n],2),e.uniform3f(t.x3d_LightColor[n],r.r,r.g,r.b),e.uniform1f(t.x3d_LightIntensity[n],i.getIntensity()),e.uniform1f(t.x3d_LightAmbientIntensity[n],i.getAmbientIntensity()),e.uniform3f(t.x3d_LightAttenuation[n],Math.max(0,o.x),Math.max(0,o.y),Math.max(0,o.z)),e.uniform3f(t.x3d_LightLocation[n],s.x,s.y,s.z),e.uniform1f(t.x3d_LightRadius[n],i.getRadius()),this.textureUnit?(e.uniform1f(t.x3d_ShadowIntensity[n],i.getShadowIntensity()),e.uniform1f(t.x3d_ShadowDiffusion[n],i.getShadowDiffusion()),e.uniform3f(t.x3d_ShadowColor[n],a.r,a.g,a.b),e.uniformMatrix4fv(t.x3d_ShadowMatrix[n],!1,this.shadowMatrixArray),e.uniform1i(t.x3d_ShadowMap[n],this.textureUnit)):e.uniform1f(t.x3d_ShadowIntensity[n],0)},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,_.push(this)}},y.prototype=e.extend(Object.create(r.prototype),{constructor:y,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"global",new t.SFBool(!0)),new n(a.inputOutput,"on",new t.SFBool(!0)),new n(a.inputOutput,"color",new t.SFColor(1,1,1)),new n(a.inputOutput,"intensity",new t.SFFloat(1)),new n(a.inputOutput,"ambientIntensity",new t.SFFloat),new n(a.inputOutput,"attenuation",new t.SFVec3f(1,0,0)),new n(a.inputOutput,"location",new t.SFVec3f),new n(a.inputOutput,"radius",new t.SFFloat(100)),new n(a.inputOutput,"shadowColor",new t.SFColor),new n(a.inputOutput,"shadowIntensity",new t.SFFloat),new n(a.inputOutput,"shadowDiffusion",new t.SFFloat),new n(a.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"PointLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getAttenuation:function(){return this.attenuation_.getValue()},getLocation:function(){return this.location_.getValue()},getRadius:function(){return Math.max(0,this.radius_.getValue())},getBiasMatrix:function(){return x},getLights:function(){return _}}),y}),define("cobweb/Components/Rendering/PointSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DLineGeometryNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.PointSet),this.setGeometryType(0),this.colorNode=null,this.coordNode=null,this.transparent_=!0}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"attrib",new t.MFNode),new n(s.inputOutput,"fogCoord",new t.SFNode),new n(s.inputOutput,"color",new t.SFNode),new n(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"PointSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.color_.addInterest("set_color__",this),this.coord_.addInterest("set_coord__",this);var e=this.getBrowser();this.setPrimitiveMode(e.getContext().POINTS),this.setSolid(!1),this.set_attrib__(),this.set_color__(),this.set_coord__()},getShader:function(e){return e.getPointShader()},set_attrib__:function(){for(var e=this.getAttrib(),t=0,n=e.length;t<n;++t)e[t].removeInterest("addNodeEvent",this);e.length=0;for(var t=0,n=this.attrib_.length;t<n;++t){var i=o(s.X3DVertexAttributeNode,this.attrib_[t]);i&&e.push(i)}for(t=0;t<this.attribNodes.length;++t)e[t].addInterest("addNodeEvent",this)},set_color__:function(){this.colorNode&&this.colorNode.removeInterest("addNodeEvent",this),this.colorNode=o(s.X3DColorNode,this.color_),this.colorNode&&this.colorNode.addInterest("addNodeEvent",this)},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("addNodeEvent",this),this.coordNode=o(s.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("addNodeEvent",this)},build:function(){if(this.coordNode&&!this.coordNode.isEmpty()){for(var e=this.getAttrib(),t=e.length,n=this.getAttribs(),i=this.colorNode,r=this.coordNode,o=0;o<t;++o)for(var s=0,a=r.point_.length;s<a;++s)e[o].addValue(n[o],s);if(this.colorNode)for(var s=0,a=r.point_.length;s<a;++s)this.addColor(i.get1Color(s));for(var s=0,a=r.point_.length;s<a;++s)this.addVertex(r.get1Point(s))}}}),a}),define("cobweb/Components/Geometry2D/Polyline2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DLineGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.Polyline2D),this.setGeometryType(1)}var u=new s(0,0,0);return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"lineSegments",new t.MFVec2f)]),getTypeName:function(){return"Polyline2D"},getComponentName:function(){return"Geometry2D"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.setPrimitiveMode(this.getBrowser().getContext().LINE_STRIP)},build:function(){for(var e=this.lineSegments_.getValue(),t=0,n=e.length;t<n;++t){var i=e[t];this.addVertex(u.set(i.x,i.y,0))}this.setSolid(!1)}}),a}),define("cobweb/Components/ParticleSystems/PolylineEmitter",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticleEmitterNode","cobweb/Components/Rendering/IndexedLineSet","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(s.PolylineEmitter),this.direction=new a(0,0,0),this.polylineNode=new o(e),this.polylines=[],this.lengthSoFarArray=[0]}function c(e){return e.set(0,0,0)}var h=new a(0,0,0);return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"direction",new t.SFVec3f(0,1,0)),new n(s.inputOutput,"speed",new t.SFFloat),new n(s.inputOutput,"variation",new t.SFFloat(.25)),new n(s.initializeOnly,"mass",new t.SFFloat),new n(s.initializeOnly,"surfaceArea",new t.SFFloat),new n(s.inputOutput,"coordIndex",new t.MFInt32(-1)),new n(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"PolylineEmitter"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"emitter"},initialize:function(){r.prototype.initialize.call(this),this.direction_.addInterest("set_direction__",this),this.coordIndex_.addFieldInterest(this.polylineNode.coordIndex_),this.coord_.addFieldInterest(this.polylineNode.coord_),this.polylineNode.coordIndex_=this.coordIndex_,this.polylineNode.coord_=this.coord_,this.polylineNode.addInterest("set_polyline",this),this.polylineNode.setPrivate(!0),this.polylineNode.setup(),this.set_direction__(),this.set_polyline()},set_direction__:function(){this.direction.assign(this.direction_.getValue()).normalize(),this.direction.equals(a.Zero)?this.getRandomVelocity=this.getSphericalRandomVelocity:delete this.getRandomVelocity},set_polyline:function(){var e=this.polylineNode.getPolylines(this.polylines);if(e.length){delete this.getRandomPosition;var t=0,n=this.lengthSoFarArray;n.length=1;for(var i=0,r=e.length;i<r;i+=2)t+=h.assign(e[i+1]).subtract(e[i]).abs(),n.push(t)}else this.getRandomPosition=c},getRandomPosition:function(e){var t=this.lengthSoFarArray,n=t.length,i=Math.random()*t[n-1],r=0,o=0,s=0;if(1==n||i<=t[0])r=0,s=0;else if(i>=t[n-1])r=n-2,s=1;else{var a=u.upperBound(t,0,n,i,u.less);if(a<n){o=a;var l=t[r=a-1],c=t[o];s=u.clamp((i-l)/(c-l),0,1)}else r=0,s=0}o=(r*=2)+1;var h=this.polylines[r],d=this.polylines[o];return e.x=h.x+s*(d.x-h.x),e.y=h.y+s*(d.y-h.y),e.z=h.z+s*(d.z-h.z),e},getRandomVelocity:function(e){var t=this.direction,n=this.getRandomSpeed();return e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e}}),l}),define("cobweb/Components/Geometry2D/Polypoint2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DLineGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.Polypoint2D),this.setGeometryType(0),this.transparent_=!0}var u=new s(0,0,0);return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"point",new t.MFVec2f)]),getTypeName:function(){return"Polypoint2D"},getComponentName:function(){return"Geometry2D"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this);var e=this.getBrowser();this.setPrimitiveMode(e.getContext().POINTS),this.setSolid(!1)},getShader:function(e){return e.getPointShader()},build:function(){for(var e=this.point_.getValue(),t=0,n=e.length;t<n;++t){var i=e[t];this.addVertex(u.set(i.x,i.y,0))}}}),a}),define("cobweb/Components/Followers/PositionChaser",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DChaserNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.PositionChaser)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFVec3f),new n(o.inputOnly,"set_destination",new t.SFVec3f),new n(o.initializeOnly,"initialValue",new t.SFVec3f),new n(o.initializeOnly,"initialDestination",new t.SFVec3f),new n(o.initializeOnly,"duration",new t.SFTime(1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFVec3f)]),getTypeName:function(){return"PositionChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0,0)}}),a}),define("cobweb/Components/Followers/PositionChaser2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DChaserNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.PositionChaser2D)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFVec2f),new n(o.inputOnly,"set_destination",new t.SFVec2f),new n(o.initializeOnly,"initialValue",new t.SFVec2f),new n(o.initializeOnly,"initialDestination",new t.SFVec2f),new n(o.initializeOnly,"duration",new t.SFTime(1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"PositionChaser2D"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0)}}),a}),define("cobweb/Components/Followers/PositionDamper",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DDamperNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.PositionDamper)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFVec3f),new n(o.inputOnly,"set_destination",new t.SFVec3f),new n(o.initializeOnly,"initialValue",new t.SFVec3f),new n(o.initializeOnly,"initialDestination",new t.SFVec3f),new n(o.initializeOnly,"order",new t.SFInt32(3)),new n(o.inputOutput,"tolerance",new t.SFFloat(-1)),new n(o.inputOutput,"tau",new t.SFTime(.3)),new n(o.outputOnly,"value_changed",new t.SFVec3f),new n(o.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"PositionDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0,0)}}),a}),define("cobweb/Components/Followers/PositionDamper2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DDamperNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.PositionDamper2D)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFVec2f),new n(o.inputOnly,"set_destination",new t.SFVec2f),new n(o.initializeOnly,"initialValue",new t.SFVec2f),new n(o.initializeOnly,"initialDestination",new t.SFVec2f),new n(o.initializeOnly,"order",new t.SFInt32(3)),new n(o.inputOutput,"tau",new t.SFTime(.3)),new n(o.inputOutput,"tolerance",new t.SFFloat(-1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"PositionDamper2D"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0)}}),a}),define("cobweb/Components/Interpolation/PositionInterpolator2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.PositionInterpolator2D)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_fraction",new t.SFFloat),new n(o.inputOutput,"key",new t.MFFloat),new n(o.inputOutput,"keyValue",new t.MFVec2f),new n(o.outputOnly,"value_changed",new t.SFVec2f)]),keyValue:new s(0,0),getTypeName:function(){return"PositionInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,n=this.keyValue_;n.length<e.length&&n.resize(e.length,n.length?n[n.length-1]:new t.SFVec2f)},interpolate:function(e,t,n){this.value_changed_=this.keyValue.assign(this.keyValue_[e].getValue()).lerp(this.keyValue_[t].getValue(),n)}}),a}),define("cobweb/Components/CADGeometry/QuadSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.QuadSet),this.triangleIndex=[]}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"QuadSet"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"geometry"},getTriangleIndex:function(e){return this.triangleIndex[e]},build:function(){if(this.getCoord()){var e=this.getCoord().getSize(),t=this.triangleIndex;e-=e%4,t.length=0;for(var n=0;n<e;n+=4){var i=n,o=n+1,s=n+2,a=n+3;t.push(i,o,s,i,s,a)}r.prototype.build.call(this,4,e,6,t.length)}},createNormals:function(e,t){return this.createFaceNormals(e,t)}}),s}),define("cobweb/Components/Geometry2D/Rectangle2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.Rectangle2D),this.setGeometryType(2)}var l=new s(2,2);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"size",new t.SFVec2f(2,2)),new n(o.initializeOnly,"solid",new t.SFBool)]),getTypeName:function(){return"Rectangle2D"},getComponentName:function(){return"Geometry2D"},getContainerField:function(){return"geometry"},build:function(){var e=this.getBrowser().getRectangle2DOptions().getGeometry(),t=this.size_.getValue();if(this.setTexCoords(e.getTexCoords()),this.setNormals(e.getNormals()),t.equals(l))this.setVertices(e.getVertices()),this.getMin().assign(e.getMin()),this.getMax().assign(e.getMax());else{for(var n=a.divide(t,2),i=n.x,r=n.y,o=e.getVertices(),s=this.getVertices(),u=0;u<o.length;u+=4)s.push(i*o[u],r*o[u+1],o[u+2],1);this.getMin().set(-i,-r,0),this.getMax().set(i,r,0)}this.setSolid(this.solid_.getValue())}}),u}),define("cobweb/Components/Followers/ScalarChaser",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DChaserNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.ScalarChaser)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFFloat),new n(o.inputOnly,"set_destination",new t.SFFloat),new n(o.initializeOnly,"initialValue",new t.SFFloat),new n(o.initializeOnly,"initialDestination",new t.SFFloat),new n(o.initializeOnly,"duration",new t.SFTime(1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"ScalarChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return 0},setPreviousValue:function(e){this.previousValue=e},duplicate:function(e){return e},assign:function(e,t,n){e[t]=n},equals:function(e,t,n){return Math.abs(e-t)<n},interpolate:function(e,t,n){return s.lerp(e,t,n)},step:function(e,t,n){this.output+=(e-t)*n}}),a}),define("cobweb/Components/Followers/ScalarDamper",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DDamperNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.ScalarDamper)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_value",new t.SFFloat),new n(o.inputOnly,"set_destination",new t.SFFloat),new n(o.initializeOnly,"initialValue",new t.SFFloat),new n(o.initializeOnly,"initialDestination",new t.SFFloat),new n(o.initializeOnly,"order",new t.SFInt32(3)),new n(o.inputOutput,"tau",new t.SFTime(.3)),new n(o.inputOutput,"tolerance",new t.SFFloat(-1)),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"ScalarDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return 0},duplicate:function(e){return e},assign:function(e,t,n){e[t]=n},equals:function(e,t,n){return Math.abs(e-t)<n},interpolate:function(e,t,n){return s.lerp(e,t,n)}}),a}),define("cobweb/Browser/Layout/ScreenText",["jquery","cobweb/Browser/Text/X3DTextGeometry","cobweb/Browser/Text/TextAlignment","cobweb/Components/Texturing/PixelTexture","cobweb/Bits/TraverseType","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Box3","standard/Math/Geometry/ViewVolume","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l,c,h){function d(n,r){t.call(this,n,r),n.transparent_=!0,this.texCoords=[],this.texture=new i(n.getExecutionContext()),this.canvas=e("<canvas></canvas>"),this.context=this.canvas[0].getContext("2d"),this.screenMatrix=new u,this.matrix=new u,this.texture.textureProperties_=r.getBrowser().getScreenTextureProperties(),this.texture.setup()}var p=[],f=new s(0,0,0),g=new s(1,1,0),m=new s(0,0,0),b=new a(0,0,1,0),w=new s(1,1,1),y=new s(0,0,0),x=new l;return d.prototype=e.extend(Object.create(t.prototype),{constructor:d,modelViewMatrix:new u,getMatrix:function(){return this.matrix},update:function(){t.prototype.update.call(this);var e=this.getFontStyle(),i=this.getText();switch(i.textBounds_.x=Math.ceil(i.textBounds_.x)+1,i.textBounds_.y=Math.ceil(i.textBounds_.y)+1,this.getBBox().getExtents(f,g),f.x-=1,f.y-=1,e.getMajorAlignment()){case n.BEGIN:case n.FIRST:f.x=Math.floor(f.x),g.x=f.x+i.textBounds_.x;break;case n.MIDDLE:f.x=Math.round(f.x),g.x=f.x+i.textBounds_.x;break;case n.END:g.x=Math.ceil(g.x),f.x=g.x-i.textBounds_.x}switch(e.getMinorAlignment()){case n.BEGIN:case n.FIRST:g.y=Math.ceil(g.y),f.y=g.y-i.textBounds_.y;break;case n.MIDDLE:g.y=Math.round(g.y),f.y=g.y-i.textBounds_.y;break;case n.END:f.y=Math.floor(f.y),g.y=f.y+i.textBounds_.y}i.origin_.x=f.x,i.origin_.y=g.y,this.getBBox().setExtents(f,g)},build:function(){var e=this.getFontStyle(),t=e.getFont();if(t){var n=this.getText(),i=this.getGlyphs(),r=this.getMinorAlignment(),o=this.getTranslations(),s=this.getCharSpacings(),a=e.getScale(),u=a/t.unitsPerEm,l=this.texCoords,c=n.getNormals(),d=n.getVertices(),p=this.canvas[0],m=this.context;l.length=0,n.getTexCoords().push(l),this.getBBox().getExtents(f,g),c.push(0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1),d.push(f.x,f.y,0,1,g.x,f.y,0,1,g.x,g.y,0,1,f.x,f.y,0,1,g.x,g.y,0,1,f.x,g.y,0,1);var b=n.textBounds_.x,w=n.textBounds_.y;h.isPowerOfTwo(b)&&h.isPowerOfTwo(w)?(p.width=b,p.height=w):(p.width=h.nextPowerOfTwo(b),p.height=h.nextPowerOfTwo(w));var y=b/p.width,x=1-w/p.height;if(l.push(0,x,0,1,y,x,0,1,y,1,0,1,0,x,0,1,y,1,0,1,0,1,0,1),m.fillStyle="rgba(255,255,255,0)",m.fillRect(0,0,p.width,p.height),m.fillStyle="rgba(255,255,255,1)",e.horizontal_.getValue())for(var v=0,_=i.length;v<_;++v)for(var S=i[v],C=s[v],F=o[v],T=0,N=0,O=S.length;N<O;++N){var M=S[N],V=r.x+F.x+T+N*C-f.x,x=r.y+F.y-g.y;this.drawGlyph(m,t,M,V,x,a);var D=0;N+1<S.length&&(D=t.getKerningValue(M,S[N+1])),T+=(M.advanceWidth+D)*u}else for(var I=e.leftToRight_.getValue(),B=e.topToBottom_.getValue(),E=I?0:n.string_.length-1,A=I?n.string_.length:-1,P=I?1:-1,v=E,L=0;v!==A;v+=P)for(var R=(S=i[v]).length,k=B?0:R-1,z=B?R:-1,j=B?1:-1,N=k;N!==z;N+=j,++L){var F=o[L],V=r.x+F.x-f.x,x=r.y+F.y-g.y;this.drawGlyph(m,t,S[N],V,x,a)}var X=m.getImageData(0,0,p.width,p.height);X?this.texture.setTexture(p.width,p.height,!0,new Uint8Array(X.data),!0):this.texture.clear()}},drawGlyph:function(e,t,n,i,r,o){var s=n.components;if(p.length=0,n.isComposite)for(var a=0,u=s.length;a<u;++a){var l=s[a];p.push(n.getPath(l.dx/t.unitsPerEm*o+i,l.dy/t.unitsPerEm*o-r,o))}else p.push(n.getPath(i,-r,o));for(var c=0,h=p.length;c<h;++c){var d=p[c],f=d.commands;e.beginPath();for(var g=0,u=f.length;g<u;++g){var m=f[g];switch(m.type){case"M":e.moveTo(m.x,m.y);continue;case"Z":e.closePath();continue;case"L":e.lineTo(m.x,m.y);continue;case"C":e.bezierCurveTo(m.x1,m.y1,m.x2,m.y2,m.x,m.y);continue;case"Q":e.quadraticCurveTo(m.x1,m.y1,m.x,m.y);continue}}d.fill&&e.fill(),d.stroke&&(e.lineWidth=d.strokeWidth,e.stroke())}},getGlyphExtents:function(e,t,n,i){var r=this.getFontStyle().getFont().unitsPerEm;n.set((e.xMin||0)/r,(e.yMin||0)/r,0),i.set((e.xMax||0)/r,(e.yMax||0)/r,0)},transform:function(e){var t=this.getText(),n=e.getProjectionMatrix().get(),i=e.getModelViewMatrix().get(),r=e.getViewVolume().getViewport(),o=this.screenMatrix;o.assign(i),o.get(m,b,w);var a=e.getViewpoint().getScreenScale(m,r);o.set(m,b,w.set(a.x*(h.signum(w.x)<0?-1:1),a.y*(h.signum(w.y)<0?-1:1),a.z*(h.signum(w.z)<0?-1:1))),c.projectPoint(s.Zero,o,n,r,y),y.x=Math.round(y.x),y.y=Math.round(y.y),c.unProjectPoint(y.x,y.y,y.z,o,n,r,y),y.z=0,o.translate(y),this.matrix.assign(i).inverse().multLeft(o),x.assign(this.getBBox()).multRight(this.matrix),t.setBBox(x)},traverse:function(e,t){this.transform(t)},display:function(e){u.prototype.multLeft.call(e.modelViewMatrix,this.matrix),e.textureNode=this.texture,e.textureTransformNode=this.getBrowser().getDefaultTextureTransform()},transformLine:function(e){return e.multLineMatrix(u.inverse(this.matrix))},transformMatrix:function(e){return e.multLeft(this.matrix)}}),d}),define("cobweb/Components/Layout/ScreenFontStyle",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Text/X3DFontStyleNode","cobweb/Browser/Layout/ScreenText","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.ScreenFontStyle)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"language",new t.SFString),new n(s.initializeOnly,"family",new t.MFString("SERIF")),new n(s.initializeOnly,"style",new t.SFString("PLAIN")),new n(s.initializeOnly,"pointSize",new t.SFFloat(12)),new n(s.initializeOnly,"spacing",new t.SFFloat(1)),new n(s.initializeOnly,"horizontal",new t.SFBool(!0)),new n(s.initializeOnly,"leftToRight",new t.SFBool(!0)),new n(s.initializeOnly,"topToBottom",new t.SFBool(!0)),new n(s.initializeOnly,"justify",new t.MFString("BEGIN"))]),getTypeName:function(){return"ScreenFontStyle"},getComponentName:function(){return"Layout"},getContainerField:function(){return"fontStyle"},getTextGeometry:function(e){return new o(e,this)},getScale:function(){return this.pointSize_.getValue()*this.getBrowser().getPointSize()}}),a}),define("cobweb/Components/Layout/ScreenGroup",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DConstants","cobweb/Bits/TraverseType","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/ViewVolume"],function(e,t,n,i,r,o,s,a,u,l,c){function h(e){r.call(this,e),this.addType(o.ScreenGroup),this.screenMatrix=new l,this.modelViewMatrix=new l}var d=new a(0,0,0),p=new u(0,0,1,0),f=new a(1,1,1),g=new a(0,0,0);return h.prototype=e.extend(Object.create(r.prototype),{constructor:h,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(o.initializeOnly,"bboxCenter",new t.SFVec3f),new n(o.inputOnly,"addChildren",new t.MFNode),new n(o.inputOnly,"removeChildren",new t.MFNode),new n(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"ScreenGroup"},getComponentName:function(){return"Layout"},getContainerField:function(){return"children"},getBBox:function(e){return r.prototype.getBBox.call(this,e).multRight(this.getMatrix())},getMatrix:function(){try{this.matrix.assign(this.modelViewMatrix).inverse().multLeft(this.screenMatrix)}catch(e){}return this.matrix},scale:function(e){this.modelViewMatrix.assign(e.getModelViewMatrix().get()),this.modelViewMatrix.get(d,p,f);var t=e.getProjectionMatrix().get(),n=e.getViewVolume().getViewport(),i=e.getViewpoint().getScreenScale(d,n),r=this.screenMatrix;return r.set(d,p,f.set(i.x*(f.x<0?-1:1),i.y*(f.y<0?-1:1),i.z*(f.z<0?-1:1))),c.projectPoint(a.Zero,r,t,n,g),g.x=Math.round(g.x),g.y=Math.round(g.y),c.unProjectPoint(g.x,g.y,g.z,r,t,n,g),g.z=0,r.translate(g),r},traverse:function(e,t){try{var n=t.getModelViewMatrix();switch(e){case s.CAMERA:case s.DEPTH:n.pushMatrix(this.screenMatrix);break;default:n.pushMatrix(this.scale(t))}r.prototype.traverse.call(this,e,t),n.pop()}catch(e){}}}),h}),define("cobweb/Browser/Scripting/evaluate",[],function(){return function(){with(arguments[0])return eval(arguments[1])}}),define("cobweb/Components/Scripting/X3DScriptNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Components/Networking/X3DUrlObject","cobweb/Bits/X3DConstants"],function(e,t,n,i){function r(e){t.call(this,e),n.call(this,e),this.addType(i.X3DScriptNode)}return r.prototype=e.extend(Object.create(t.prototype),n.prototype,{constructor:r}),r}),define("cobweb/Components/Scripting/Script",["jquery","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Basic/X3DField","cobweb/Basic/X3DArrayField","cobweb/Fields","cobweb/Browser/X3DBrowser","cobweb/Configuration/ComponentInfo","cobweb/Configuration/ComponentInfoArray","cobweb/Configuration/ProfileInfo","cobweb/Configuration/ProfileInfoArray","cobweb/Configuration/UnitInfo","cobweb/Configuration/UnitInfoArray","cobweb/Execution/X3DExecutionContext","cobweb/Execution/X3DScene","cobweb/Prototype/ExternProtoDeclarationArray","cobweb/Prototype/ProtoDeclarationArray","cobweb/Prototype/X3DExternProtoDeclaration","cobweb/Prototype/X3DProtoDeclaration","cobweb/Routing/RouteArray","cobweb/Routing/X3DRoute","cobweb/Browser/Scripting/evaluate","cobweb/Components/Scripting/X3DScriptNode","cobweb/InputOutput/FileLoader","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b,w,y,x,v,_,S,C){function F(e){_.call(this,e),this.addType(C.Script)}return F.prototype=e.extend(Object.create(_.prototype),{constructor:F,fieldDefinitions:new n([new t(C.inputOutput,"metadata",new o.SFNode),new t(C.inputOutput,"url",new o.MFString),new t(C.initializeOnly,"directOutput",new o.SFBool),new t(C.initializeOnly,"mustEvaluate",new o.SFBool)]),getTypeName:function(){return"Script"},getComponentName:function(){return"Scripting"},getContainerField:function(){return"children"},initialize:function(){_.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.requestAsyncLoad()},getExtendedEventHandling:function(){return!1},hasUserDefinedFields:function(){return!0},getSourceText:function(){return this.url_},requestAsyncLoad:function(){this.checkLoadState()!==C.COMPLETE_STATE&&this.checkLoadState()!==C.IN_PROGRESS_STATE&&0!==this.url_.length&&(this.setLoadState(C.IN_PROGRESS_STATE),this.getScene().addInitLoadCount(this),new S(this).loadScript(this.url_,function(e){this.getScene().removeInitLoadCount(this),null===e?this.setLoadState(C.FAILED_STATE):(this.setLoadState(C.COMPLETE_STATE),this.initialize__(e))}.bind(this)))},set_url__:function(){this.setLoadState(C.NOT_STATED_STATE),this.requestAsyncLoad()},getContext:function(e){try{var t=["initialize","prepareEvents","eventsProcessed","shutdown"],n=this.getUserDefinedFields();for(var i in n){var r=n[i];switch(r.getAccessType()){case C.inputOnly:t.push(r.getName());break;case C.inputOutput:t.push("set_"+r.getName())}}e+="\n;var "+t.join(",")+";",e+="\n["+t.join(",")+"];";for(var o=this.getGlobal(),s=v(o,e),a={},u=0;u<t.length;++u)"function"==typeof s[u]?a[t[u]]=s[u]:a[t[u]]=null;return a}catch(e){return this.setError("preprocessing",e),{}}},getGlobal:function(){function v(e){var t=_.createX3DFromString(String(e));if(t.getRootNodes().length&&t.getRootNodes()[0])return o.SFNode.call(this,t.getRootNodes()[0].getValue());throw new Error("SFNode.new: invalid argument, must be 'string' is 'undefined'.")}var _=this.getBrowser();v.prototype=Object.create(o.SFNode.prototype),v.prototype.constructor=v;var S={$:{value:e},NULL:{value:null},FALSE:{value:!1},TRUE:{value:!0},print:{value:function(){this.print.apply(this,arguments)}.bind(_)},trace:{value:function(){this.print.apply(this,arguments)}.bind(_)},Browser:{value:_},X3DConstants:{value:C},X3DBrowser:{value:s},X3DExecutionContext:{value:p},X3DScene:{value:f},ComponentInfo:{value:a},ComponentInfoArray:{value:u},ProfileInfo:{value:l},ProfileInfoArray:{value:c},UnitInfo:{value:h},UnitInfoArray:{value:d},ExternProtoDeclarationArray:{value:g},ProtoDeclarationArray:{value:m},X3DExternProtoDeclaration:{value:b},X3DProtoDeclaration:{value:w},RouteArray:{value:y},X3DRoute:{value:x},X3DFieldDefinition:{value:t},FieldDefinitionArray:{value:n},X3DField:{value:i},X3DArrayField:{value:r},SFColor:{value:o.SFColor},SFColorRGBA:{value:o.SFColorRGBA},SFImage:{value:o.SFImage},SFMatrix3d:{value:o.SFMatrix3d},SFMatrix3f:{value:o.SFMatrix3f},SFMatrix4d:{value:o.SFMatrix4d},SFMatrix4f:{value:o.SFMatrix4f},SFNode:{value:v},SFRotation:{value:o.SFRotation},SFVec3d:{value:o.SFVec2d},SFVec2f:{value:o.SFVec2f},SFVec2d:{value:o.SFVec3d},SFVec3f:{value:o.SFVec3f},SFVec4d:{value:o.SFVec4d},SFVec4f:{value:o.SFVec4f},VrmlMatrix:{value:o.VrmlMatrix},MFBool:{value:o.MFBool},MFColor:{value:o.MFColor},MFColorRGBA:{value:o.MFColorRGBA},MFDouble:{value:o.MFDouble},MFFloat:{value:o.MFFloat},MFImage:{value:o.MFImage},MFInt32:{value:o.MFInt32},MFMatrix3d:{value:o.MFMatrix3d},MFMatrix3f:{value:o.MFMatrix3f},MFMatrix4d:{value:o.MFMatrix4d},MFMatrix4f:{value:o.MFMatrix4f},MFNode:{value:o.MFNode},MFRotation:{value:o.MFRotation},MFString:{value:o.MFString},MFTime:{value:o.MFTime},MFVec2d:{value:o.MFVec2d},MFVec2f:{value:o.MFVec2f},MFVec3d:{value:o.MFVec3d},MFVec3f:{value:o.MFVec3f},MFVec4d:{value:o.MFVec4d},MFVec4f:{value:o.MFVec4f}},F=this.getUserDefinedFields();for(var T in F){var N=F[T];N.getAccessType()!==C.inputOnly&&(T in S||(S[T]={get:N.valueOf.bind(N),set:N.setValue.bind(N)}),N.getAccessType()===C.inputOutput&&(S[T+"_changed"]={get:N.valueOf.bind(N),set:N.setValue.bind(N)}))}return Object.create(Object.prototype,S)},set_live__:function(){var t=this.getUserDefinedFields();if(this.isLive().getValue()){e.isFunction(this.context.prepareEvents)&&this.getBrowser().prepareEvents().addInterest("prepareEvents__",this),e.isFunction(this.context.eventsProcessed)&&this.addInterest("eventsProcessed__",this);for(var n in t)switch((r=t[n]).getAccessType()){case C.inputOnly:i=this.context[r.getName()];e.isFunction(i)&&r.addInterest("set_field__",this,i);break;case C.inputOutput:var i=this.context["set_"+r.getName()];e.isFunction(i)&&r.addInterest("set_field__",this,i)}}else{this.context.prepareEvents&&this.getBrowser().prepareEvents().removeInterest("prepareEvents__",this),this.context.eventsProcessed&&this.removeInterest("eventsProcessed__",this);for(var n in t){var r=t[n];switch(r.getAccessType()){case C.inputOnly:case C.inputOutput:r.removeInterest("set_field__",this)}}}},initialize__:function(e){if(this.context=this.getContext(e),this.isLive().addInterest("set_live__",this),this.set_live__(),this.context.initialize){var t=this.getBrowser();t.getScriptStack().push(this);try{this.context.initialize()}catch(e){this.setError("initialize",e)}t.getScriptStack().pop()}},prepareEvents__:function(){var e=this.getBrowser();e.getScriptStack().push(this);try{this.context.prepareEvents(),e.addBrowserEvent()}catch(e){this.setError("prepareEvents",e)}e.getScriptStack().pop()},set_field__:function(e,t){var n=this.getBrowser();e.setTainted(!0),n.getScriptStack().push(this);try{t(e.valueOf(),n.getCurrentTime())}catch(t){this.setError(e.getName(),t)}n.getScriptStack().pop(),e.setTainted(!1)},eventsProcessed__:function(){var e=this.getBrowser();e.getScriptStack().push(this);try{this.context.eventsProcessed()}catch(e){this.setError("eventsProcessed",e)}e.getScriptStack().pop()},shutdown__:function(){var e=this.getBrowser();e.getScriptStack().push(this);try{this.context.shutdown()}catch(e){this.setError("shutdown",e)}e.getScriptStack().pop()},setError:function(e,t){console.error("JavaScript Error in Script '"+this.getName()+"', function '"+e+"'\nworld url is '"+this.getExecutionContext().getURL()+"':"),console.error(t),console.error(this.url_.toString())}}),F}),define("cobweb/Components/Shape/Shape",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shape/X3DShapeNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Algorithm","standard/Math/Geometry/Line3","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Algorithms/QuickSort"],function(e,t,n,i,r,o,s,a,u,l,c,h){function d(e){r.call(this,e),this.addType(s.Shape)}var p=[];return d.prototype=e.extend(Object.create(r.prototype),{constructor:d,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(s.initializeOnly,"bboxCenter",new t.SFVec3f),new n(s.inputOutput,"appearance",new t.SFNode),new n(s.inputOutput,"geometry",new t.SFNode)]),modelViewMatrix:new c,invModelViewMatrix:new c,hitRay:new u(new l(0,0,0),new l(0,0,0)),intersections:p,intersectionSorter:new h(p,function(e,t){return e.point.z>t.point.z}),getTypeName:function(){return"Shape"},getComponentName:function(){return"Shape"},getContainerField:function(){return"children"},set_geometry__:function(){r.prototype.set_geometry__.call(this),this.getGeometry()?delete this.traverse:this.traverse=Function.prototype},intersectsBox:function(e,t,n){return this.getGeometry().intersectsBox(e,t,n)},traverse:function(e,t){switch(e){case o.POINTER:this.pointer(t);break;case o.COLLISION:t.addCollisionShape(this);break;case o.DEPTH:t.addDepthShape(this);break;case o.DISPLAY:t.addDisplayShape(this)&&this.getAppearance().traverse(e,t)}this.getGeometry().traverse(e,t)},pointer:function(e){try{var t=this.getGeometry();if(t.getGeometryType()<2)return;var n=e.getBrowser(),i=this.modelViewMatrix.assign(e.getModelViewMatrix().get()),r=this.invModelViewMatrix.assign(i).inverse(),o=this.intersections;if(this.hitRay.assign(n.getHitRay()).multLineMatrix(r),t.intersectsLine(this.hitRay,e.getClipPlanes(),i,o)){for(var s=0;s<o.length;++s)i.multVecMatrix(o[s].point);this.intersectionSorter.sort(0,o.length);var u=a.lowerBound(o,0,o.length,-e.getNavigationInfo().getNearValue(),function(e,t){return e.point.z>t});u!==o.length&&(r.multMatrixDir(o[u].normal).normalize(),n.addHit(o[u],e.getLayer())),o.length=0}}catch(e){console.log(e)}},depth:function(e,t){this.getGeometry().depth(e,t)},display:function(e){this.getAppearance().display(e),this.getGeometry().display(e)}}),d}),define("cobweb/Components/Sound/X3DSoundNode",["jquery","cobweb/Components/Core/X3DChildNode","cobweb/Bits/X3DConstants"],function(e,t,n){function i(e){t.call(this,e),this.addType(n.X3DSoundNode)}return i.prototype=e.extend(Object.create(t.prototype),{constructor:i}),i}),define("cobweb/Components/Sound/Sound",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Sound/X3DSoundNode","cobweb/Bits/X3DCast","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(e,t,n,i,r,o,s,a,u,l,c,h){function d(e){r.call(this,e),this.addType(a.Sound),this.min={radius:0,distance:0},this.max={radius:0,distance:0}}return d.prototype=e.extend(Object.create(r.prototype),{constructor:d,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"intensity",new t.SFFloat(1)),new n(a.initializeOnly,"spatialize",new t.SFBool(!0)),new n(a.inputOutput,"location",new t.SFVec3f),new n(a.inputOutput,"direction",new t.SFVec3f(0,0,1)),new n(a.inputOutput,"minBack",new t.SFFloat(1)),new n(a.inputOutput,"minFront",new t.SFFloat(1)),new n(a.inputOutput,"maxBack",new t.SFFloat(10)),new n(a.inputOutput,"maxFront",new t.SFFloat(10)),new n(a.inputOutput,"priority",new t.SFFloat),new n(a.inputOutput,"source",new t.SFNode)]),transformationMatrix:new h,translation:new l(0,0,0),rotation:new c,scale:new l(1,1,1),viewer:new l(0,0,0),zAxis:new l(0,0,1),getTypeName:function(){return"Sound"},getComponentName:function(){return"Sound"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.source_.addInterest("set_source__",this),this.set_source__()},set_source__:function(){this.sourceNode&&this.sourceNode.setVolume(0),this.sourceNode=o(a.X3DSoundSourceNode,this.source_)},traverse:function(e,t){if(e===s.DISPLAY&&this.sourceNode&&this.sourceNode.isActive_.getValue()&&!this.sourceNode.isPaused_.getValue())try{var n=t.getModelViewMatrix().get();if(this.getEllipsoidParameter(n,this.maxBack_.getValue(),this.maxFront_.getValue(),this.max),this.getEllipsoidParameter(n,this.minBack_.getValue(),this.minFront_.getValue(),this.min),this.max.distance<this.max.radius)if(this.min.distance<this.min.radius)this.sourceNode.setVolume(this.intensity_.getValue());else{var i=this.max.radius-this.max.distance,r=this.max.radius-this.min.radius;this.sourceNode.setVolume(this.intensity_.getValue()*(i/r))}else this.sourceNode.setVolume(0)}catch(e){console.log(e)}},getEllipsoidParameter:function(e,t,n,i){var r=(t+n)/2,o=r-t,s=Math.sqrt(r*r-o*o);this.translation.z=o,this.rotation.setFromToVec(this.zAxis,this.direction_.getValue()),this.scale.z=r/s;var a=this.transformationMatrix;a.assign(e),a.translate(this.location_.getValue()),a.rotate(this.rotation),a.translate(this.translation),a.scale(this.scale),a.inverse(),this.viewer.set(a[12],a[13],a[14]),i.radius=s,i.distance=this.viewer.abs()}}),d}),define("cobweb/Components/Geometry3D/Sphere",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.Sphere)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"radius",new t.SFFloat(1)),new n(o.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Sphere"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},set_live__:function(){r.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getSphereOptions().addInterest("eventsProcessed",this):this.getBrowser().getSphereOptions().removeInterest("eventsProcessed",this)},build:function(){var e=this.getBrowser().getSphereOptions().getGeometry(),t=this.radius_.getValue();if(this.setNormals(e.getNormals()),this.setTexCoords(e.getTexCoords()),1===t)this.setVertices(e.getVertices()),this.getMin().assign(e.getMin()),this.getMax().assign(e.getMax());else{for(var n=e.getVertices(),i=this.getVertices(),r=0;r<n.length;r+=4)i.push(t*n[r],t*n[r+1],t*n[r+2],1);t=Math.abs(t),this.getMin().set(-t,-t,-t),this.getMax().set(t,t,t)}this.setSolid(this.solid_.getValue())}}),s}),define("standard/Math/Geometry/Sphere3",["standard/Math/Numbers/Vector3"],function(e){function t(e,t){this.radius=e,this.center=t.copy()}var n=new e(0,0,0),i=new e(0,0,0),r=new e(0,0,0),o=new e(0,0,0),s=new e(0,0,0),a=new e(0,0,0),u=new e(0,0,0),l=new e(0,0,0);return t.prototype={constructor:t,set:function(e,t){this.radius=e,this.center.assign(t)},intersectsLine:function(t,i,r){n.assign(this.center).subtract(t.point);var o=e.dot(n,t.direction);if(o<0)return!1;var s=e.dot(n,n)-Math.pow(o,2),a=Math.pow(this.radius,2);if(s>a)return!1;var u=Math.sqrt(a-s),l=o-u,c=o+u;return i.assign(t.direction).multiply(l).add(t.point),r.assign(t.direction).multiply(c).add(t.point),!0},intersectsTriangle:function(t,n,c){var h=this.center,d=this.radius;t.subtract(h),n.subtract(h),c.subtract(h),i.assign(n).subtract(t),r.assign(c).subtract(t);var p=d*d,f=i.cross(r),g=e.dot(t,f);if(g*g>p*e.dot(f,f))return!1;var m=e.dot(t,t),b=e.dot(t,n),w=e.dot(t,c),y=e.dot(n,n),x=e.dot(n,c),v=e.dot(c,c),_=m>p&&b>m&&w>m,S=y>p&&b>y&&x>y,C=v>p&&w>v&&x>v;if(_||S||C)return!1;i.assign(n).subtract(t),o.assign(c).subtract(n),s.assign(t).subtract(c);var F=b-m,T=x-y,N=w-v,O=e.dot(i,i),M=e.dot(o,o),V=e.dot(s,s);a.assign(t).multiply(O).subtract(i.multiply(F)),u.assign(n).multiply(M).subtract(o.multiply(T)),l.assign(c).multiply(V).subtract(s.multiply(N));var D=c.multiply(O).subtract(a),I=t.multiply(M).subtract(u),B=n.multiply(V).subtract(l),E=e.dot(a,a)>p*O*O&&e.dot(a,D)>0,A=e.dot(u,u)>p*M*M&&e.dot(u,I)>0,P=e.dot(l,l)>p*V*V&&e.dot(l,B)>0;return!(E||A||P)},toString:function(){return this.radius+" "+this.center.toString()}},t}),define("cobweb/Components/PointingDeviceSensor/SphereSensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/PointingDeviceSensor/X3DDragSensorNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Triangle3","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Geometry/Sphere3"],function(e,t,n,i,r,o,s,a,u,l,c,h,d){function p(e){r.call(this,e),this.addType(o.SphereSensor)}return p.prototype=e.extend(Object.create(r.prototype),{constructor:p,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"description",new t.SFString),new n(o.inputOutput,"autoOffset",new t.SFBool(!0)),new n(o.inputOutput,"offset",new t.SFRotation),new n(o.outputOnly,"trackPoint_changed",new t.SFVec3f),new n(o.outputOnly,"rotation_changed",new t.SFRotation),new n(o.outputOnly,"isOver",new t.SFBool),new n(o.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"SphereSensor"},getComponentName:function(){return"PointingDeviceSensor"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.modelViewMatrix=new u,this.invModelViewMatrix=new u,this.sphere=null,this.zPlane=null,this.behind=!1,this.fromVector=new s(0,0,0),this.startPoint=new s(0,0,0),this.startOffset=new a(0,0,1,0)},getTrackPoint:function(e,t,n){var i=new s(0,0,0);return!!this.sphere.intersectsLine(e,t,i)&&((s.subtract(e.point,i).abs()<s.subtract(e.point,t).abs())-n&&t.assign(i),!0)},set_active__:function(e,t,n,i,o){r.prototype.set_active__.call(this,e,t,n,i,o);try{if(this.isActive_.getValue()){this.modelViewMatrix.assign(n),this.invModelViewMatrix.assign(n).inverse();var a=this.invModelViewMatrix.multVecMatrix(t.intersection.point.copy()),u=new s(0,0,0);this.zPlane=new h(u,this.invModelViewMatrix.multDirMatrix(new s(0,0,1)).normalize()),this.sphere=new d(a.abs(),u),this.behind=this.zPlane.getDistanceToPoint(a)<0,this.fromVector.assign(a),this.startPoint.assign(a),this.startOffset.assign(this.offset_.getValue()),this.trackPoint_changed_=a,this.rotation_changed_=this.offset_.getValue()}else this.autoOffset_.getValue()&&(this.offset_=this.rotation_changed_)}catch(e){}},set_motion__:function(e){try{var t=e.hitRay.copy().multLineMatrix(this.invModelViewMatrix),n=new s(0,0,0);if(this.getTrackPoint(t,n,this.behind)){var i=this.invModelViewMatrix.multDirMatrix(new s(0,0,1)).normalize();this.zPlane=new h(n,i)}else{var r=new s(0,0,0);this.zPlane.intersectsLine(t,r),t=new c(r,s.subtract(this.sphere.center,r).normalize()),this.getTrackPoint(t,n,!1);var o=l.normal(this.sphere.center,n,this.startPoint,new s(0,0,0)),u=s.subtract(n,this.sphere.center).normalize(),d=s.cross(o,u).normalize(),p=s.subtract(n,d.multiply(s.subtract(r,n).abs()));t=new c(p,s.subtract(this.sphere.center,p).normalize()),this.getTrackPoint(t,n,!1)}this.trackPoint_changed_=n;var f=s.subtract(n,this.sphere.center),g=new a(this.fromVector,f);this.behind&&g.inverse(),this.rotation_changed_=a.multRight(this.startOffset,g)}catch(e){this.trackPoint_changed_.addEvent(),this.rotation_changed_.addEvent()}}}),p}),define("cobweb/Browser/Interpolation/CatmullRomSplineInterpolator",["standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4"],function(e,t){function n(){this.T0=[],this.T1=[]}var i=[],r=[],o=[],s=new e(0,0,0,0),a=new t(2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0);return n.prototype={constructor:n,generate:function(e,t,n,s,a){var u=this.T0,l=this.T1;if(u.length=0,l.length=0,i.length=0,r.length=0,o.length=0,t.length>1){if(0===s.length){e?i.push(this.divide(this.subtract(n[1].getValue(),n[n.size()-2].getValue()),2)):i.push(this.create());for(var c=1,h=n.length-1;c<h;++c)i.push(this.divide(this.subtract(n[c+1].getValue(),n[c-1].getValue()),2));i.push(this.copy(i[0]))}else{for(var c=0,h=s.length;c<h;++c)i.push(this.copy(s[c].getValue()));if(a){for(var d=0,c=0,h=n.length-1;c<h;++c)d+=this.abs(this.subtract(n[c].getValue(),n[c+1].getValue()));for(var c=0,h=i.length-1;c<h;++c)i[c]=this.multiply(i[c],d/this.abs(i[c]))}}if(e){var p=t.length-1,f=t.length-2,g=t[1].getValue()-t[0].getValue()+t[p].getValue()-t[f].getValue();o.push(2*(t[1].getValue()-t[0].getValue())/g),r.push(2*(t[p].getValue()-t[f].getValue())/g)}else o.push(1),r.push(1);for(var c=1,h=t.length-1;c<h;++c){g=t[c+1].getValue()-t[c-1].getValue();o.push(2*(t[c+1].getValue()-t[c].getValue())/g),r.push(2*(t[c].getValue()-t[c-1].getValue())/g)}o.push(o[0]),r.push(r[0]);for(var c=0,h=i.length;c<h;++c)u.push(this.multiply(i[c],r[c])),l.push(this.multiply(i[c],o[c]))}else u.push(this.create()),l.push(this.create())},interpolate:function(e,t,n,i){return s.set(Math.pow(n,3),Math.pow(n,2),n,1),this.dot(a.multVecMatrix(s),i[e].getValue(),i[t].getValue(),this.T0[e],this.T1[t])}},n}),define("cobweb/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate",["jquery","cobweb/Browser/Interpolation/CatmullRomSplineInterpolator"],function(e,t){return function(n){function i(){this.T0=[],this.T1=[]}var r=new n(0,0,0,0),o=new n(0,0,0,0),s=new n(0,0,0,0),a=new n(0,0,0,0);return i.prototype=e.extend(Object.create(t.prototype),{constructor:i,create:function(){return new n(0,0,0,0)},copy:function(e){return e.copy()},subtract:function(e,t){return n.subtract(e,t)},multiply:function(e,t){return n.multiply(e,t)},divide:function(e,t){return n.divide(e,t)},abs:function(e){return e.abs()},dot:function(e,t,n,i,u){return r.assign(t).multiply(e[0]),o.assign(n).multiply(e[1]),s.assign(i).multiply(e[2]),a.assign(u).multiply(e[3]),r.add(o).add(s).add(a)}}),i}}),define("cobweb/Browser/Interpolation/CatmullRomSplineInterpolator3",["cobweb/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate","standard/Math/Numbers/Vector3"],function(e,t){return e(t)}),define("cobweb/Components/Interpolation/SplinePositionInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Browser/Interpolation/CatmullRomSplineInterpolator3","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.SplinePositionInterpolator),this.spline=new o}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_fraction",new t.SFFloat),new n(s.inputOutput,"closed",new t.SFBool),new n(s.inputOutput,"key",new t.MFFloat),new n(s.inputOutput,"keyValue",new t.MFVec3f),new n(s.inputOutput,"keyVelocity",new t.MFVec3f),new n(s.inputOutput,"normalizeVelocity",new t.SFBool),new n(s.outputOnly,"value_changed",new t.SFVec3f)]),getTypeName:function(){return"SplinePositionInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this)},set_keyValue__:function(){var e=this.key_,n=this.keyValue_;n.length<e.length&&n.resize(e.length,n.length?n[n.length-1]:new t.SFVec3f),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFVec3f),this.spline.generate(this.closed_.getValue(),this.key_.getValue(),this.keyValue_.getValue(),this.keyVelocity_.getValue(),this.normalizeVelocity_.getValue())},interpolate:function(e,t,n){this.value_changed_=this.spline.interpolate(e,t,n,this.keyValue_.getValue())}}),a}),define("cobweb/Browser/Interpolation/CatmullRomSplineInterpolator2",["cobweb/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate","standard/Math/Numbers/Vector2"],function(e,t){return e(t)}),define("cobweb/Components/Interpolation/SplinePositionInterpolator2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Browser/Interpolation/CatmullRomSplineInterpolator2","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.SplinePositionInterpolator2D),this.spline=new o}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_fraction",new t.SFFloat),new n(s.inputOutput,"closed",new t.SFBool),new n(s.inputOutput,"key",new t.MFFloat),new n(s.inputOutput,"keyValue",new t.MFVec2f),new n(s.inputOutput,"keyVelocity",new t.MFVec2f),new n(s.inputOutput,"normalizeVelocity",new t.SFBool),new n(s.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"SplinePositionInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this)},set_keyValue__:function(){var e=this.key_,n=this.keyValue_;n.length<e.length&&n.resize(e.length,n.length?n[n.length-1]:new t.SFVec2f),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFVec2f),this.spline.generate(this.closed_.getValue(),this.key_.getValue(),this.keyValue_.getValue(),this.keyVelocity_.getValue(),this.normalizeVelocity_.getValue())},interpolate:function(e,t,n){this.value_changed_=this.spline.interpolate(e,t,n,this.keyValue_.getValue())}}),a}),define("cobweb/Browser/Interpolation/CatmullRomSplineInterpolator1",["jquery","cobweb/Browser/Interpolation/CatmullRomSplineInterpolator"],function(e,t){function n(){this.T0=[],this.T1=[]}return n.prototype=e.extend(Object.create(t.prototype),{constructor:n,create:function(){return 0},copy:function(e){return e},subtract:function(e,t){return e-t},multiply:function(e,t){return e*t},divide:function(e,t){return e/t},abs:function(e){return Math.abs(e)},dot:function(e,t,n,i,r){return t*e[0]+n*e[1]+i*e[2]+r*e[3]}}),n}),define("cobweb/Components/Interpolation/SplineScalarInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Browser/Interpolation/CatmullRomSplineInterpolator1","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.SplineScalarInterpolator),this.spline=new o}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_fraction",new t.SFFloat),new n(s.inputOutput,"closed",new t.SFBool),new n(s.inputOutput,"key",new t.MFFloat),new n(s.inputOutput,"keyValue",new t.MFFloat),new n(s.inputOutput,"keyVelocity",new t.MFFloat),new n(s.inputOutput,"normalizeVelocity",new t.SFBool),new n(s.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"SplineScalarInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this)},set_keyValue__:function(){var e=this.key_,n=this.keyValue_;n.length<e.length&&n.resize(e.length,n.length?n[n.length-1]:new t.SFFloat),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFFloat),this.spline.generate(this.closed_.getValue(),this.key_.getValue(),this.keyValue_.getValue(),this.keyVelocity_.getValue(),this.normalizeVelocity_.getValue())},interpolate:function(e,t,n){this.value_changed_=this.spline.interpolate(e,t,n,this.keyValue_.getValue())}}),a}),define("cobweb/Components/Lighting/SpotLight",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Lighting/X3DLightNode","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Geometry/Box3","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Math/Algorithm","standard/Utility/ObjectCache"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b){function w(){this.location=new h(0,0,0),this.direction=new h(0,0,0),this.renderShadow=!0,this.shadowBuffer=null,this.bbox=new u,this.viewVolume=new c,this.viewport=new d(0,0,0,0),this.projectionMatrix=new f,this.modelViewMatrix=new g(f),this.transformationMatrix=new f,this.invLightSpaceMatrix=new f,this.invLightSpaceProjectionMatrix=new f,this.shadowMatrix=new f,this.shadowMatrixArray=new Float32Array(16),this.invGroupMatrix=new f,this.rotation=new p,this.lightBBoxMin=new h(0,0,0),this.lightBBoxMax=new h(0,0,0),this.textureUnit=0}function y(e){r.call(this,e),this.addType(a.SpotLight)}var x=b(w);return w.prototype={constructor:w,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(e,t,n,i){var r=e.getContext(),o=t.getShadowMapSize();this.browser=e,this.lightNode=t,this.groupNode=n,this.modelViewMatrix.pushMatrix(i),t.getShadowIntensity()>0&&o>0&&(this.shadowBuffer=e.popShadowBuffer(o),this.shadowBuffer?e.getCombinedTextureUnits().length?(this.textureUnit=e.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(e){try{if(!this.shadowBuffer)return;var t=this.lightNode,n=e.getCameraSpaceMatrix().get(),i=this.transformationMatrix.assign(this.modelViewMatrix.get()).multRight(n),r=this.invLightSpaceMatrix.assign(t.getGlobal()?i:f.Identity);r.translate(t.getLocation()),r.rotate(this.rotation.setFromToVec(h.zAxis,this.direction.assign(t.getDirection()).negate())),r.inverse();var a=o.prototype.getBBox.call(this.groupNode,this.bbox).multRight(r),u=t.getShadowMapSize(),c=(a.getExtents(this.lightBBoxMin,this.lightBBoxMax),Math.min(t.getRadius(),-this.lightBBoxMin.z)),d=this.viewport.set(0,0,u,u),p=l.perspective(2*t.getCutOffAngle(),.125,c,u,u,this.projectionMatrix),g=this.invGroupMatrix.assign(this.groupNode.getMatrix()).inverse();this.renderShadow=c>0,this.shadowBuffer.bind(),e.getViewVolumes().push(this.viewVolume.set(p,d,d)),e.getProjectionMatrix().pushMatrix(p),e.getModelViewMatrix().pushMatrix(r),e.getModelViewMatrix().multLeft(g),e.render(s.DEPTH,this.groupNode),e.getModelViewMatrix().pop(),e.getProjectionMatrix().pop(),e.getViewVolumes().pop(),this.shadowBuffer.unbind(),t.getGlobal()||r.multLeft(i.inverse()),this.invLightSpaceProjectionMatrix.assign(r).multRight(p).multRight(t.getBiasMatrix())}catch(e){console.log(e)}},setGlobalVariables:function(e){var t=this.lightNode,n=this.modelViewMatrix.get();n.multVecMatrix(this.location.assign(t.location_.getValue())),n.multDirMatrix(this.direction.assign(t.direction_.getValue())).normalize(),this.shadowMatrix.assign(e.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(e,t,n){var i=this.lightNode,r=i.getColor(),o=i.getAttenuation(),s=(this.modelViewMatrix.get(),this.location),a=this.direction,u=i.getShadowColor();e.uniform1i(t.x3d_LightType[n],3),e.uniform3f(t.x3d_LightColor[n],r.r,r.g,r.b),e.uniform1f(t.x3d_LightIntensity[n],i.getIntensity()),e.uniform1f(t.x3d_LightAmbientIntensity[n],i.getAmbientIntensity()),e.uniform3f(t.x3d_LightAttenuation[n],Math.max(0,o.x),Math.max(0,o.y),Math.max(0,o.z)),e.uniform3f(t.x3d_LightLocation[n],s.x,s.y,s.z),e.uniform3f(t.x3d_LightDirection[n],a.x,a.y,a.z),e.uniform1f(t.x3d_LightRadius[n],i.getRadius()),e.uniform1f(t.x3d_LightBeamWidth[n],i.getBeamWidth()),e.uniform1f(t.x3d_LightCutOffAngle[n],i.getCutOffAngle()),this.renderShadow&&this.textureUnit?(this.shadowMatrixArray.set(this.shadowMatrix),e.uniform1f(t.x3d_ShadowIntensity[n],i.getShadowIntensity()),e.uniform1f(t.x3d_ShadowDiffusion[n],i.getShadowDiffusion()),e.uniform3f(t.x3d_ShadowColor[n],u.r,u.g,u.b),e.uniformMatrix4fv(t.x3d_ShadowMatrix[n],!1,this.shadowMatrixArray),e.uniform1i(t.x3d_ShadowMap[n],this.textureUnit)):e.uniform1f(t.x3d_ShadowIntensity[n],0)},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,x.push(this)}},y.prototype=e.extend(Object.create(r.prototype),{constructor:y,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"global",new t.SFBool(!0)),new n(a.inputOutput,"on",new t.SFBool(!0)),new n(a.inputOutput,"color",new t.SFColor(1,1,1)),new n(a.inputOutput,"intensity",new t.SFFloat(1)),new n(a.inputOutput,"ambientIntensity",new t.SFFloat),new n(a.inputOutput,"attenuation",new t.SFVec3f(1,0,0)),new n(a.inputOutput,"location",new t.SFVec3f),new n(a.inputOutput,"direction",new t.SFVec3f(0,0,-1)),new n(a.inputOutput,"radius",new t.SFFloat(100)),new n(a.inputOutput,"beamWidth",new t.SFFloat(.785398)),new n(a.inputOutput,"cutOffAngle",new t.SFFloat(1.5708)),new n(a.inputOutput,"shadowColor",new t.SFColor),new n(a.inputOutput,"shadowIntensity",new t.SFFloat),new n(a.inputOutput,"shadowDiffusion",new t.SFFloat),new n(a.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"SpotLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getAttenuation:function(){return this.attenuation_.getValue()},getLocation:function(){return this.location_.getValue()},getRadius:function(){return Math.max(0,this.radius_.getValue())},getBeamWidth:function(){var e=this.beamWidth_.getValue(),t=this.getCutOffAngle();return e>t?t:m.clamp(e,0,Math.PI/2)},getCutOffAngle:function(){return m.clamp(this.cutOffAngle_.getValue(),0,Math.PI/2)},getLights:function(){return x}}),y}),define("cobweb/Browser/Interpolation/SquatInterpolator",["standard/Math/Numbers/Rotation4"],function(e){function t(){this.s=[]}var n=new e(0,0,1,0);return t.prototype={constructor:t,generate:function(t,n,i){var r=this.s;if(r.length=0,n.length>1){t?r.push(e.spline(i[n.length-2].getValue(),i[0].getValue(),i[1].getValue())):r.push(i[0].getValue());for(var o=1,s=n.length-1;o<s;++o)r.push(e.spline(i[o-1].getValue(),i[o].getValue(),i[o+1].getValue()));t?r.push(e.spline(i[n.length-2].getValue(),i[n.length-1].getValue(),i[1].getValue())):r.push(i[n.length-1].getValue())}else n.length>0&&r.push(i[0].getValue().copy())},interpolate:function(e,t,i,r){return n.assign(r[e].getValue()).squad(this.s[e],this.s[t],r[t].getValue(),i)}},t}),define("cobweb/Components/Interpolation/SquadOrientationInterpolator",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Interpolation/X3DInterpolatorNode","cobweb/Browser/Interpolation/SquatInterpolator","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.SquadOrientationInterpolator),this.squad=new o}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_fraction",new t.SFFloat),new n(s.inputOutput,"closed",new t.SFBool),new n(s.inputOutput,"key",new t.MFFloat),new n(s.inputOutput,"keyValue",new t.MFRotation),new n(s.outputOnly,"value_changed",new t.SFRotation)]),getTypeName:function(){return"SquadOrientationInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,n=this.keyValue_;n.length<e.length&&n.resize(e.length,n.length?n[n.length-1]:new t.SFRotation),this.squad.generate(this.closed_.getValue(),this.key_.getValue(),this.keyValue_.getValue())},interpolate:function(e,t,n){try{this.value_changed_=this.squad.interpolate(e,t,n,this.keyValue_.getValue())}catch(e){console.log(e)}}}),a}),define("cobweb/Components/Grouping/StaticGroup",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DChildNode","cobweb/Components/Grouping/X3DBoundedObject","cobweb/Components/Grouping/Group","cobweb/Bits/X3DConstants","standard/Math/Geometry/Box3"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),o.call(this,e),this.addType(a.StaticGroup),this.group=new s(this.getExecutionContext()),this.bbox=new u}return l.prototype=e.extend(Object.create(r.prototype),o.prototype,{constructor:l,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(a.initializeOnly,"bboxCenter",new t.SFVec3f),new n(a.initializeOnly,"children",new t.MFNode)]),getTypeName:function(){return"StaticGroup"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),o.prototype.initialize.call(this),this.bboxSize_.addFieldInterest(this.group.bboxSize_),this.bboxCenter_.addFieldInterest(this.group.bboxCenter_),this.children_.addFieldInterest(this.group.children_),this.group.bboxSize_=this.bboxSize_,this.group.bboxCenter_=this.bboxCenter_,this.group.children_=this.children_,this.group.setPrivate(!0),this.group.setup(),this.group.isCameraObject_.addFieldInterest(this.isCameraObject_),this.group.children_.addInterest("set_children__",this),this.set_children__()},getBBox:function(e){return e.assign(this.bbox)},set_children__:function(){this.group.getBBox(this.bbox)},traverse:function(e,t){this.group.traverse(e,t)}}),l}),define("cobweb/Components/ParticleSystems/SurfaceEmitter",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticleEmitterNode","cobweb/Bits/X3DConstants","cobweb/Bits/X3DCast","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(o.SurfaceEmitter),this.surfaceNode=null,this.areaSoFarArray=[0]}function h(e){return e.set(0,0,0)}var d=new u(0,0,0),p=new u(0,0,0),f=new u(0,0,0),g=new u(0,0,0);return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"speed",new t.SFFloat),new n(o.inputOutput,"variation",new t.SFFloat(.25)),new n(o.initializeOnly,"mass",new t.SFFloat),new n(o.initializeOnly,"surfaceArea",new t.SFFloat),new n(o.initializeOnly,"surface",new t.SFNode)]),getTypeName:function(){return"SurfaceEmitter"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"emitter"},initialize:function(){r.prototype.initialize.call(this),this.surface_.addInterest("set_surface__",this),this.set_surface__()},set_surface__:function(){this.surfaceNode&&this.surfaceNode.removeInterest("set_geometry__",this),this.surfaceNode=s(o.X3DGeometryNode,this.surface_),this.surfaceNode&&this.surfaceNode.addInterest("set_geometry__",this),this.set_geometry__()},set_geometry__:function(){if(this.surfaceNode){delete this.getRandomPosition,delete this.getRandomVelocity;var e=0,t=this.areaSoFarArray,n=this.surfaceNode.getVertices();t.length=1;for(var i=0,r=n.length;i<r;i+=12)d.set(n[i+0],n[i+1],n[i+2]),p.set(n[i+4],n[i+5],n[i+6]),f.set(n[i+8],n[i+9],n[i+10]),e+=a.area(d,p,f),t.push(e)}else this.getRandomPosition=h,this.getRandomVelocity=this.getSphericalRandomVelocity,g.set(0,0,0)},getRandomPosition:function(e){var t=this.areaSoFarArray,n=t.length,i=Math.random()*t[n-1],r=0;if(1==n||i<=t[0])r=0;else if(i>=t[n-1])r=n-2;else{var o=l.upperBound(t,0,n,i,l.less);r=o<n?o-1:0}var s=Math.random(),a=Math.random();s+a>1&&(s=1-s,a=1-a);var u=12*r,c=this.surfaceNode.getVertices(),h=1-s-a;e.x=s*c[u+0]+a*c[u+4]+h*c[u+8],e.y=s*c[u+1]+a*c[u+5]+h*c[u+9],e.z=s*c[u+2]+a*c[u+6]+h*c[u+10];var u=9*r,d=this.surfaceNode.getNormals();return g.x=s*d[u+0]+a*d[u+3]+h*d[u+6],g.y=s*d[u+1]+a*d[u+4]+h*d[u+7],g.z=s*d[u+2]+a*d[u+5]+h*d[u+8],e},getRandomVelocity:function(e){var t=this.getRandomSpeed();return e.x=g.x*t,e.y=g.y*t,e.z=g.z*t,e}}),c}),define("cobweb/Components/Grouping/Switch",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DGroupingNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.Switch),this.addAlias("choice",this.children_)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"whichChoice",new t.SFInt32(-1)),new n(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(s.initializeOnly,"bboxCenter",new t.SFVec3f),new n(s.inputOnly,"addChildren",new t.MFNode),new n(s.inputOnly,"removeChildren",new t.MFNode),new n(s.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Switch"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.whichChoice_.addInterest("set_whichChoice__",this),this.set_whichChoice__()},getBBox:function(e){if(this.bboxSize_.getValue().equals(this.defaultBBoxSize)){var t=o(s.X3DBoundedObject,this.child);return t?t.getBBox(e):e.set()}return e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},set_whichChoice__:function(){this.set_cameraObjects__()},set_cameraObjects__:function(){this.child=this.getChild(this.whichChoice_.getValue()),this.child&&this.child.getCameraObject?this.setCameraObject(this.child.getCameraObject()):this.setCameraObject(!1)},traverse:function(e,t){this.child&&this.child.traverse(e,t)}}),a}),define("cobweb/Components/Followers/TexCoordChaser2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DChaserNode","cobweb/Browser/Followers/X3DArrayChaserTemplate","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),l.call(this,e),this.addType(s.TexCoordChaser2D)}var l=o(r);return u.prototype=e.extend(Object.create(r.prototype),l.prototype,{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_value",new t.MFVec2f),new n(s.inputOnly,"set_destination",new t.MFVec2f),new n(s.initializeOnly,"initialValue",new t.MFVec2f),new n(s.initializeOnly,"initialDestination",new t.MFVec2f),new n(s.initializeOnly,"duration",new t.SFTime(1)),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"value_changed",new t.MFVec2f)]),getTypeName:function(){return"TexCoordChaser2D"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new a(0,0)},getArray:function(){return new t.MFVec2f}}),u}),define("cobweb/Components/Followers/TexCoordDamper2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Followers/X3DDamperNode","cobweb/Browser/Followers/X3DArrayFollowerTemplate","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),l.call(this,e),this.addType(s.TexCoordDamper2D)}var l=o(r);return u.prototype=e.extend(Object.create(r.prototype),l.prototype,{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_value",new t.MFVec2f),new n(s.inputOnly,"set_destination",new t.MFVec2f),new n(s.initializeOnly,"initialValue",new t.MFVec2f),new n(s.initializeOnly,"initialDestination",new t.MFVec2f),new n(s.initializeOnly,"order",new t.SFInt32(3)),new n(s.inputOutput,"tau",new t.SFTime(.3)),new n(s.inputOutput,"tolerance",new t.SFFloat(-1)),new n(s.outputOnly,"isActive",new t.SFBool),new n(s.outputOnly,"value_changed",new t.MFVec2f)]),getTypeName:function(){return"TexCoordDamper2D"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new a(0,0,0)},getArray:function(){return new t.MFVec2f}}),u}),define("cobweb/Components/Text/Text",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.Text)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"string",new t.MFString),new n(s.inputOutput,"length",new t.MFFloat),new n(s.inputOutput,"maxExtent",new t.SFFloat),new n(s.initializeOnly,"solid",new t.SFBool),new n(s.outputOnly,"origin",new t.SFVec3f),new n(s.outputOnly,"textBounds",new t.SFVec2f),new n(s.outputOnly,"lineBounds",new t.MFVec2f),new n(s.inputOutput,"fontStyle",new t.SFNode)]),getTypeName:function(){return"Text"},getComponentName:function(){return"Text"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.fontStyle_.addInterest("set_fontStyle__",this),this.set_fontStyle__(),this.eventsProcessed()},getMatrix:function(){return this.textGeometry.getMatrix()},getLength:function(e){return e<this.length_.length?Math.max(0,this.length_[e]):0},set_live__:function(){r.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getBrowserOptions().PrimitiveQuality_.addInterest("eventsProcessed",this):this.getBrowser().getBrowserOptions().PrimitiveQuality_.removeInterest("eventsProcessed",this)},set_fontStyle__:function(){this.fontStyleNode&&this.fontStyleNode.removeInterest("addNodeEvent",this),this.fontStyleNode=o(s.X3DFontStyleNode,this.fontStyle_),this.fontStyleNode||(this.fontStyleNode=this.getBrowser().getDefaultFontStyle()),this.fontStyleNode.addInterest("addNodeEvent",this),this.textGeometry=this.fontStyleNode.getTextGeometry(this)},build:function(){this.textGeometry.update(),this.textGeometry.build(),this.setSolid(this.solid_.getValue())},traverse:function(e,t){try{this.textGeometry.traverse(e,t),r.prototype.traverse.call(this,e,t)}catch(e){console.log(e)}},display:function(e){try{this.textGeometry.display(e),r.prototype.display.call(this,e)}catch(e){console.log(e)}},transformLine:function(e){return this.textGeometry.transformLine(e)},transformMatrix:function(e){return this.textGeometry.transformMatrix(e)}}),a}),define("cobweb/Components/EnvironmentalEffects/TextureBackground",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EnvironmentalEffects/X3DBackgroundNode","cobweb/Bits/X3DCast","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(s.TextureBackground)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOnly,"set_bind",new t.SFBool),new n(s.inputOutput,"skyAngle",new t.MFFloat),new n(s.inputOutput,"skyColor",new t.MFColor(0,0,0)),new n(s.inputOutput,"groundAngle",new t.MFFloat),new n(s.inputOutput,"groundColor",new t.MFColor),new n(s.inputOutput,"transparency",new t.SFFloat),new n(s.outputOnly,"isBound",new t.SFBool),new n(s.outputOnly,"bindTime",new t.SFTime),new n(s.inputOutput,"frontTexture",new t.SFNode),new n(s.inputOutput,"backTexture",new t.SFNode),new n(s.inputOutput,"leftTexture",new t.SFNode),new n(s.inputOutput,"rightTexture",new t.SFNode),new n(s.inputOutput,"topTexture",new t.SFNode),new n(s.inputOutput,"bottomTexture",new t.SFNode)]),getTypeName:function(){return"TextureBackground"},getComponentName:function(){return"EnvironmentalEffects"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.frontTexture_.addInterest("set_frontTexture__",this),this.backTexture_.addInterest("set_backTexture__",this),this.leftTexture_.addInterest("set_leftTexture__",this),this.rightTexture_.addInterest("set_rightTexture__",this),this.topTexture_.addInterest("set_topTexture__",this),this.bottomTexture_.addInterest("set_bottomTexture__",this),this.set_frontTexture__(this.frontTexture_),this.set_backTexture__(this.backTexture_),this.set_leftTexture__(this.leftTexture_),this.set_rightTexture__(this.rightTexture_),this.set_topTexture__(this.topTexture_),this.set_bottomTexture__(this.bottomTexture_)},set_frontTexture__:function(){r.prototype.set_frontTexture__.call(this,o(s.X3DTextureNode,this.frontTexture_))},set_backTexture__:function(){r.prototype.set_backTexture__.call(this,o(s.X3DTextureNode,this.backTexture_))},set_leftTexture__:function(){r.prototype.set_leftTexture__.call(this,o(s.X3DTextureNode,this.leftTexture_))},set_rightTexture__:function(){r.prototype.set_rightTexture__.call(this,o(s.X3DTextureNode,this.rightTexture_))},set_topTexture__:function(){r.prototype.set_topTexture__.call(this,o(s.X3DTextureNode,this.topTexture_))},set_bottomTexture__:function(){r.prototype.set_bottomTexture__.call(this,o(s.X3DTextureNode,this.bottomTexture_))}}),a}),define("cobweb/Components/Texturing3D/TextureCoordinate3D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTextureCoordinateNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.TextureCoordinate3D)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"point",new t.MFVec3f)]),getTypeName:function(){return"TextureCoordinate3D"},getComponentName:function(){return"Texturing3D"},getContainerField:function(){return"texCoord"},addTexCoordToChannel:function(e,t){if(t>=0&&t<this.point_.length){var n=this.point_[t];e.push(n.x,n.y,n.z,1)}else e.push(0,0,0,1)},getTexCoord:function(e){for(var t=this.point_.getValue(),n=0,i=t.length;n<i;++n){var r=t[n].getValue();e[n]=new Vector4(r.x,r.y,r.z,1)}return e.length=i,e}}),s}),define("cobweb/Components/Texturing3D/TextureCoordinate4D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTextureCoordinateNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.TextureCoordinate4D)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"point",new t.MFVec4f)]),getTypeName:function(){return"TextureCoordinate4D"},getComponentName:function(){return"Texturing3D"},getContainerField:function(){return"texCoord"},addTexCoordToChannel:function(e,t){if(t>=0&&t<this.point_.length){var n=this.point_[t];e.push(n.x,n.y,n.z,n.w)}else e.push(0,0,0,1)},getTexCoord:function(e){for(var t=this.point_.getValue(),n=0,i=t.length;n<i;++n){var r=t[n].getValue();e[n]=new Vector4(r.x,r.y,r.z,r.w)}return e.length=i,e}}),s}),define("cobweb/Components/Texturing3D/TextureTransform3D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTextureTransformNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.TextureTransform3D)}var l=new s(0,0,0);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"translation",new t.SFVec3f),new n(o.inputOutput,"rotation",new t.SFRotation),new n(o.inputOutput,"scale",new t.SFVec3f(1,1,1)),new n(o.inputOutput,"center",new t.SFVec3f)]),getTypeName:function(){return"TextureTransform3D"},getComponentName:function(){return"Texturing3D"},getContainerField:function(){return"textureTransform"},initialize:function(){r.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed:function(){r.prototype.eventsProcessed.call(this);var e=this.translation_.getValue(),t=this.rotation_.getValue(),n=this.scale_.getValue(),i=this.center_.getValue(),o=this.getMatrix();o.identity(),i.equals(s.Zero)||o.translate(l.assign(i).negate()),n.equals(s.One)||o.scale(n),t.equals(a.Identity)||o.rotate(t),i.equals(s.Zero)||o.translate(i),e.equals(s.Zero)||o.translate(e),this.setMatrix(o)}}),u}),define("cobweb/Components/Texturing3D/TextureTransformMatrix3D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Texturing/X3DTextureTransformNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.TextureTransformMatrix3D)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"matrix",new t.SFMatrix4f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1))]),getTypeName:function(){return"TextureTransformMatrix3D"},getComponentName:function(){return"Texturing3D"},getContainerField:function(){return"textureTransform"},eventsProcessed:function(){r.prototype.eventsProcessed.call(this);var e=this.getMatrix();e.assign(this.matrix_.getValue()),this.setMatrix(e)}}),s}),define("cobweb/Components/EventUtilities/TimeTrigger",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EventUtilities/X3DTriggerNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.TimeTrigger)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOnly,"set_boolean",new t.SFBool),new n(o.outputOnly,"triggerTime",new t.SFTime)]),getTypeName:function(){return"TimeTrigger"},getComponentName:function(){return"EventUtilities"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.set_boolean_.addInterest("set_boolean__",this)},set_boolean__:function(){this.triggerTime_=this.getBrowser().getCurrentTime()}}),s}),define("cobweb/Components/Grouping/Transform",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Grouping/X3DTransformNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.Transform)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"translation",new t.SFVec3f),new n(o.inputOutput,"rotation",new t.SFRotation),new n(o.inputOutput,"scale",new t.SFVec3f(1,1,1)),new n(o.inputOutput,"scaleOrientation",new t.SFRotation),new n(o.inputOutput,"center",new t.SFVec3f),new n(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(o.initializeOnly,"bboxCenter",new t.SFVec3f),new n(o.inputOnly,"addChildren",new t.MFNode),new n(o.inputOnly,"removeChildren",new t.MFNode),new n(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Transform"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"}}),s}),define("cobweb/Components/EnvironmentalSensor/TransformSensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode","cobweb/Bits/X3DConstants","cobweb/Bits/X3DCast","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Geometry/Box3"],function(e,t,n,i,r,o,s,a,u,l){function c(e){r.call(this,e),this.addType(o.TransformSensor),this.bbox=new l,this.targetObjectNode=null}var h=new l,d=new a(0,0,0),p=new u(0,0,1,0),f=new a(-1,-1,-1);return c.prototype=e.extend(Object.create(r.prototype),{constructor:c,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"size",new t.SFVec3f),new n(o.inputOutput,"center",new t.SFVec3f),new n(o.outputOnly,"enterTime",new t.SFTime),new n(o.outputOnly,"exitTime",new t.SFTime),new n(o.outputOnly,"isActive",new t.SFBool),new n(o.outputOnly,"position_changed",new t.SFVec3f),new n(o.outputOnly,"orientation_changed",new t.SFRotation),new n(o.inputOutput,"targetObject",new t.SFNode)]),getTypeName:function(){return"TransformSensor"},getComponentName:function(){return"EnvironmentalSensor"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.isLive().addInterest("set_enabled__",this),this.enabled_.addInterest("set_enabled__",this),this.size_.addInterest("set_enabled__",this),this.size_.addInterest("set_bbox__",this),this.center_.addInterest("set_bbox__",this),this.targetObject_.addInterest("set_targetObject__",this),this.set_bbox__(),this.set_targetObject__()},set_live__:function(){},set_enabled__:function(){this.isLive().getValue()&&this.targetObjectNode&&this.enabled_.getValue()&&!this.size_.getValue().equals(a.Zero)?this.getBrowser().sensors().addInterest("update",this):(this.getBrowser().sensors().removeInterest("update",this),this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime()))},set_bbox__:function(){this.bbox.set(this.size_.getValue(),this.center_.getValue())},set_targetObject__:function(){this.targetObjectNode=s(o.X3DBoundedObject,this.targetObject_),this.set_enabled__()},update:function(){this.targetObjectNode.getBBox(h),this.size_.getValue().equals(f)||this.bbox.intersectsBox(h)?(h.getMatrix().get(d,p),this.isActive_.getValue()?(this.position_changed_.getValue().equals(d)||(this.position_changed_=d),this.orientation_changed_.getValue().equals(p)||(this.orientation_changed_=p)):(this.isActive_=!0,this.enterTime_=this.getBrowser().getCurrentTime(),this.position_changed_=d,this.orientation_changed_=p)):this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime())}}),c}),define("cobweb/Components/Rendering/TriangleFanSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.TriangleFanSet),this.triangleIndex=[]}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.inputOutput,"fanCount",new t.MFInt32),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"TriangleFanSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.fanCount_.addInterest("set_fanCount__",this),this.set_fanCount__()},set_fanCount__:function(){var e=this.fanCount_.getValue(),t=this.triangleIndex;t.length=0;for(var n=0,i=e.length,r=0;n<i;++n){for(var o=e[n].getValue(),s=1,a=o-1;s<a;++s)t.push(r,r+s,r+s+1);r+=o}},getPolygonIndex:function(e){return this.triangleIndex[e]},build:function(){r.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),s}),define("cobweb/Components/Rendering/TriangleSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.TriangleSet)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"TriangleSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},build:function(){this.getCoord()&&r.prototype.build.call(this,3,this.getCoord().getSize(),3,this.getCoord().getSize())},createNormals:function(e,t){return this.createFaceNormals(e,t)}}),s}),define("cobweb/Components/Geometry2D/TriangleSet2D",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DGeometryNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.TriangleSet2D),this.setGeometryType(2)}var u=new s(0,0,1),l=new s(0,0,0);return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"vertices",new t.MFVec2f),new n(o.initializeOnly,"solid",new t.SFBool)]),getTypeName:function(){return"TriangleSet2D"},getComponentName:function(){return"Geometry2D"},getContainerField:function(){return"geometry"},build:function(){for(var e=this.vertices_.getValue(),t=0,n=e.length;t<n;++t){var i=e[t];this.addNormal(u),this.addVertex(l.set(i.x,i.y,0))}this.setSolid(this.solid_.getValue())},buildTexCoords:function(){var e=this.getTexCoordParams(),t=e.min,n=e.Ssize,i=[],r=this.vertices;this.texCoords.push(i);for(var o=0,s=this.vertices.length;o<s;o+=4)i.push((r[o]-t[0])/n,(r[o+1]-t[1])/n,0,1)}}),a}),define("cobweb/Components/Rendering/TriangleStripSet",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Rendering/X3DComposedGeometryNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.TriangleStripSet),this.triangleIndex=[]}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"solid",new t.SFBool(!0)),new n(o.initializeOnly,"ccw",new t.SFBool(!0)),new n(o.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new n(o.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new n(o.inputOutput,"stripCount",new t.MFInt32),new n(o.inputOutput,"attrib",new t.MFNode),new n(o.inputOutput,"fogCoord",new t.SFNode),new n(o.inputOutput,"color",new t.SFNode),new n(o.inputOutput,"texCoord",new t.SFNode),new n(o.inputOutput,"normal",new t.SFNode),new n(o.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"TriangleStripSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){r.prototype.initialize.call(this),this.stripCount_.addInterest("set_stripCount__",this),this.set_stripCount__()},set_stripCount__:function(){var e=this.stripCount_.getValue(),t=this.triangleIndex;t.length=0;for(var n=0,i=e.length,r=0;n<i;++n){for(var o=e[n].getValue(),s=0,a=o-2;s<a;++s){var u=1&s;t.push(r+(u?s+1:s),r+(u?s:s+1),r+(s+2))}r+=o}},getPolygonIndex:function(e){return this.triangleIndex[e]},build:function(){r.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),s}),define("cobweb/Components/Shape/TwoSidedMaterial",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Shape/X3DMaterialNode","cobweb/Bits/X3DConstants","standard/Math/Algorithm"],function(e,t,n,i,r,o,s){function a(e){r.call(this,e),this.addType(o.TwoSidedMaterial),this.diffuseColor=new Float32Array(3),this.specularColor=new Float32Array(3),this.emissiveColor=new Float32Array(3),this.backDiffuseColor=new Float32Array(3),this.backSpecularColor=new Float32Array(3),this.backEmissiveColor=new Float32Array(3)}return a.prototype=e.extend(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"separateBackColor",new t.SFBool),new n(o.inputOutput,"ambientIntensity",new t.SFFloat(.2)),new n(o.inputOutput,"diffuseColor",new t.SFColor(.8,.8,.8)),new n(o.inputOutput,"specularColor",new t.SFColor),new n(o.inputOutput,"emissiveColor",new t.SFColor),new n(o.inputOutput,"shininess",new t.SFFloat(.2)),new n(o.inputOutput,"transparency",new t.SFFloat),new n(o.inputOutput,"backAmbientIntensity",new t.SFFloat(.2)),new n(o.inputOutput,"backDiffuseColor",new t.SFColor(.8,.8,.8)),new n(o.inputOutput,"backSpecularColor",new t.SFColor),new n(o.inputOutput,"backEmissiveColor",new t.SFColor),new n(o.inputOutput,"backShininess",new t.SFFloat(.2)),new n(o.inputOutput,"backTransparency",new t.SFFloat)]),getTypeName:function(){return"TwoSidedMaterial"},getComponentName:function(){return"Shape"},getContainerField:function(){return"material"},initialize:function(){r.prototype.initialize.call(this),this.addChildObjects("transparent",new t.SFBool),this.ambientIntensity_.addInterest("set_ambientIntensity__",this),this.diffuseColor_.addInterest("set_diffuseColor__",this),this.specularColor_.addInterest("set_specularColor__",this),this.emissiveColor_.addInterest("set_emissiveColor__",this),this.shininess_.addInterest("set_shininess__",this),this.transparency_.addInterest("set_transparency__",this),this.backAmbientIntensity_.addInterest("set_backAmbientIntensity__",this),this.backDiffuseColor_.addInterest("set_backDiffuseColor__",this),this.backSpecularColor_.addInterest("set_backSpecularColor__",this),this.backEmissiveColor_.addInterest("set_backEmissiveColor__",this),this.backShininess_.addInterest("set_backShininess__",this),this.backTransparency_.addInterest("set_backTransparency__",this),this.set_ambientIntensity__(),this.set_diffuseColor__(),this.set_specularColor__(),this.set_emissiveColor__(),this.set_shininess__(),this.set_transparency__(),this.set_backAmbientIntensity__(),this.set_backDiffuseColor__(),this.set_backSpecularColor__(),this.set_backEmissiveColor__(),this.set_backShininess__(),this.set_backTransparency__()},set_ambientIntensity__:function(){this.ambientIntensity=Math.max(this.ambientIntensity_.getValue(),0)},set_diffuseColor__:function(){var e=this.diffuseColor,t=this.diffuseColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_specularColor__:function(){var e=this.specularColor,t=this.specularColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_emissiveColor__:function(){var e=this.emissiveColor,t=this.emissiveColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_shininess__:function(){this.shininess=s.clamp(this.shininess_.getValue(),0,1)},set_transparency__:function(){this.transparency=s.clamp(this.transparency_.getValue(),0,1),this.set_transparent__()},set_backAmbientIntensity__:function(){this.backAmbientIntensity=Math.max(this.backAmbientIntensity_.getValue(),0)},set_backDiffuseColor__:function(){var e=this.backDiffuseColor,t=this.backDiffuseColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_backSpecularColor__:function(){var e=this.backSpecularColor,t=this.backSpecularColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_backEmissiveColor__:function(){var e=this.backEmissiveColor,t=this.backEmissiveColor_.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_backShininess__:function(){this.backShininess=s.clamp(this.backShininess_.getValue(),0,1)},set_backTransparency__:function(){this.backTransparency=s.clamp(this.backTransparency_.getValue(),0,1),this.set_transparent__()},set_transparent__:function(){var e=this.transparency_.getValue()||this.backTransparency_.getValue();e!=this.transparent_.getValue()&&(this.transparent_=e)},setShaderUniforms:function(e,t){e.uniform1f(t.x3d_AmbientIntensity,this.ambientIntensity),e.uniform3fv(t.x3d_DiffuseColor,this.diffuseColor),e.uniform3fv(t.x3d_SpecularColor,this.specularColor),e.uniform3fv(t.x3d_EmissiveColor,this.emissiveColor),e.uniform1f(t.x3d_Shininess,this.shininess),e.uniform1f(t.x3d_Transparency,this.transparency),this.separateBackColor_.getValue()?(e.uniform1i(t.x3d_SeparateBackColor,!0),e.uniform1f(t.x3d_BackAmbientIntensity,this.backAmbientIntensity),e.uniform3fv(t.x3d_BackDiffuseColor,this.backDiffuseColor),e.uniform3fv(t.x3d_BackSpecularColor,this.backSpecularColor),e.uniform3fv(t.x3d_BackEmissiveColor,this.backEmissiveColor),e.uniform1f(t.x3d_BackShininess,this.backShininess),e.uniform1f(t.x3d_BackTransparency,this.backTransparency)):e.uniform1i(t.x3d_SeparateBackColor,!1)}}),a}),define("cobweb/Components/Navigation/ViewpointGroup",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DChildNode","cobweb/Components/EnvironmentalSensor/ProximitySensor","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a,u){function l(e){r.call(this,e),this.addType(a.ViewpointGroup),this.proximitySensor=new o(e),this.cameraObjects=[],this.viewpointGroups=[]}function c(e,t){switch(e){case s.CAMERA:if(this.proximitySensor.traverse(e,t),this.proximitySensor.isActive_.getValue())for(var n=0,i=this.cameraObjects.length;n<i;++n)this.cameraObjects[n].traverse(e,t);return;case s.DISPLAY:if(this.proximitySensor.traverse(e,t),this.proximitySensor.isActive_.getValue())for(var n=0,i=this.viewpointGroups.length;n<i;++n)this.viewpointGroups[n].traverse(e,t);return}}function h(e,t){switch(e){case s.CAMERA:for(var n=0,i=this.cameraObjects.length;n<i;++n)this.cameraObjects[n].traverse(e,t);return;case s.DISPLAY:for(var n=0,i=this.viewpointGroups.length;n<i;++n)this.viewpointGroups[n].traverse(e,t);return}}return l.prototype=e.extend(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"displayed",new t.SFBool(!0)),new n(a.inputOutput,"description",new t.SFString),new n(a.inputOutput,"retainUserOffsets",new t.SFBool),new n(a.inputOutput,"size",new t.SFVec3f),new n(a.inputOutput,"center",new t.SFVec3f),new n(a.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"ViewpointGroup"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.proximitySensor.setup(),this.size_.addFieldInterest(this.proximitySensor.size_),this.center_.addFieldInterest(this.proximitySensor.center_),this.proximitySensor.size_=this.size_,this.proximitySensor.center_=this.center_,this.displayed_.addInterest("set_displayed__",this),this.size_.addInterest("set_displayed__",this),this.children_.addInterest("set_children__",this),this.set_displayed__(),this.set_children__()},isActive:function(){return this.proximitySensor.isActive_.getValue()},set_displayed__:function(){var e=!this.size_.getValue().equals(u.Zero),t=this.displayed_.getValue();this.proximitySensor.enabled_=t&&e,t&&e?(this.proximitySensor.isCameraObject_.addFieldInterest(this.isCameraObject_),this.setCameraObject(this.proximitySensor.getCameraObject()),this.traverse=c):(this.proximitySensor.isCameraObject_.removeFieldInterest(this.isCameraObject_),this.setCameraObject(t),t?this.traverse=h:delete this.traverse)},set_children__:function(){this.cameraObjects.length=0,this.viewpointGroups.length=0;for(var e=this.children_,t=0,n=e.length;t<n;++t)try{for(var i=e[t].getValue().getInnerNode(),r=i.getType(),o=r.length-1;o>=0;--o)switch(r[o]){case a.X3DViewpointNode:this.cameraObjects.push(i);break;case a.ViewpointGroup:this.cameraObjects.push(i),this.viewpointGroups.push(i)}}catch(e){}},traverse:function(){}}),l}),define("cobweb/Components/EnvironmentalSensor/VisibilitySensor",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode","cobweb/Bits/TraverseType","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(s.VisibilitySensor),this.visible=!1}var l=new a(-1,-1,-1);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.inputOutput,"enabled",new t.SFBool(!0)),new n(s.inputOutput,"size",new t.SFVec3f),new n(s.inputOutput,"center",new t.SFVec3f),new n(s.outputOnly,"enterTime",new t.SFTime),new n(s.outputOnly,"exitTime",new t.SFTime),new n(s.outputOnly,"isActive",new t.SFBool)]),size:new a(0,0,0),center:new a(0,0,0),getTypeName:function(){return"VisibilitySensor"},getComponentName:function(){return"EnvironmentalSensor"},getContainerField:function(){return"children"},initialize:function(){r.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this),this.set_enabled__()},set_enabled__:function(){this.enabled_.getValue()?delete this.traverse:this.traverse=Function.prototype},update:function(){this.visible&&this.getTraversed()?(this.isActive_.getValue()||(this.isActive_=!0,this.enterTime_=this.getBrowser().getCurrentTime()),this.visible=!1):this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime()),this.setTraversed(!1)},traverse:function(e,t){if(e===o.DISPLAY&&(this.setTraversed(!0),!this.visible))if(this.size_.getValue().equals(l))this.visible=!0;else{var n=t.getViewVolume(),i=t.getModelViewMatrix().get(),r=i.multDirMatrix(this.size.assign(this.size_.getValue())),s=i.multVecMatrix(this.center.assign(this.center_.getValue()));this.visible=n.intersectsSphere(r.abs()/2,s)}}}),u}),define("cobweb/Components/ParticleSystems/VolumeEmitter",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticleEmitterNode","cobweb/Components/Geometry3D/IndexedFaceSet","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Geometry/Triangle3","standard/Math/Algorithm","standard/Math/Utility/BVH","standard/Math/Algorithms/QuickSort"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f){function g(e,t){return C.getDistanceToPoint(e)<C.getDistanceToPoint(t)}function m(e){r.call(this,e),this.addType(s.VolumeEmitter),this.direction=new a(0,0,0),this.volumeNode=new o(e),this.areaSoFarArray=[0],this.intersections=[],this.intersectionNormals=[],this.sorter=new f(this.intersections,g)}var b=new a(0,0,0),w=new a(0,0,0),y=new a(0,0,0),x=new a(0,0,0),v=new a(0,0,0),_=new u(0,0,1,0),S=new l(a.Zero,a.zAxis),C=new c(a.Zero,a.zAxis);return m.prototype=e.extend(Object.create(r.prototype),{constructor:m,fieldDefinitions:new i([new n(s.inputOutput,"metadata",new t.SFNode),new n(s.initializeOnly,"internal",new t.SFBool(!0)),new n(s.inputOutput,"direction",new t.SFVec3f(0,1,0)),new n(s.inputOutput,"speed",new t.SFFloat),new n(s.inputOutput,"variation",new t.SFFloat(.25)),new n(s.initializeOnly,"mass",new t.SFFloat),new n(s.initializeOnly,"surfaceArea",new t.SFFloat),new n(s.inputOutput,"coordIndex",new t.MFInt32(-1)),new n(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"VolumeEmitter"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"emitter"},initialize:function(){r.prototype.initialize.call(this),this.direction_.addInterest("set_direction__",this),this.coordIndex_.addFieldInterest(this.volumeNode.coordIndex_),this.coord_.addFieldInterest(this.volumeNode.coord_),this.volumeNode.creaseAngle_=Math.PI,this.volumeNode.convex_=!1,this.volumeNode.coordIndex_=this.coordIndex_,this.volumeNode.coord_=this.coord_,this.volumeNode.addInterest("set_geometry__",this),this.volumeNode.setPrivate(!0),this.volumeNode.setup(),this.set_geometry__()},set_direction__:function(){this.direction.assign(this.direction_.getValue()).normalize(),this.direction.equals(a.Zero)?this.getRandomVelocity=this.getSphericalRandomVelocity:delete this.getRandomVelocity},set_geometry__:function(){var e=0,t=this.areaSoFarArray,n=this.volumeNode.getVertices(),i=this.volumeNode.getNormals();t.length=1;for(var r=0,o=n.length;r<o;r+=12)b.set(n[r+0],n[r+1],n[r+2]),w.set(n[r+4],n[r+5],n[r+6]),y.set(n[r+8],n[r+9],n[r+10]),e+=h.area(b,w,y),t.push(e);this.bvh=new p(n,i)},getRandomPosition:function(e){var t=this.areaSoFarArray,n=t.length,i=Math.random()*t[n-1],r=0;r=1==n||i<=t[0]?0:i>=t[n-1]?n-2:(g=d.upperBound(t,0,n,i,d.less))<n?g-1:0;var o=Math.random(),s=Math.random();o+s>1&&(o=1-o,s=1-s);var u=1-o-s,l=12*r,c=this.volumeNode.getVertices();x.x=o*c[l+0]+s*c[l+4]+u*c[l+8],x.y=o*c[l+1]+s*c[l+5]+u*c[l+9],x.z=o*c[l+2]+s*c[l+6]+u*c[l+10];var l=9*r,h=this.volumeNode.getNormals();v.x=o*h[l+0]+s*h[l+3]+u*h[l+6],v.y=o*h[l+1]+s*h[l+4]+u*h[l+7],v.z=o*h[l+2]+s*h[l+5]+u*h[l+8],_.setFromToVec(a.zAxis,v),_.multVecRot(this.getRandomSurfaceNormal(v)),S.set(x,v),C.set(x,v);var p=this.intersections,f=this.bvh.intersectsLine(S,p,this.intersectionNormals);if(f-=f%2){this.sorter.sort(0,f);var g=2*Math.round(this.getRandomValue(0,f/2-1)),m=p[g],b=p[g+1],u=Math.random();return e.x=m.x+(b.x-m.x)*u,e.y=m.y+(b.y-m.y)*u,e.z=m.z+(b.z-m.z)*u,e}return e.set(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)},getRandomVelocity:function(e){var t=this.direction,n=this.getRandomSpeed();return e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e}}),m}),define("cobweb/Components/ParticleSystems/WindPhysicsModel",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/ParticleSystems/X3DParticlePhysicsModelNode","cobweb/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(e,t,n,i,r,o,s,a){function u(e){r.call(this,e),this.addType(o.WindPhysicsModel)}var l=new s(0,0,0);return u.prototype=e.extend(Object.create(r.prototype),{constructor:u,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"direction",new t.SFVec3f),new n(o.inputOutput,"speed",new t.SFFloat(.1)),new n(o.inputOutput,"gustiness",new t.SFFloat(.1)),new n(o.inputOutput,"turbulence",new t.SFFloat)]),getTypeName:function(){return"WindPhysicsModel"},getComponentName:function(){return"ParticleSystems"},getContainerField:function(){return"physics"},getRandomSpeed:function(e){var t=Math.max(0,this.speed_.getValue()),n=t*Math.max(0,this.gustiness_.getValue());return e.getRandomValue(Math.max(0,t-n),t+n)},addForce:function(e,t,n,i){var r=t.surfaceArea_.getValue();if(this.enabled_.getValue()){var o=this.getRandomSpeed(t),u=.64615*Math.pow(10,2*Math.log(o));this.direction_.getValue().equals(s.Zero)?t.getRandomNormal(l):l.assign(this.direction_.getValue()).normalize(),n[e].assign(l.multiply(r*u)),i[e]=Math.PI*a.clamp(this.turbulence_.getValue(),0,1)}}}),u}),define("cobweb/Components/Core/WorldInfo",["jquery","cobweb/Fields","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Components/Core/X3DInfoNode","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o){function s(e){r.call(this,e),this.addType(o.WorldInfo)}return s.prototype=e.extend(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.initializeOnly,"title",new t.SFString),new n(o.initializeOnly,"info",new t.MFString)]),getTypeName:function(){return"WorldInfo"},getComponentName:function(){return"Core"},getContainerField:function(){return"children"}}),s}),define("cobweb/Configuration/SupportedNodes",["cobweb/Components/Networking/Anchor","cobweb/Components/Shape/Appearance","cobweb/Components/Geometry2D/Arc2D","cobweb/Components/Geometry2D/ArcClose2D","cobweb/Components/Sound/AudioClip","cobweb/Components/EnvironmentalEffects/Background","cobweb/Components/Navigation/Billboard","cobweb/Components/EventUtilities/BooleanFilter","cobweb/Components/EventUtilities/BooleanSequencer","cobweb/Components/EventUtilities/BooleanToggle","cobweb/Components/EventUtilities/BooleanTrigger","cobweb/Components/ParticleSystems/BoundedPhysicsModel","cobweb/Components/Geometry3D/Box","cobweb/Components/CADGeometry/CADAssembly","cobweb/Components/CADGeometry/CADFace","cobweb/Components/CADGeometry/CADLayer","cobweb/Components/CADGeometry/CADPart","cobweb/Components/Geometry2D/Circle2D","cobweb/Components/Rendering/ClipPlane","cobweb/Components/Navigation/Collision","cobweb/Components/Rendering/Color","cobweb/Components/Followers/ColorChaser","cobweb/Components/Followers/ColorDamper","cobweb/Components/Interpolation/ColorInterpolator","cobweb/Components/Rendering/ColorRGBA","cobweb/Components/CubeMapTexturing/ComposedCubeMapTexture","cobweb/Components/Shaders/ComposedShader","cobweb/Components/Geometry3D/Cone","cobweb/Components/ParticleSystems/ConeEmitter","cobweb/Components/Rendering/Coordinate","cobweb/Components/Followers/CoordinateChaser","cobweb/Components/Followers/CoordinateDamper","cobweb/Components/NURBS/CoordinateDouble","cobweb/Components/Interpolation/CoordinateInterpolator","cobweb/Components/Interpolation/CoordinateInterpolator2D","cobweb/Components/Geometry3D/Cylinder","cobweb/Components/PointingDeviceSensor/CylinderSensor","cobweb/Components/Lighting/DirectionalLight","cobweb/Components/Geometry2D/Disk2D","cobweb/Components/Interpolation/EaseInEaseOut","cobweb/Components/Geometry3D/ElevationGrid","cobweb/Components/ParticleSystems/ExplosionEmitter","cobweb/Components/Geometry3D/Extrusion","cobweb/Components/Shaders/FloatVertexAttribute","cobweb/Components/EnvironmentalEffects/Fog","cobweb/Components/Text/FontStyle","cobweb/Components/ParticleSystems/ForcePhysicsModel","cobweb/Components/CubeMapTexturing/GeneratedCubeMapTexture","cobweb/Components/Geospatial/GeoCoordinate","cobweb/Components/Geospatial/GeoElevationGrid","cobweb/Components/Geospatial/GeoLOD","cobweb/Components/Geospatial/GeoLocation","cobweb/Components/Geospatial/GeoMetadata","cobweb/Components/Geospatial/GeoOrigin","cobweb/Components/Geospatial/GeoPositionInterpolator","cobweb/Components/Geospatial/GeoProximitySensor","cobweb/Components/Geospatial/GeoTouchSensor","cobweb/Components/Geospatial/GeoTransform","cobweb/Components/Geospatial/GeoViewpoint","cobweb/Components/Grouping/Group","cobweb/Components/CubeMapTexturing/ImageCubeMapTexture","cobweb/Components/Texturing/ImageTexture","cobweb/Components/Geometry3D/IndexedFaceSet","cobweb/Components/Rendering/IndexedLineSet","cobweb/Components/CADGeometry/IndexedQuadSet","cobweb/Components/Rendering/IndexedTriangleFanSet","cobweb/Components/Rendering/IndexedTriangleSet","cobweb/Components/Rendering/IndexedTriangleStripSet","cobweb/Components/Networking/Inline","cobweb/Components/EventUtilities/IntegerSequencer","cobweb/Components/EventUtilities/IntegerTrigger","cobweb/Components/KeyDeviceSensor/KeySensor","cobweb/Components/Navigation/LOD","cobweb/Components/Layering/Layer","cobweb/Components/Layering/LayerSet","cobweb/Components/Layout/Layout","cobweb/Components/Layout/LayoutGroup","cobweb/Components/Layout/LayoutLayer","cobweb/Components/Shape/LineProperties","cobweb/Components/Rendering/LineSet","cobweb/Components/Networking/LoadSensor","cobweb/Components/EnvironmentalEffects/LocalFog","cobweb/Components/Shape/Material","cobweb/Components/Shaders/Matrix3VertexAttribute","cobweb/Components/Shaders/Matrix4VertexAttribute","cobweb/Components/Core/MetadataBoolean","cobweb/Components/Core/MetadataDouble","cobweb/Components/Core/MetadataFloat","cobweb/Components/Core/MetadataInteger","cobweb/Components/Core/MetadataSet","cobweb/Components/Core/MetadataString","cobweb/Components/Texturing/MovieTexture","cobweb/Components/Navigation/NavigationInfo","cobweb/Components/Rendering/Normal","cobweb/Components/Interpolation/NormalInterpolator","cobweb/Components/Followers/OrientationChaser","cobweb/Components/Followers/OrientationDamper","cobweb/Components/Interpolation/OrientationInterpolator","cobweb/Components/Navigation/OrthoViewpoint","cobweb/Components/ParticleSystems/ParticleSystem","cobweb/Components/Texturing/PixelTexture","cobweb/Components/PointingDeviceSensor/PlaneSensor","cobweb/Components/ParticleSystems/PointEmitter","cobweb/Components/Lighting/PointLight","cobweb/Components/Rendering/PointSet","cobweb/Components/Geometry2D/Polyline2D","cobweb/Components/ParticleSystems/PolylineEmitter","cobweb/Components/Geometry2D/Polypoint2D","cobweb/Components/Followers/PositionChaser","cobweb/Components/Followers/PositionChaser2D","cobweb/Components/Followers/PositionDamper","cobweb/Components/Followers/PositionDamper2D","cobweb/Components/Interpolation/PositionInterpolator","cobweb/Components/Interpolation/PositionInterpolator2D","cobweb/Components/EnvironmentalSensor/ProximitySensor","cobweb/Components/CADGeometry/QuadSet","cobweb/Components/Geometry2D/Rectangle2D","cobweb/Components/Followers/ScalarChaser","cobweb/Components/Followers/ScalarDamper","cobweb/Components/Interpolation/ScalarInterpolator","cobweb/Components/Layout/ScreenFontStyle","cobweb/Components/Layout/ScreenGroup","cobweb/Components/Scripting/Script","cobweb/Components/Shaders/ShaderPart","cobweb/Components/Shape/Shape","cobweb/Components/Sound/Sound","cobweb/Components/Geometry3D/Sphere","cobweb/Components/PointingDeviceSensor/SphereSensor","cobweb/Components/Interpolation/SplinePositionInterpolator","cobweb/Components/Interpolation/SplinePositionInterpolator2D","cobweb/Components/Interpolation/SplineScalarInterpolator","cobweb/Components/Lighting/SpotLight","cobweb/Components/Interpolation/SquadOrientationInterpolator","cobweb/Components/Grouping/StaticGroup","cobweb/Components/ParticleSystems/SurfaceEmitter","cobweb/Components/Grouping/Switch","cobweb/Components/Followers/TexCoordChaser2D","cobweb/Components/Followers/TexCoordDamper2D","cobweb/Components/Text/Text","cobweb/Components/EnvironmentalEffects/TextureBackground","cobweb/Components/Texturing/TextureCoordinate","cobweb/Components/Texturing3D/TextureCoordinate3D","cobweb/Components/Texturing3D/TextureCoordinate4D","cobweb/Components/Texturing/TextureProperties","cobweb/Components/Texturing/TextureTransform","cobweb/Components/Texturing3D/TextureTransform3D","cobweb/Components/Texturing3D/TextureTransformMatrix3D","cobweb/Components/Time/TimeSensor","cobweb/Components/EventUtilities/TimeTrigger","cobweb/Components/PointingDeviceSensor/TouchSensor","cobweb/Components/Grouping/Transform","cobweb/Components/EnvironmentalSensor/TransformSensor","cobweb/Components/Rendering/TriangleFanSet","cobweb/Components/Rendering/TriangleSet","cobweb/Components/Geometry2D/TriangleSet2D","cobweb/Components/Rendering/TriangleStripSet","cobweb/Components/Shape/TwoSidedMaterial","cobweb/Components/Navigation/Viewpoint","cobweb/Components/Navigation/ViewpointGroup","cobweb/Components/Layering/Viewport","cobweb/Components/EnvironmentalSensor/VisibilitySensor","cobweb/Components/ParticleSystems/VolumeEmitter","cobweb/Components/ParticleSystems/WindPhysicsModel","cobweb/Components/Core/WorldInfo"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b,w,y,x,v,_,S,C,F,T,N,O,M,V,D,I,B,E,A,P,L,R,k,z,j,X,U,G,q,H,W,Y,$,K,Z,Q,J,ee,te,ne,ie,re,oe,se,ae,ue,le,ce,he,de,pe,fe,ge,me,be,we,ye,xe,ve,_e,Se,Ce,Fe,Te,Ne,Oe,Me,Ve,De,Ie,Be,Ee,Ae,Pe,Le,Re,ke,ze,je,Xe,Ue,Ge,qe,He,We,Ye,$e,Ke,Ze,Qe,Je,et,tt,nt,it,rt,ot,st,at,ut,lt,ct,ht,dt,pt,ft,gt,mt,bt,wt,yt,xt,vt,_t,St,Ct,Ft,Tt,Nt,Ot,Mt,Vt,Dt,It,Bt,Et,At,Pt,Lt,Rt,kt,zt,jt,Xt,Ut,Gt,qt,Ht,Wt,Yt,$t,Kt,Zt,Qt,Jt,en,tn){function nn(e){return new this(e)}var rn={MetadataBool:De,Anchor:e,Appearance:t,Arc2D:n,ArcClose2D:i,AudioClip:r,Background:o,Billboard:s,BooleanFilter:a,BooleanSequencer:u,BooleanToggle:l,BooleanTrigger:c,BoundedPhysicsModel:h,Box:d,CADAssembly:p,CADFace:f,CADLayer:g,CADPart:m,Circle2D:b,ClipPlane:w,Collision:y,Color:x,ColorChaser:v,ColorDamper:_,ColorInterpolator:S,ColorRGBA:C,ComposedCubeMapTexture:F,ComposedShader:T,Cone:N,ConeEmitter:O,Coordinate:M,CoordinateChaser:V,CoordinateDamper:D,CoordinateDouble:I,CoordinateInterpolator:B,CoordinateInterpolator2D:E,Cylinder:A,CylinderSensor:P,DirectionalLight:L,Disk2D:R,EaseInEaseOut:k,ElevationGrid:z,ExplosionEmitter:j,Extrusion:X,FloatVertexAttribute:U,Fog:G,FontStyle:q,ForcePhysicsModel:H,GeneratedCubeMapTexture:W,GeoCoordinate:Y,GeoElevationGrid:$,GeoLOD:K,GeoLocation:Z,GeoMetadata:Q,GeoOrigin:J,GeoPositionInterpolator:ee,GeoProximitySensor:te,GeoTouchSensor:ne,GeoTransform:ie,GeoViewpoint:re,Group:oe,ImageCubeMapTexture:se,ImageTexture:ae,IndexedFaceSet:ue,IndexedLineSet:le,IndexedQuadSet:ce,IndexedTriangleFanSet:he,IndexedTriangleSet:de,IndexedTriangleStripSet:pe,Inline:fe,IntegerSequencer:ge,IntegerTrigger:me,KeySensor:be,LOD:we,Layer:ye,LayerSet:xe,Layout:ve,LayoutGroup:_e,LayoutLayer:Se,LineProperties:Ce,LineSet:Fe,LoadSensor:Te,LocalFog:Ne,Material:Oe,Matrix3VertexAttribute:Me,Matrix4VertexAttribute:Ve,MetadataBoolean:De,MetadataDouble:Ie,MetadataFloat:Be,MetadataInteger:Ee,MetadataSet:Ae,MetadataString:Pe,MovieTexture:Le,NavigationInfo:Re,Normal:ke,NormalInterpolator:ze,OrientationChaser:je,OrientationDamper:Xe,OrientationInterpolator:Ue,OrthoViewpoint:Ge,ParticleSystem:qe,PixelTexture:He,PlaneSensor:We,PointEmitter:Ye,PointLight:$e,PointSet:Ke,Polyline2D:Ze,PolylineEmitter:Qe,Polypoint2D:Je,PositionChaser:et,PositionChaser2D:tt,PositionDamper:nt,PositionDamper2D:it,PositionInterpolator:rt,PositionInterpolator2D:ot,ProximitySensor:st,QuadSet:at,Rectangle2D:ut,ScalarChaser:lt,ScalarDamper:ct,ScalarInterpolator:ht,ScreenFontStyle:dt,ScreenGroup:pt,Script:ft,ShaderPart:gt,Shape:mt,Sound:bt,Sphere:wt,SphereSensor:yt,SplinePositionInterpolator:xt,SplinePositionInterpolator2D:vt,SplineScalarInterpolator:_t,SpotLight:St,SquadOrientationInterpolator:Ct,StaticGroup:Ft,SurfaceEmitter:Tt,Switch:Nt,TexCoordChaser2D:Ot,TexCoordDamper2D:Mt,Text:Vt,TextureBackground:Dt,TextureCoordinate:It,TextureCoordinate3D:Bt,TextureCoordinate4D:Et,TextureProperties:At,TextureTransform:Pt,TextureTransform3D:Lt,TextureTransformMatrix3D:Rt,TimeSensor:kt,TimeTrigger:zt,TouchSensor:jt,Transform:Xt,TransformSensor:Ut,TriangleFanSet:Gt,TriangleSet:qt,TriangleSet2D:Ht,TriangleStripSet:Wt,TwoSidedMaterial:Yt,Viewpoint:$t,ViewpointGroup:Kt,Viewport:Zt,VisibilitySensor:Qt,VolumeEmitter:Jt,WindPhysicsModel:en,WorldInfo:tn};for(var on in rn)rn[on].createInstance=nn.bind(rn[on]),rn[on.toUpperCase()]=rn[on],rn[on.toUpperCase()].createInstance=nn.bind(rn[on]);return rn}),define("cobweb/Browser/X3DBrowser",["jquery","cobweb/Browser/VERSION","cobweb/Base/Events","cobweb/Fields","cobweb/Browser/X3DBrowserContext","cobweb/Configuration/ComponentInfo","cobweb/Configuration/SupportedProfiles","cobweb/Configuration/SupportedComponents","cobweb/Configuration/SupportedNodes","cobweb/Execution/Scene","cobweb/InputOutput/FileLoader","cobweb/Parser/XMLParser","cobweb/Bits/X3DConstants","lib/gettext"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p){function f(e){r.call(this,e),this.currentSpeed=0,this.currentFrameRate=0,this.description_="",this.supportedNodes=u,this.supportedComponents=a(this),this.supportedProfiles=s(this),this.components={}}return f.prototype=e.extend(Object.create(r.prototype),{constructor:f,getTypeName:function(){return"X3DBrowser"},getComponentName:function(){return"Cobweb"},getContainerField:function(){return"browser"},initialize:function(){this.replaceWorld(this.createScene()),r.prototype.initialize.call(this),this.getLoadSensor().loadTime_.addInterest("realize",this),this.print("Welcome to "+this.name+" X3D Browser "+this.version+":\n        Current Graphics Renderer\n                Name: "+this.getVendor()+" "+this.getWebGLVersion()+"\n                Shading language: "+this.getShadingLanguageVersion()+"\n        Rendering Properties\n                Antialiased: "+this.getAntialiased()+"\n                Depth size: "+this.getDepthSize()+" bits\n                Color depth: "+this.getColorDepth()+" bits\n                Max clip planes: 6\n                Max lights: 8\n                Texture units: "+this.getMaxTextureUnits()+" / "+this.getMaxCombinedTextureUnits()+"\n                Max texture size: "+this.getMaxTextureSize()+" × "+this.getMaxTextureSize()+" pixel\n                Texture memory: "+this.getTextureMemory()+"\n                Max vertex uniform vectors: "+this.getMaxVertexUniformVectors()+"\n                Max fragment uniform vectors: "+this.getMaxFragmentUniformVectors()+"\n                Max vertex attribs: "+this.getMaxVertexAttribs()+"\n")},realize:function(){this.getLoadSensor().loadTime_.removeInterest("realize",this);var e=this.getElement()[0].getAttribute("src");e=e?'"'+e+'"':this.getElement()[0].getAttribute("url"),this.load(e)},getName:function(){return this.name},getVersion:function(){return this.version},getCurrentSpeed:function(){return this.currentSpeed},getCurrentFrameRate:function(){return this.currentFrameRate},setDescription:function(e){this.description=e},getWorldURL:function(){return this.currentScene.worldURL},getProfile:function(e){var t=this.supportedProfiles.get(e);if(t)return t;throw Error("Profile '"+e+"' is not supported.")},getComponent:function(e,t){var n=this.supportedComponents.get(e);if(n)return new o(this,{title:n.title,name:e,level:t,providerUrl:this.getProviderUrl()});throw Error("Component '"+e+"' at level '"+t+"' is not supported.")},createScene:function(){var e=new l(this);return e.setup(),this.isExternal()?e:(e.setLive(!0),e)},replaceWorld:function(e){this.loadCount_.removeInterest("set_loadCount__",this),this.prepareEvents().removeInterest("bind",this),this.loader&&this.loader.abort(),this.getWorld()&&(this.getExecutionContext().setLive(!1),this.shutdown().processInterests()),n.clear(),e||(e=this.createScene()),this.description="",this.setBrowserLoading(!0),this.loadCount_.addInterest("set_loadCount__",this);for(var t in e.getLoadingObjects())this.addLoadCount(e.getLoadingObjects()[t]);e.setLive(this.isLive().getValue()),this.setExecutionContext(e),this.initialized().setValue(this.getCurrentTime())},set_loadCount__:function(e){e.getValue()||(this.loadCount_.removeInterest("set_loadCount__",this),this.prepareEvents().addInterest("bind",this),this.addBrowserEvent())},bind:function(){this.prepareEvents().removeInterest("bind",this),this.getWorld().bind(),this.setBrowserLoading(!1)},createVrmlFromString:function(e){var t=new i.MFNode;return t.setValue(this.createX3DFromString(e).rootNodes),t},createX3DFromString:function(e){var t=this.currentScene,n=this.isExternal(),i=new c(this.getWorld()).createX3DFromString(this.currentScene.getURL(),e);return n||(i.setExecutionContext(t),t.isLive().addInterest("setLive",i),t.isLive().getValue()&&i.setLive(!0)),i.setup(),i},createVrmlFromURL:function(e,t,n){if(!(t instanceof i.SFNode))throw new Error("Browser.createVrmlFromURL: node must be of type SFNode.");if(!t.getValue())throw new Error("Browser.createVrmlFromURL: node IS NULL.");var r=t.getValue().getField(n);if(!r.isInput())throw new Error("Browser.createVrmlFromURL: event named '"+n+"' must be a input field.");if(r.getType()!==d.MFNode)throw new Error("Browser.createVrmlFromURL: event named '"+n+"' must be of type MFNode.");var o=this.currentScene,s=this.isExternal(),a=new c(this.getWorld());this.addLoadCount(a),a.createX3DFromURL(e,null,function(e){this.removeLoadCount(a),e&&(s||(e.setExecutionContext(o),o.isLive().addInterest("setLive",e),o.isLive().getValue()&&e.setLive(!0)),e.setup(),r.setValue(e.rootNodes))}.bind(this))},createX3DFromURL:function(e,t,n){if(3===arguments.length)return this.createVrmlFromURL(e,t,n);var i=this.currentScene,r=this.isExternal(),o=new c(this.getWorld()).createX3DFromURL(e,null);return r||(o.setExecutionContext(i),i.isLive().addInterest("setLive",o),i.isLive().getValue()&&o.setLive(!0)),o.setup(),o},loadURL:function(e,t){this.loadCount_.removeInterest("set_loadCount__",this),this.prepareEvents().removeInterest("bind",this),this.loader&&this.loader.abort(),this.setBrowserLoading(!0),this.addLoadCount(this),this.loader=new c(this.getWorld()),this.loader.createX3DFromURL(e,t,function(e){this.getBrowserOptions().getSplashScreen()||this.getCanvas().fadeIn(0),e?this.replaceWorld(e):setTimeout(function(){this.getSplashScreen().find(".cobweb-spinner-text").text(p("Failed loading world."))}.bind(this),31)}.bind(this),function(e){this.currentScene.changeViewpoint(e),this.removeLoadCount(id),this.setBrowserLoading(!1)}.bind(this),function(e,t){t?window.open(e,t):location=e,this.removeLoadCount(id),this.setBrowserLoading(!1)}.bind(this))},addBrowserListener:function(e,t){},removeBrowserListener:function(e){},addBrowserCallback:function(e,t){},removeBrowserCallback:function(e){},importDocument:function(e){if(e){var t=this.currentScene,n=this.isExternal(),i=this.createScene();return new h(i).parseIntoScene(e),n||(i.setExecutionContext(t),t.isLive().addInterest("setLive",i),t.isLive().getValue()&&i.setLive(!0)),i.setup(),i}},setBrowserOption:function(e,t){this.getBrowserOptions().getField(e).setValue(t)},getBrowserOption:function(e){return this.getBrowserOptions().getField(e).getValue()},getBrowserProperty:function(e){return this.getBrowserProperties().getField(e).getValue()},getRenderingProperty:function(e){this.getRenderingProperties().getField(e).getValue()},firstViewpoint:function(){var e=this.getActiveLayer();if(e){var t=e.getUserViewpoints();t.length&&this.bindViewpoint(t[0])}},previousViewpoint:function(){var e=this.getActiveLayer();if(e){var t=e.getUserViewpoints();if(0===t.length)return;for(var n=0,i=0;i<t.length&&!t[i].isBound_.getValue();++i)++n;n<t.length?0===n?this.bindViewpoint(t[t.length-1]):this.bindViewpoint(t[n-1]):this.bindViewpoint(t[t.length-1])}},nextViewpoint:function(){var e=this.getActiveLayer();if(e){var t=e.getUserViewpoints();if(0===t.length)return;for(var n=0,i=0;i<t.length&&!t[i].isBound_.getValue();++i)++n;n<t.length?n===t.length-1?this.bindViewpoint(t[0]):this.bindViewpoint(t[n+1]):this.bindViewpoint(t[0])}},lastViewpoint:function(){var e=this.getActiveLayer();if(e){var t=e.getUserViewpoints();t.length&&this.bindViewpoint(t[t.length-1])}},changeViewpoint:function(e){try{this.currentScene.changeViewpoint(e)}catch(e){console.log(e.message)}},bindViewpoint:function(e){e.isBound_.getValue()?e.transitionStart(e):e.set_bind_=!0},addRoute:function(e,t,n,i){this.currentScene.addRoute(e,t,n,i)},deleteRoute:function(e,t,n,i){try{var r=this.currentScene.getRoute(e,t,n,i);r&&this.currentScene.deleteRoute(r)}catch(e){console.log(e)}},beginUpdate:function(){this.setLive(!0),this.getExecutionContext().setLive(!0),this.advanceTime(performance.now())},endUpdate:function(){this.setLive(!1),this.getExecutionContext().setLive(!1)},print:function(){for(var t="",n=0;n<arguments.length;++n)t+=arguments[n];console.log(t),e(".cobweb-console").append(t)},println:function(){for(var t="",n=0;n<arguments.length;++n)t+=arguments[n];console.log(t),t+="\n",e(".cobweb-console").append(t)}}),Object.defineProperty(f.prototype,"name",{get:function(){return"Cobweb"},enumerable:!0,configurable:!1}),Object.defineProperty(f.prototype,"version",{get:function(){return t},enumerable:!0,configurable:!1}),Object.defineProperty(f.prototype,"description",{get:function(){return this.description_},set:function(e){this.description_=e,this.getNotification().string_=e},enumerable:!0,configurable:!1}),Object.defineProperty(f.prototype,"currentScene",{get:function(){return this.getScriptStack()[this.getScriptStack().length-1].getExecutionContext()},enumerable:!0,configurable:!1}),f}),define("cobweb/X3D",["jquery","cobweb/Error","cobweb/Basic/X3DFieldDefinition","cobweb/Basic/FieldDefinitionArray","cobweb/Basic/X3DField","cobweb/Basic/X3DArrayField","cobweb/Fields","cobweb/Browser/X3DBrowser","cobweb/Configuration/ComponentInfo","cobweb/Configuration/ComponentInfoArray","cobweb/Configuration/ProfileInfo","cobweb/Configuration/ProfileInfoArray","cobweb/Configuration/UnitInfo","cobweb/Configuration/UnitInfoArray","cobweb/Execution/X3DExecutionContext","cobweb/Execution/X3DScene","cobweb/Prototype/ExternProtoDeclarationArray","cobweb/Prototype/ProtoDeclarationArray","cobweb/Prototype/X3DExternProtoDeclaration","cobweb/Prototype/X3DProtoDeclaration","cobweb/Routing/RouteArray","cobweb/Routing/X3DRoute","cobweb/Bits/X3DConstants"],function(e,t,n,i,r,o,s,a,u,l,c,h,d,p,f,g,m,b,w,y,x,v,_){function S(t,n){var i=e("<X3DCanvas></X3DCanvas>");return t instanceof s.MFString&&i.attr("url",t.toString()),F(i),i[0]}function C(t){return e(t).data("browser")}function F(t){t=e(t);var n=new a(t);return t.data("browser",n),n.setup(),n}function T(n,i){"function"==typeof n&&M.done(n),"function"==typeof i&&V.done(i),O||(O=!0,e(function(){var n=e("X3DCanvas");try{var i=e.map(n,F);if(D=i.length,n.length)for(var r=0;r<D;++r){var o=i[r];o.initialized().addFieldCallback("initialized"+o.getId(),N.bind(null,o))}else N(null)}catch(e){t.fallback(n),V.resolve(e)}}))}function N(e){e&&e.initialized().removeFieldCallback("initialized"+e.getId()),--D>0||M.resolve()}console||(console={}),console.log||(console.log=function(){}),console.info||(console.info=console.log),console.warn||(console.warn=console.log),console.error||(console.error=console.log);var O=!1,M=e.Deferred(),V=e.Deferred(),D=0;return e.extend(T,s,{require:require,define:define,getBrowser:C,createBrowser:S,X3DConstants:_,X3DFieldDefinition:n,FieldDefinitionArray:i,X3DField:r,X3DArrayField:o,X3DExecutionContext:f,X3DScene:g,ComponentInfo:u,ComponentInfoArray:l,ProfileInfo:c,ProfileInfoArray:h,UnitInfo:d,UnitInfoArray:p,ExternProtoDeclarationArray:m,ProtoDeclarationArray:b,X3DExterProtonDeclaration:w,X3DProtoDeclaration:y,RouteArray:x,X3DRoute:v}),T}),function(){function e(t,n){e.callbacks.push(t),e.fallbacks.push(n)}function t(e){require(["cobweb/Error"],function(t){t(e,window.X3D.fallbacks),delete window.X3D})}e.require=require,e.define=define,e.callbacks=[],e.fallbacks=[],function(){if(window.X3D=e,void 0===window.Proxy)return t("Proxy is not defined");require(["cobweb/X3D"],function(e){var t=window.X3D.callbacks,n=window.X3D.fallbacks;window.X3D=e,e();for(var i=0;i<t.length;++i)e(t[i],n[i])},t)}()}(),define("cobweb.js",function(){})}();